chore(theme): improve options type

This commit is contained in:
Benjamin Canac
2024-06-05 22:12:11 +02:00
parent ecc2240df0
commit 3f2b1b12cd
18 changed files with 220 additions and 192 deletions

View File

@@ -1,4 +1,6 @@
export default (config: { colors: string[] }) => ({
import type { ModuleOptions } from '../module'
export default (options: Required<ModuleOptions>) => ({
slots: {
root: 'relative',
fieldset: 'flex',
@@ -13,7 +15,7 @@ export default (config: { colors: string[] }) => ({
},
variants: {
color: {
...Object.fromEntries(config.colors.map((color: string) => [color, {
...Object.fromEntries(options.colors.map((color: string) => [color, {
base: `focus-visible:outline-${color}-500 dark:focus-visible:outline-${color}-400`,
indicator: `bg-${color}-500 dark:bg-${color}-400`
}])),