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

refactor(tokens): ♻️ Added color token type to references #1439

Merged
merged 3 commits into from
Feb 1, 2024

Conversation

mimarz
Copy link
Collaborator

@mimarz mimarz commented Jan 30, 2024

resolves #1036

Added tokens of type color to references so they are outputted as reference to other css variables.

Found these tokens to be missing a referenced token:

  --fds-semantic-surface-action-second-hover: rgba(0, 49, 93, 0.9);
  --fds-semantic-surface-action-second-active: rgba(0, 49, 93, 0.8);
  
  --fds-semantic-surface-action-second-no_fill-hover: rgba(0, 49, 93, 0.1);
  --fds-semantic-surface-action-second-no_fill-active: rgba(0, 49, 93, 0.2);

Copy link
Contributor

github-actions bot commented Jan 30, 2024

Preview deployments for this pull request:

📖 Storybook 30. Jan 2024 - 15:38 (Norwegian time)

🖥 Storefront 30. Jan 2024 - 15:39 (Norwegian time)

See all deployments at https://dev.designsystemet.no

@mimarz mimarz changed the title Feat/tokens-references refactor(tokens): ♻️ Added color token type to references Jan 30, 2024
@mimarz mimarz marked this pull request as ready for review January 30, 2024 10:42
@mimarz mimarz requested a review from Barsnes as a code owner January 30, 2024 10:42
@mimarz mimarz requested review from mrosvik and Febakke January 30, 2024 10:42
@mimarz
Copy link
Collaborator Author

mimarz commented Jan 30, 2024

The implication for this is that core color tokens are also exported with the tokens.css when maybe they shouldn't, is this okay or should we not include them? @mrosvik @Febakke

This might be confusing for users looking directly at the css variable tokens and know which ones to override.

/** Referenced source tokens */ 
  --fds-colors-blue-100: #e6eff8;
  --fds-colors-blue-200: #b3d0ea;
  --fds-colors-blue-700: #0062ba;
  --fds-colors-blue-800: #004e95;
  --fds-colors-blue-900: #00315d;
  --fds-colors-white: #ffffff;
  --fds-colors-grey-100: #f4f5f6;
  --fds-colors-grey-200: #e9eaec;
  --fds-colors-grey-600: #68707c;
  --fds-colors-grey-700: #4b5563;
  --fds-colors-grey-800: #1e2b3c;
  --fds-colors-green-200: #d1f4e1;
  --fds-colors-green-300: #8be4b5;
  --fds-colors-green-700: #118849;
  --fds-colors-green-800: #0c6536;
  --fds-colors-green-900: #084826;
  --fds-colors-yellow-100: #fffbe6;
  --fds-colors-yellow-200: #fff4b4;
  --fds-colors-yellow-300: #ffed83;
  --fds-colors-red-100: #f9d5db;
  --fds-colors-red-200: #f3abb6;
  --fds-colors-red-500: #e02e49;
  --fds-colors-red-600: #b3253a;
  --fds-colors-red-700: #861c2c;
  --fds-colors-blue-400: #66a1d6;
  --fds-colors-grey-300: #d2d5d8;
  --fds-colors-orange-600: #cc7005;
  --fds-colors-orange-700: #995404;
  --fds-colors-orange-800: #663802;
  --fds-colors-yellow-500: #ffda06;
  --fds-colors-grey-400: #bcbfc5;
  --fds-colors-red-800: #5a121d;
  --fds-colors-purple-700: #7a1265;

  /** Tokens */ 
  --fds-brand-alt1-100: #feefef;
  --fds-brand-alt1-200: #fddfe0;
  --fds-brand-alt1-300: #fbbfc1;
  --fds-brand-alt1-400: #f89fa1;
  --fds-brand-alt1-500: #f67f82;
  --fds-brand-alt1-600: #f45f63;
  --fds-brand-alt1-700: #dc5659;
  --fds-brand-alt1-800: #c34c4f;
  --fds-brand-alt1-900: #B83D41;
  --fds-brand-alt2-100: #fcf7e9;
  --fds-brand-alt2-200: #faeec2;
  --fds-brand-alt2-300: #f5dda6;
  --fds-brand-alt2-400: #efcc79;
  --fds-brand-alt2-500: #eabb4d;
  --fds-brand-alt2-600: #e5aa20;
  --fds-brand-alt2-700: #ce991d;
  --fds-brand-alt2-800: #b7881a;
  --fds-brand-alt2-900: #A17717;
  --fds-brand-alt3-100: #e9f5ff;
  --fds-brand-alt3-200: #d2eafd;
  --fds-brand-alt3-300: #a5d6fb;
  --fds-brand-alt3-400: #78c1f9;
  --fds-brand-alt3-500: #4badf7;
  --fds-brand-alt3-600: #1e98f5;
  --fds-brand-alt3-700: #1b88dd;
  --fds-brand-alt3-800: #156aac;
  --fds-brand-alt3-900: #125A91;

@mimarz
Copy link
Collaborator Author

mimarz commented Feb 1, 2024

resolves #1036

Added tokens of type color to references so they are outputted as reference to other css variables.

Found these tokens to be missing a referenced token:

  --fds-semantic-surface-action-second-hover: rgba(0, 49, 93, 0.9);
  --fds-semantic-surface-action-second-active: rgba(0, 49, 93, 0.8);
  
  --fds-semantic-surface-action-second-no_fill-hover: rgba(0, 49, 93, 0.1);
  --fds-semantic-surface-action-second-no_fill-active: rgba(0, 49, 93, 0.2);

This will be fixed by #736

@mimarz
Copy link
Collaborator Author

mimarz commented Feb 1, 2024

The implication for this is that core color tokens are also exported with the tokens.css when maybe they shouldn't, is this okay or should we not include them? @mrosvik @Febakke

This might be confusing for users looking directly at the css variable tokens and know which ones to override.

/** Referenced source tokens */ 
  --fds-colors-blue-100: #e6eff8;
  --fds-colors-blue-200: #b3d0ea;
  --fds-colors-blue-700: #0062ba;
  --fds-colors-blue-800: #004e95;
  --fds-colors-blue-900: #00315d;
  --fds-colors-white: #ffffff;
  --fds-colors-grey-100: #f4f5f6;
  --fds-colors-grey-200: #e9eaec;
  --fds-colors-grey-600: #68707c;
  --fds-colors-grey-700: #4b5563;
  --fds-colors-grey-800: #1e2b3c;
  --fds-colors-green-200: #d1f4e1;
  --fds-colors-green-300: #8be4b5;
  --fds-colors-green-700: #118849;
  --fds-colors-green-800: #0c6536;
  --fds-colors-green-900: #084826;
  --fds-colors-yellow-100: #fffbe6;
  --fds-colors-yellow-200: #fff4b4;
  --fds-colors-yellow-300: #ffed83;
  --fds-colors-red-100: #f9d5db;
  --fds-colors-red-200: #f3abb6;
  --fds-colors-red-500: #e02e49;
  --fds-colors-red-600: #b3253a;
  --fds-colors-red-700: #861c2c;
  --fds-colors-blue-400: #66a1d6;
  --fds-colors-grey-300: #d2d5d8;
  --fds-colors-orange-600: #cc7005;
  --fds-colors-orange-700: #995404;
  --fds-colors-orange-800: #663802;
  --fds-colors-yellow-500: #ffda06;
  --fds-colors-grey-400: #bcbfc5;
  --fds-colors-red-800: #5a121d;
  --fds-colors-purple-700: #7a1265;

  /** Tokens */ 
  --fds-brand-alt1-100: #feefef;
  --fds-brand-alt1-200: #fddfe0;
  --fds-brand-alt1-300: #fbbfc1;
  --fds-brand-alt1-400: #f89fa1;
  --fds-brand-alt1-500: #f67f82;
  --fds-brand-alt1-600: #f45f63;
  --fds-brand-alt1-700: #dc5659;
  --fds-brand-alt1-800: #c34c4f;
  --fds-brand-alt1-900: #B83D41;
  --fds-brand-alt2-100: #fcf7e9;
  --fds-brand-alt2-200: #faeec2;
  --fds-brand-alt2-300: #f5dda6;
  --fds-brand-alt2-400: #efcc79;
  --fds-brand-alt2-500: #eabb4d;
  --fds-brand-alt2-600: #e5aa20;
  --fds-brand-alt2-700: #ce991d;
  --fds-brand-alt2-800: #b7881a;
  --fds-brand-alt2-900: #A17717;
  --fds-brand-alt3-100: #e9f5ff;
  --fds-brand-alt3-200: #d2eafd;
  --fds-brand-alt3-300: #a5d6fb;
  --fds-brand-alt3-400: #78c1f9;
  --fds-brand-alt3-500: #4badf7;
  --fds-brand-alt3-600: #1e98f5;
  --fds-brand-alt3-700: #1b88dd;
  --fds-brand-alt3-800: #156aac;
  --fds-brand-alt3-900: #125A91;

We added a disclaimer to not edit the core tokens. This should suffice for now 🤪

@mimarz mimarz merged commit 108344d into main Feb 1, 2024
5 checks passed
@mimarz mimarz deleted the feat/tokens-references branch February 1, 2024 12:49
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.

Easier to theme tokens directly in css
2 participants