-
Notifications
You must be signed in to change notification settings - Fork 71
feat(eds-tokens): use single css variables export #4098
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR consolidates CSS variables exports by replacing separate static and dynamic CSS files with a single unified CSS variables export. The primary purpose is to simplify the API by removing the static/dynamic distinction and providing a single entry point for CSS variables.
- Removes separate static and dynamic CSS variable files and build processes
- Consolidates to a single
variables.css
export - Updates color token values across various semantic color themes
- Updates documentation to reflect the simplified API
Reviewed Changes
Copilot reviewed 42 out of 42 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
packages/eds-tokens/src/css/index-variables-static.css | Removed - static CSS variables index file |
packages/eds-tokens/src/css/index-variables-dynamic.css | Removed - dynamic CSS variables index file |
packages/eds-tokens/package.json | Removes static/dynamic export entries and simplifies build scripts |
packages/eds-tokens/build/json/color/static/nested/semantic.json | Updates fill-muted color values for various semantic themes |
packages/eds-tokens/build/js/color/static/semantic.js | Updates exported color constants with new hex values |
packages/eds-tokens/build/css/variables.css | Updates CSS custom properties with new color values |
packages/eds-tokens/README.md | Simplifies documentation to reference single CSS import |
… the new solution
49ca544
to
eb6b5d0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! 💯
…port (#4098) * feat(eds-tokens): remove static and dynamic export and build new variables * docs(eds-tokens): update readme to reflect new import * feat(eds-tailwind): update README and CSS imports for EDS tokens integration * docs(eds-tokens): enhance README with detailed usage instructions for the new solution * feat(eds-tokens): add light and dark semantic colours in js and json * fix(eds-demo): update CSS import to use variables * fix(eds-tailwind): fix package peer dependency * docs(eds-tokens): remove hex preview and import of primitives
This pull request introduces significant improvements to the Equinor Design System (EDS) tokens and Tailwind integration. The main focus is on enhancing the documentation, clarifying and modernizing the usage of CSS variables for theming (including light/dark support), and improving how EDS tokens are imported and consumed in both CSS and JavaScript/TypeScript. Additionally, it introduces new semantic color scheme token files and updates the build process to support these.
Key changes include:
Documentation and Usage Improvements
@equinor/eds-tokens
README to explain the new CSS variable system, how to use color and spacing tokens in both CSS and JS/TS, and the differences between the new and legacy token systems. Added migration recommendations and detailed usage examples.@equinor/eds-tailwind
README to provide installation instructions, clarify the correct import order for CSS variables and theme, and explain the rationale for explicit token imports.Theme and Token Import Refactoring
variables-dynamic.css
/variables-static.css
to the unified@equinor/eds-tokens/css/variables
entrypoint, both in example apps and in the Tailwind theme. This ensures consistent, theme-aware variable usage and prevents duplicate imports. [1] [2]Semantic Color Scheme Token Generation
[data-color-scheme="light"]
and[data-color-scheme="dark"]
selectors. [1] [2]Package and Dependency Updates
@equinor/eds-tailwind
to require@equinor/eds-tokens
as a peer dependency, and improved its exports for better integration and tree-shaking.These changes make it easier and more robust to use EDS tokens with Tailwind and across different platforms, while providing clear guidance for both new and existing projects.