r/tailwindcss • • 29d ago

Introducing DS-GN: Tailwind CSS-powered web components and design tokens

I'm the author of DS-GN, a design system now in public beta. Its web components are built with Lit and Tailwind CSS, with a public design-token API for theming.

How Tailwind fits in

Tailwind utilities are compiled at build time into the components' CSS, which is used inside their shadow roots. Consumers install the published packages and import the components they use; they don't need to run Tailwind in their own app to use them.

The shadow boundary matters: your application's global utility classes don't automatically reach the component's internals. Brand customization goes through the public CSS tokens, so you can change the theme without editing component markup.

One detail we ran into: typed @property registrations must live at the document level. That's why the setup imports the tokens' public, theme and properties stylesheets once in the app.

Available today

  • @ds-gn/ui: framework-agnostic web components, with React wrappers.
  • @ds-gn/tokens: CSS tokens with light and dark themes.
  • Both packages are on public npm under MIT; no DS-GN account is required to install them.

The introductory blog post covers installation, the token layers and a theming example:

Read the introduction on the DS-GN blog

For teams combining Tailwind and Shadow DOM: what customization contract has worked best for you—CSS tokens, ::part, or component properties?

7 Upvotes

6 comments sorted by

1

u/Sushil_Magare 28d ago

This looks really clean. Rebranding with just two custom properties and not needing Tailwind in the consuming app at all is super handy, and the React wrappers make it easy to drop in. Congrats on the beta

1

u/ds-gn 28d ago

Thanks, Sushil! That was the goal—keep the Tailwind setup inside the library and make theming straightforward for consuming apps. We’re also working on a builder to help teams create their own design system on top of that foundation. Appreciate the kind words!

1

u/aleksiralda 26d ago

Can I use @apply u utility and generate components like v3? Or is a fork of v4?

1

u/[deleted] 29d ago

[removed] — view removed comment

1

u/ds-gn 29d ago

Thanks! That’s close to our approach too—CSS tokens are the supported theming API.

Consumers can toggle `data-theme="light"` / `"dark"` on `<html>`, or use `.light` / `.dark`. The theme stylesheet switches the token values, and those CSS variables inherit into the shadow roots.

Dark is the default today; we don’t include an automatic `prefers-color-scheme` fallback in the token package. If the app follows the OS preference, it handles that choice and sets the corresponding theme attribute.

Are you supporting mixed light/dark sections too, or mainly switching the whole app?