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

[Token-docs] Static semantic colors with comments #3661

Open
wants to merge 4 commits into
base: tokens-page
Choose a base branch
from

Conversation

KenAJoh
Copy link
Collaborator

@KenAJoh KenAJoh commented Mar 14, 2025

Description

Allows for editing each semantic color definition by itself

Component Checklist 📝

  • JSDoc
  • Examples
  • Documentation / Decision Records
  • Storybook
  • Style mappings (@navikt/core/css/config/_mappings.js)
  • Component tokens (@navikt/core/css/tokens.json)
  • CSS class deprecations (@navikt/aksel-stylelint/src/deprecations.ts)
  • Exports (@navikt/core/react/src/index.ts and @navikt/core/react/package.json)
  • New component? CSS import (@navikt/core/css/index.css)
  • Breaking change? Update migration guide. Consider codemod.
  • Changeset (Format: <Component>: <gitmoji?> <Text>. E.g. "Button: ✨ Add feature xyz.")

@KenAJoh KenAJoh requested review from it-vegard and Copilot March 14, 2025 11:40
Copy link

changeset-bot bot commented Mar 14, 2025

⚠️ No Changeset found

Latest commit: 66019f6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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 introduces static semantic token configurations with detailed role‐specific files for various color roles and updates the semantic tokens aggregation logic. Key changes include:

  • Addition of separate token configuration files for roles such as info, accent, warning, success, danger, neutral, and brand/meta variants.
  • Refactoring of the semantic role tokens file to use a consolidated mapping (semanticRoleConfig) in place of dynamically generating tokens.
  • Update of the index file to reference the new semanticRoleConfig during CSS bundle generation.

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
@navikt/core/tokens/darkside/tokens/colors/semantic-roles/info.tokens.ts Added static token config for the info semantic role.
@navikt/core/tokens/darkside/tokens/colors/semantic-roles/accent.tokens.ts Added static token config for the accent semantic role.
@navikt/core/tokens/darkside/tokens/colors/semantic-roles/warning.tokens.ts Added static token config for the warning semantic role.
@navikt/core/tokens/darkside/tokens/colors/semantic-roles/success.tokens.ts Added static token config for the success semantic role.
@navikt/core/tokens/darkside/tokens/colors/semantic-roles/danger.tokens.ts Added static token config for the danger semantic role.
@navikt/core/tokens/darkside/tokens/colors/semantic-roles/neutral.tokens.ts Added static token config for the neutral semantic role.
@navikt/core/tokens/darkside/tokens/colors/semantic-roles/brand-blue.tokens.ts Added static token config for the brand-blue semantic role.
@navikt/core/tokens/darkside/tokens/colors/semantic-roles/meta-lime.tokens.ts Added static token config for the meta-lime semantic role.
@navikt/core/tokens/darkside/tokens/colors/semantic-roles/brand-beige.tokens.ts Added static token config for the brand-beige semantic role.
@navikt/core/tokens/darkside/tokens/colors/semantic-roles/brand-magenta.tokens.ts Added static token config for the brand-magenta semantic role.
@navikt/core/tokens/darkside/tokens/colors/semantic-roles/meta-purple.tokens.ts Added static token config for the meta-purple semantic role.
@navikt/core/tokens/darkside/tokens/colors/semantic-role.tokens.ts Refactored to consolidate individual role configs into a semanticRoleConfig mapping.
@navikt/core/tokens/darkside/index.ts Updated to reference semanticRoleConfig instead of generating tokens dynamically.
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.

1 participant