Skip to content

[v4] Best way to share design system configuration now that presets have been deleted #16845

Closed Answered by wongjn
lauthieb asked this question in Help
Discussion options

You must be logged in to vote

Presets in v4 are now CSS files. You'd @import these CSS files into your own. So:

/* preset.css */

@theme {
  --accent-color-main: var(--vp-semantic-color-background-main);
  --accent-color-alternative: var(--vp-semantic-color-background-alternative);
  …
}

@utility text-subtitle-m {
  /**
   * Try adding `@reference "tailwindcss/theme.css"` at the top of this file if
   * you get unknown variant errors.
   */
  @variant sm {
    text-transform: var(--vp-semantic-typography-screen-s-subtitle-m-text-case);
    text-decoration: var(--vp-semantic-typography-screen-s-subtitle-m-text-decoration);
    …
  }
}
@import "tailwindcss";
@import "@xxx/design-tokens/tailwindcss-preset";

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lauthieb
Comment options

Answer selected by lauthieb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants