You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: overhaul CSS architecture — consumers own Tailwind setup
- Remove DatumProvider; consumers use ThemeProvider directly from
@datum-cloud/datum-ui/theme for light/dark/system switching
- Remove .theme-alpha class scoping; theme tokens now on :root/.dark
- Remove tw-animate-css and tailwind-scrollbar-hide from package deps;
consumers add these to their own CSS if needed
- Keep @import 'tailwindcss' in root.css for build-time @theme/@apply
processing; consumers also import tailwindcss so their custom
utilities (e.g. h-14) are generated by their own build
- Add ./styles export with "style" condition for PostCSS compatibility
- Add CSS-only entry to tsdown config; rename plugin to stableCssName
- Update storybook and docs apps to own their Tailwind setup
- Update docs content (installation, theming, providers) and README
Each component may have additional peer dependencies — check the component's doc page for the specific install command.
21
21
22
-
## Provider Setup
22
+
## Styles Setup
23
23
24
-
Wrap your app with `DatumProvider` — it automatically loads all design tokens, theme variables, and component styles:
24
+
Add the datum-ui styles import to your CSS file, after Tailwind:
25
+
26
+
```css
27
+
/* app.css */
28
+
@import'tailwindcss';
29
+
@import'@datum-cloud/datum-ui/styles';
30
+
```
31
+
32
+
This loads all design tokens, theme variables, fonts, and component styles. datum-ui's tokens are registered with Tailwind via `@theme inline`, so utilities like `bg-primary` and `text-foreground` work automatically in your code.
33
+
34
+
## Theme Provider
35
+
36
+
Wrap your app with `ThemeProvider` for light/dark/system theme switching:
`DatumProvider` applies the theme class automatically on `<html>`. By default it uses the `alpha` theme style. You can change it via the `themeStyle` prop:
Purpose tokens are defined on `:root` for light mode and overridden in `.dark` for dark mode. They are registered with Tailwind via `@theme inline`, so you can use utilities like `bg-primary`, `text-foreground`, `border-border` in your own code.
21
14
22
15
## Available Tokens
23
16
@@ -43,7 +36,7 @@ datum-ui uses a three-layer token system:
43
36
44
37
## Dark Mode
45
38
46
-
datum-ui supports dark mode via the `.dark` class. `DatumProvider` handles theme switching with a built-in theme provider that supports system preference detection, localStorage persistence, and CSS transition control.
39
+
datum-ui supports dark mode via the `.dark` class on `<html>`. Use `ThemeProvider` for automatic switching:
0 commit comments