Skip to content

feat(design-tokens): restructure tokens, option to override severity#4105

Merged
Barsnes merged 28 commits intomainfrom
theme/global-files
Oct 20, 2025
Merged

feat(design-tokens): restructure tokens, option to override severity#4105
Barsnes merged 28 commits intomainfrom
theme/global-files

Conversation

@Barsnes
Copy link
Member

@Barsnes Barsnes commented Oct 1, 2025

Summary

resolves #3533
resolves #3522

This PR removes the need for a global.json file.
It moves all global colors to the theme file, and removes the need for names such as "red".
It also removes the need for "purple", and now directly generates the "scale" for link visited. We still use the same purple hex code, to make sure future changes to our color values will be reflected.

As a bonus, I extended our overrides to allow "severityColors"

Checks

@changeset-bot
Copy link

changeset-bot bot commented Oct 1, 2025

🦋 Changeset detected

Latest commit: df526f8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@digdir/designsystemet-theme Minor
@digdir/designsystemet Minor
@digdir/designsystemet-react Minor
@digdir/designsystemet-css Minor

Not sure what this means? Click here to learn what changesets are.

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

@Barsnes Barsnes changed the title feat(design-tokens): split global.json into separate files feat(design-tokens): remove global colors, add severity colors to theme Oct 1, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2025

Preview deployments for this pull request:

storybook - 20. Oct 2025 - 13:25

@Barsnes Barsnes changed the title feat(design-tokens): remove global colors, add severity colors to theme feat(design-tokens): restructure tokens Oct 2, 2025
@Barsnes Barsnes changed the title feat(design-tokens): restructure tokens feat(design-tokens): restructure tokens, option to override severity Oct 2, 2025
@Barsnes Barsnes marked this pull request as ready for review October 2, 2025 13:17
@Barsnes Barsnes requested review from Febakke and unekinn October 2, 2025 13:17
- Moved severity colors directly to your theme file
- `"link.color.visited"` now references `"$value": "color.link.visited"` from your theme file

Make sure to update your design tokens
Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps this should be more explicit, "Make sure to regenerate your design tokens with the cli" or something like that

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I'll update with the actual command :)

Copy link
Collaborator

@oddvernes oddvernes left a comment

Choose a reason for hiding this comment

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

Looks good to me, but you may want input from others as well 👍

@Barsnes Barsnes merged commit 53c667e into main Oct 20, 2025
22 checks passed
@Barsnes Barsnes deleted the theme/global-files branch October 20, 2025 12:01
@github-actions github-actions bot mentioned this pull request Oct 20, 2025
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.

Change global design-tokens colors structure Improve global/severity colors usage

2 participants