Skip to content
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

[discovery] Ensure generated CSS utility classes from style-dictionary use CSS variables instead of resolved values #2016

Closed
1 task
Tracked by #246
adamstankiewicz opened this issue Feb 13, 2023 · 0 comments · Fixed by #2022
Labels

Comments

@adamstankiewicz
Copy link
Member

Description

Currently, the style-dictionary config generates a utility-classes.css file. This file contains many CSS utility classes but use hardcoded (i.e., resolved) values rather than referencing an associated CSS variable.

Example:

/* utility-classes.css */
.bg-dark {
  background-color: #273F2FFF !important;
}

/* variables.css */
--pgn-color-dark-base: #273F2FFF;

As is, .bg-dark and var(--pgn-color-dark-base) are essentially the same. If, however, the var(--pgn-color-dark-base) CSS variable is changed at runtime (e.g., manually overridden in the application instead of changing the theme tokens), it'll update styles using the CSS variable but any usage of the .bg-dark utility class would remain the original color, not the custom overridden one, when before these color values represented the same thing.

Acceptance Criteria

  • Ensure generated CSS utility classes make use of CSS variables as opposed to their resolved values.
@adamstankiewicz adamstankiewicz added this to the Design tokens with style-dictionary milestone Feb 13, 2023
@adamstankiewicz adamstankiewicz moved this from 📋 Backlog to 👀 In review in Paragon Working Group Feb 23, 2023
@viktorrusakov viktorrusakov linked a pull request Apr 27, 2023 that will close this issue
10 tasks
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Paragon Working Group Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Closed
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants