Gathering detailed insights and metrics for @utrecht/design-tokens
Gathering detailed insights and metrics for @utrecht/design-tokens
Gathering detailed insights and metrics for @utrecht/design-tokens
Gathering detailed insights and metrics for @utrecht/design-tokens
Work in Progress: Utrecht Design System based on the NL Design System architecture. Storybook: https://nl-design-system.github.io/utrecht/storybook/
npm install @utrecht/design-tokens
Typescript
Module System
Node Version
NPM Version
83.1
Supply Chain
99.3
Quality
91.9
Maintenance
100
Vulnerability
87.1
License
@utrecht/component-library-css@7.3.0
Updated on Jun 18, 2025
@utrecht/design-tokens@3.3.0
Updated on Jun 18, 2025
@utrecht/tooltip-react@1.0.0
Updated on Jun 18, 2025
@utrecht/tooltip-css@1.0.0
Updated on Jun 18, 2025
@utrecht/component-library-vue@2.3.1
Updated on Jun 16, 2025
@utrecht/design-tokens@3.2.0
Updated on May 27, 2025
TypeScript (73.02%)
SCSS (12.42%)
HTML (5.82%)
JavaScript (4.42%)
MDX (2.33%)
CSS (1.14%)
Vue (0.84%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
EUPL-1.2 License
29 Stars
3,715 Commits
23 Forks
7 Watchers
258 Branches
48 Contributors
Updated on Jun 28, 2025
Latest Version
3.3.0
Package Id
@utrecht/design-tokens@3.3.0
Unpacked Size
12.68 MB
Size
718.57 kB
File Count
184
NPM Version
10.9.2
Node Version
22.16.0
Published on
Jun 18, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
This project is very much WORK IN PROGRESS and most parts are released as alpha version. Always define the exact version you want to use, and test for breaking changes before upgrading to a newer alpha release.
Design tokens are design decisions for our design system, in this case maintained in JSON files, and distributed in various other code languages for easy reuse.
The design tokens in this package serve as single source of truth for the look and feel for our websites, apps and designs of new products and services.
To find out what design tokens are available, browser through the .tokens.json
files in the src/
directory.
We currently don't have any additional documentation for every specific design token.
Brand design tokens describe design choices regarding color and typography. We provide a limited choice of fonts and a limited color palette, please avoid choosing other fonts and colors.
Common design tokens are relevant to a wide range of components and situations. They help provide a consistent user experience. We provide design tokens for feedback colors (error, success, et cetera), the focus state, spacing, and so on. Components should reuse design tokens from the common layer where possible, to achieve a consistent look and feel.
Design decisions at a component level, to make components look a very specific way. They are applied by the component library of the design system.
dist/index.css
Opt-in way to apply all the CSS variables to HTML elements with the utrecht-theme
class name:
1<!DOCTYPE html> 2<html class="utrecht-theme"> 3 <!-- var(--utrecht-button-font-family) works here...! --> 4</html>
This method is the preferred way to style the page.
Theme variations based on a media query are opt-in.
utrecht-theme--media-query-color-scheme
to support dark mode.Warning: Only use dark mode when all components on your page support dark mode, including 3rd party components.utrecht-theme--media-query-viewport
to support responsive styling of certain components.utrecht-theme--media-query
to enable both dark mode and responsive layout with one class name.For example:
1<!DOCTYPE html> 2<html class="utrecht-theme utrecht-theme--media-query"> 3 <!-- this page supports light and dark mode as well as responsive layout --> 4</html>
dist/root.css
Automatically applies all the CSS variables to HTML elements to the :root
element:
1<!DOCTYPE html> 2<html> 3 <!-- var(--utrecht-button-font-family) works here...! --> 4</html>
This method should only be used in case there is no control over the HTML template and the utrecht-theme
class name cannot be included.
dist/property.css
Experimental CSS @property
definitions for the design tokens that are configurable via CSS custom properties. Including these definitions is not necessarily side-effect free: with syntax
invalid values for custom properties will be ignored, and inherits
and initial-value
declarations can influence behavior. Because not all browsers support the @property
declaration, including this file can result in rendering differences between browsers.
1<link rel="stylesheet" href="https://unpkg.com/@utrecht/design-tokens/dist/property.css" />
This file should only be included when you have visual regression test for both browsers that do and don't support @property
.
dist/index.js
Use files from this package in JavaScript projects, for example in React Native or Storybook:
1import { utrechtButtonFontSize } from "@utrecht/design-tokens/dist/index.mjs";
dist/_variables.scss
1@import "~@utrecht/design-tokens/dist/variables"; 2 3button { 4 font-size: $utrecht-button-font-size; 5}
SCSS variables are not the preferred way to style components, it is better to use CSS variables, because they can be configured differently in a specific context, whereas SCSS variables are given a fixed value at build-time.
However, SCSS variables could be very useful to re-use values where CSS variables cannot be used, like inside CSS media queries:
1@import "~@utrecht/design-tokens/dist/variables"; 2 3@media (min-width: $utrecht-viewport-scale-xl-width) { 4 --utrecht-heading-1-font-size: 3rem; 5}
SCSS variables are also useful in the process of incrementally migrating away from your a codebase that currently uses SCSS, such as a website built with Bootstrap 4 components, by already using the design tokens as single source of truth. For example:
1@import "../node_modules/bootstrap/scss/bootstrap"; 2 3$body-bg: $utrecht-document-background-color; 4$body-color: $utrecht-document-color;
To use the design tokens in your site via CSS variables, first include the design token definitions in the <head>
section of your HTML page:
1<link rel="stylesheet" href="https://unpkg.com/@utrecht/design-tokens/dist/index.css" />
Then add the utrecht-theme
class name to your page:
1<html class="utrecht-theme"> 2 ... 3</html>
Now the CSS variables will be available and you can use of all the design tokens:
1.my-button { 2 background-color: var(--utrecht-color-red-50); 3 color: var(--utrecht-color-white); 4}
The design tokens are stored in JSON files so we can use the design token translation tool Style Dictionary to make them available in many code languages. We use .tokens.json
as file extension for our design token definitions, to tell them apart from regular and unrelated .json
files.
Style Dictionary only recognizes one nesting level per file, so be careful to not to mix nesting levels in one file and separate them into multiple files.
The following example doesn't work, because the CSS output would only be --utrecht-button-focus-background-color: navy
.
1{ 2 "utrecht": { 3 "button": { 4 "background-color": "blue", 5 "focus": { 6 "background-color": "navy" 7 } 8 } 9 } 10}
Organize the design tokens in multiple files instead:
block.tokens.json
:
1{ 2 "utrecht": { 3 "button": { 4 "background-color": "blue", 5 "focus": { 6 "background-color": "navy" 7 } 8 } 9 } 10}
modifier.tokens.json
:
1{ 2 "utrecht": { 3 "button": { 4 "background-color": "blue", 5 "focus": { 6 "background-color": "navy" 7 } 8 } 9 } 10}
Design tokens in Style Dictionary JSON files can include CSS custom property definitions. Using a custom formatter we output a CSS file with corresponding @property
declarations.
1{ 2 "example-color": { 3 "css": { "syntax": "<color>", "inherits": true } 4 }, 5 "example-font-family": { 6 "css": { "syntax": "*", "inherits": true } 7 }, 8 "example-text-align": { 9 "css": { "syntax": "start | end", "inherits": true } 10 } 11}
syntax
: any supported name, a list of tokens and *
are allowed. Required.
inherits
: typically set to true
. While "inherits": false
is supported, it is discouraged because not all target browsers support this yet. Required.
initialValue
: also supported, but currently discouraged because not all browsers support @property
yet and it would result in significant rendering differences between supporting and non-supporting target browsers.
Copyright © 2021 Gemeente Utrecht. All rights reserved.
The open source license does NOT apply to files in this directory.
Applying design elements from this project is strictly prohibited for organisations that are not part of the Municipality of Utrecht.
This project is part of a community iniative to use NL Design System components for projects that need to adhere to the Utrecht Design System. Teams from the central Municipality of Utrecht, as well as those who are contracted by them to develop websites and apps, are able to collaborate via this project.
No vulnerabilities found.
Reason
30 commit(s) and 12 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
all changesets reviewed
Reason
license file detected
Details
Reason
no binaries found in the repo
Reason
all dependencies are pinned
Details
Reason
SAST tool is not run on all commits -- score normalized to 5
Details
Reason
branch protection is not maximal on development and all release branches
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
83 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More