Skip to content

Conversation

torleifhalseth
Copy link
Collaborator

@torleifhalseth torleifhalseth commented Oct 14, 2025

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

  • Expanded and clarified the @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.
  • Updated the @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

  • Changed all relevant imports from 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]
  • Removed direct imports of static/dynamic color scheme files in favor of the new approach. [1] [2] [3]

Semantic Color Scheme Token Generation

  • Updated the token build script to generate separate light and dark semantic color scheme files for both CSS and JS/TS consumption, enabling direct use of theme-specific tokens in code.
  • Added auto-generated CSS files for light and dark semantic color schemes, providing all semantic color variables under [data-color-scheme="light"] and [data-color-scheme="dark"] selectors. [1] [2]

Package and Dependency Updates

  • Updated @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.

@Copilot Copilot AI review requested due to automatic review settings October 14, 2025 12:49
Copy link
Contributor

@Copilot Copilot AI left a 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

@torleifhalseth torleifhalseth changed the title feat(eds tokens): use single css variables export feat(eds-tokens): use single css variables export Oct 14, 2025
@torleifhalseth torleifhalseth force-pushed the feat/eds-tokens-variable-export branch from 49ca544 to eb6b5d0 Compare October 15, 2025 12:25
Copy link
Collaborator

@pomfrida pomfrida left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! 💯

@torleifhalseth torleifhalseth merged commit 15689fb into develop Oct 16, 2025
9 checks passed
@torleifhalseth torleifhalseth deleted the feat/eds-tokens-variable-export branch October 16, 2025 07:08
@github-actions github-actions bot mentioned this pull request Oct 16, 2025
pomfrida pushed a commit that referenced this pull request Oct 16, 2025
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants