it there way to make utilities bg-* with custom theme property like --surface-* without generating --bg-* classes with --color-* theme.(v4) #16402
-
ProblemI want to make bg-* classes with only --surface tokens. but it make bg-* classes with --color tokens too. I want to define bg- classes only once with --surface- themes.!!** reference you can see@theme {
--color-*: initial;
/* token-1st brand-color */
--color-primary-main: var(--color-blue-300);
--color-primary-dark: var(--color-blue-500);
--color-primary-light: var(--color-blue-50);
--color-secondary-main: var(--color-orange-500);
--color-secondary-dark: var(--color-orange-600);
--color-secondary-light: var(--color-orange-300);
--color-neutral-white: var(--color-grey-50);
--color-neutral-black: var(--color-grey-400);
--color-neutral-grey: var(--color-grey-100);
--color-status-accent: var(--color-yellow-100);
--color-status-alert: var(--color-red-100);
--color-status-disabled: var(--color-grey-200);
/* token-2nd Surface-color */
--surface-primary: var(--color-primary-main);
--surface-primary-light: var(--color-primary-light);
/* token-2nd Text-color */
/* token-2nd Border-color */
}
@utility bg-* {
background-color: --value(--surface- *);
} picture of autocomplete working well.it's not autocompleted, but I can use it by "--color-*"picture of .bg-primary-light genereated twice by "--color-" and "--surface-" |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can do: @theme {
…
/* token-2nd Surface-color */
--background-color-primary: var(--color-primary-main);
--background-color-primary-light: var(--color-primary-light); And then: <div class="bg-primary-light"> |
Beta Was this translation helpful? Give feedback.
You can do:
And then: