diff --git a/packages/core/plugins.ts b/packages/core/plugins.ts new file mode 100644 index 00000000..c3684aca --- /dev/null +++ b/packages/core/plugins.ts @@ -0,0 +1,87 @@ +import plugin from 'tailwindcss/plugin'; +import type { OptionalConfig } from 'tailwindcss/types/config'; + +export const plugins = [ + plugin(({ addUtilities, matchUtilities, theme }) => { + addUtilities({ + '.scrollbar-thin': { + 'scrollbar-width': 'thin', + }, + }); + + matchUtilities( + { + scrollbar: (value: string) => ({ + scrollbarColor: value, + }), + }, + { values: theme('colors') ?? {} } + ); + + matchUtilities( + { + 'scrollbar-w': (value: string) => ({ + '&::-webkit-scrollbar': { + width: value, + }, + }), + }, + { values: theme('spacing') ?? {} } + ); + + matchUtilities( + { + 'scrollbar-track': (value: string) => ({ + '&::-webkit-scrollbar-track': { + background: value, + }, + }), + }, + { values: theme('colors') ?? {} } + ); + + matchUtilities( + { + 'scrollbar-thumb': (value: string) => ({ + '&::-webkit-scrollbar-thumb': { + backgroundColor: value, + }, + }), + }, + { values: theme('colors') ?? {} } + ); + + matchUtilities( + { + 'scrollbar-thumb-border': (value: string) => ({ + '&::-webkit-scrollbar-thumb': { + borderRadius: value, + }, + }), + }, + { values: theme('borderRadius') ?? {} } + ); + + matchUtilities( + { + 'scrollbar-thumb-border': (value: string) => ({ + '&::-webkit-scrollbar-thumb': { + borderWidth: value, + }, + }), + }, + { values: theme('borderWidth') ?? {} } + ); + + matchUtilities( + { + 'scrollbar-thumb-border': (value: string) => ({ + '&::-webkit-scrollbar-thumb': { + borderColor: value, + }, + }), + }, + { values: theme('borderColor') ?? {} } + ); + }), +] satisfies OptionalConfig['plugins']; diff --git a/packages/core/src/lib/select/select-menu.svelte b/packages/core/src/lib/select/select-menu.svelte index 2f394621..12b27f24 100644 --- a/packages/core/src/lib/select/select-menu.svelte +++ b/packages/core/src/lib/select/select-menu.svelte @@ -28,7 +28,7 @@ export let heading = ''; {/if}