Skip to content

Commit

Permalink
fix(kit): TasbWithMore fix redundant left margin for single element (
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirpotekhin authored Mar 19, 2024
1 parent d615221 commit 9245d8b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
8 changes: 8 additions & 0 deletions projects/demo-playwright/tests/kit/tabs/tabs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,12 @@ test.describe('Tabs', () => {
});
});
});

test('Single button', async ({page}) => {
await tuiGoto(page, '/navigation/tabs/API?activeItemIndex=2&sandboxWidth=133');

await expect(new TuiDocumentationPagePO(page).apiPageExample).toHaveScreenshot(
'03-tabs-single-item-01.png',
);
});
});
7 changes: 5 additions & 2 deletions projects/kit/components/tabs/tab/tab.style.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@

:host-context(tui-tabs >):first-child,
:host-context([tuiTabs] >):first-child,
:host-context(tui-tabs > :first-child),
:host-context([tuiTabs] > :first-child) {
:host-context(tui-tabs > :not(.t-overflown) >):first-child {
margin-left: 0;
}

:host-context(tui-tabs > [tuiTab] ~ :not(.t-overflown) >):first-child {
margin-left: var(--tui-tab-margin, 1.5rem);
}

:host {
.transition(~'color, box-shadow, opacity, background');
.clearbtn();
Expand Down

0 comments on commit 9245d8b

Please sign in to comment.