From 6ffd8962c978fa6a4839163eb2aac123395d9251 Mon Sep 17 00:00:00 2001 From: Aidan Bleser Date: Tue, 13 Aug 2024 12:14:07 -0500 Subject: [PATCH] fix: Tabs overflow handling --- src/lib/components/shared/demo.svelte | 2 +- src/lib/components/ui/tabs/tabs-list.svelte | 43 ++++++++++++++++++++- src/routes/tabs/+page.svelte | 6 +++ src/routes/tabs/overflow-tabs.svelte | 29 ++++++++++++++ tailwind.config.ts | 16 +++++++- 5 files changed, 92 insertions(+), 4 deletions(-) create mode 100644 src/routes/tabs/overflow-tabs.svelte diff --git a/src/lib/components/shared/demo.svelte b/src/lib/components/shared/demo.svelte index 2c040bb..bfacafa 100644 --- a/src/lib/components/shared/demo.svelte +++ b/src/lib/components/shared/demo.svelte @@ -70,7 +70,7 @@

{/if}
diff --git a/src/lib/components/ui/tabs/tabs-list.svelte b/src/lib/components/ui/tabs/tabs-list.svelte index b207642..782aa99 100644 --- a/src/lib/components/ui/tabs/tabs-list.svelte +++ b/src/lib/components/ui/tabs/tabs-list.svelte @@ -1,6 +1,7 @@ - + + + {#if preBlur} + + {/if} + + {#if postBlur} + + {/if} diff --git a/src/routes/tabs/+page.svelte b/src/routes/tabs/+page.svelte index 9f7e5f4..999d4f4 100644 --- a/src/routes/tabs/+page.svelte +++ b/src/routes/tabs/+page.svelte @@ -5,6 +5,8 @@ import default_code from './default.svelte?raw'; import DisableSpecificTabs from './disable-specific-tabs.svelte'; import disable_specific_tabs_code from './disable-specific-tabs.svelte?raw'; + import Overflow from './overflow-tabs.svelte'; + import overflow_code from './overflow-tabs.svelte?raw'; import Secondary from './secondary.svelte'; import secondary_code from './secondary.svelte?raw'; import WithIcons from './with-icons.svelte'; @@ -29,4 +31,8 @@ + + + + diff --git a/src/routes/tabs/overflow-tabs.svelte b/src/routes/tabs/overflow-tabs.svelte new file mode 100644 index 0000000..1869860 --- /dev/null +++ b/src/routes/tabs/overflow-tabs.svelte @@ -0,0 +1,29 @@ + + + + + {#each tabs as { title, value }} + {title} + {/each} + + diff --git a/tailwind.config.ts b/tailwind.config.ts index d46a88f..2eb5ab9 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -156,7 +156,21 @@ const config: Config = { } } }, - plugins: [typography] + plugins: [ + typography, + function ({ addUtilities }) { + const newUtilities = { + '.no-scrollbar': { + '-ms-overflow-style': 'none', + 'scrollbar-width': 'none', + '&::-webkit-scrollbar': { + display: 'none' + } + } + }; + addUtilities(newUtilities); + } + ] }; export default config;