Skip to content

Commit

Permalink
fix(Tabs): added class identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
N00nDay committed Oct 5, 2023
1 parent 8e993cb commit 8af92f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/lib/components/tabs/Tab.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
const defaultClass = 'border-b-2';
$: finalClass = twMerge(
'stwui-tab',
key === $currentTab ? baseActiveClass : baseClass,
variant === 'full-width' || variant === 'bar' ? fullWidthClass : false,
variant === 'bar' ? barClass : false,
Expand Down
9 changes: 5 additions & 4 deletions src/lib/components/tabs/Tabs.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,19 @@
let selected: Writable<string> = writable(currentTab);
$: $selected = currentTab;
const barContainerClass = 'border-border overflow-hidden rounded-md shadow-md border';
const defaultContainerClass = 'border-border overflow-hidden border-b';
const barContainerClass =
'border-border overflow-hidden rounded-md shadow-md border stwui-tabs-bar-wrapper';
const defaultContainerClass = 'border-border overflow-hidden border-b stwui-tabs-wrapper';
$: finalContainerClass = twMerge(
variant === 'bar' ? barContainerClass : defaultContainerClass,
containerClass
);
const barClass = '-mb-px flex justify-evenly isolate divide-x divide-border';
const barClass = '-mb-px flex justify-evenly isolate divide-x divide-border stwui-tabs-bar';
const fullWidthClass = '-mb-px flex justify-evently';
const defaultClass = '-mb-px flex space-x-8';
const defaultClass = '-mb-px flex space-x-8 stwui-tabs';
$: finalClass = twMerge(
variant === 'bar' ? barClass : false,
Expand Down

0 comments on commit 8af92f8

Please sign in to comment.