mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-21 23:40:39 +01:00
fix(module): stop using tailwind's shorthand arbitrary variable syntax (#2366)
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
@@ -3,17 +3,17 @@ import type { ModuleOptions } from '../module'
|
||||
export default (options: Required<ModuleOptions>) => ({
|
||||
slots: {
|
||||
root: 'relative flex items-start',
|
||||
base: 'shrink-0 flex items-center justify-center rounded-[--ui-radius] text-[--ui-bg] ring ring-inset ring-[--ui-border-accented] focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2',
|
||||
base: 'shrink-0 flex items-center justify-center rounded-[var(--ui-radius)] text-[var(--ui-bg)] ring ring-inset ring-[var(--ui-border-accented)] focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2',
|
||||
container: 'flex items-center',
|
||||
wrapper: 'ms-2',
|
||||
icon: 'shrink-0 size-full',
|
||||
label: 'block font-medium text-[--ui-text]',
|
||||
description: 'text-[--ui-text-muted]'
|
||||
label: 'block font-medium text-[var(--ui-text)]',
|
||||
description: 'text-[var(--ui-text-muted)]'
|
||||
},
|
||||
variants: {
|
||||
color: {
|
||||
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, `focus-visible:outline-[--ui-${color}]`])),
|
||||
neutral: 'focus-visible:outline-[--ui-border-inverted]'
|
||||
...Object.fromEntries((options.theme.colors || []).map((color: string) => [color, `focus-visible:outline-[var(--ui-${color})]`])),
|
||||
neutral: 'focus-visible:outline-[var(--ui-border-inverted)]'
|
||||
},
|
||||
size: {
|
||||
xs: {
|
||||
@@ -44,7 +44,7 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
},
|
||||
required: {
|
||||
true: {
|
||||
label: 'after:content-[\'*\'] after:ms-0.5 after:text-[--ui-error]'
|
||||
label: 'after:content-[\'*\'] after:ms-0.5 after:text-[var(--ui-error)]'
|
||||
}
|
||||
},
|
||||
disabled: {
|
||||
@@ -61,11 +61,11 @@ export default (options: Required<ModuleOptions>) => ({
|
||||
compoundVariants: [...(options.theme.colors || []).map((color: string) => ({
|
||||
color,
|
||||
checked: true,
|
||||
class: `ring-2 ring-[--ui-${color}] bg-[--ui-${color}]`
|
||||
class: `ring-2 ring-[var(--ui-${color})] bg-[var(--ui-${color})]`
|
||||
})), {
|
||||
color: 'neutral',
|
||||
checked: true,
|
||||
class: 'ring-2 ring-[--ui-border-inverted] bg-[--ui-bg-inverted]'
|
||||
class: 'ring-2 ring-[var(--ui-border-inverted)] bg-[var(--ui-bg-inverted)]'
|
||||
}],
|
||||
defaultVariants: {
|
||||
size: 'md',
|
||||
|
||||
Reference in New Issue
Block a user