4.4.0 • Published 4 days ago

@aurodesignsystem/design-tokens v4.4.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
4 days ago

Auro Design Tokens

Installation

Build Status See it on NPM! License

$ npm i @aurodesignsystem/design-tokens

Using Pre-processed Resources

Pre-processed resources are available in the ./dist/tokens directory of the npm package.

└── tokens
  ├── CSSCustomProperties.css
  ├── CSSSizeCustomProperties.css
  ├── JSData--color.js
  ├── JSONVariablesFlat.json
  ├── JSONVariablesNested.json
  ├── JSObject--allTokens.js
  ├── JSObject--deprecated.js
  ├── JSVariables--color.js
  ├── SCSSVariableMap.scss
  ├── SCSSVariables.scss
  ├── SCSSVariablesMapFlat.scss
  ├── SassCustomProperties.scss
  ├── SassSizeCustomProperties.scss
  └── darkmode
    ├── CSSCustomProperties.css
    ├── JSDataColor.js
    ├── JSObject--allDarkTokens.js
    ├── JSVariablesColor.js
    ├── SCSSVariables.scss
    ├── SCSSVariablesMapFlat.scss
    └── SassCustomProperties.scss

Resource Descriptions

FileSyntaxTypeStatusFilter Type / Description
CSSCustomPropertiesCSSCustom propertiesCurrentAll v4.0x release tokens
CSSSizeCustomPropertiesCSSCustom propertiesCurrentFilter: size, public
JSData--colorJS moduleColor dataCurrentFilter: color, current
JSONVariablesFlatJSON DataAll dataCurrentAll v4.0x release tokens
JSONVariablesNestedJSON DataAll dataCurrentAll v4.0x release tokens
JSObject--deprecatedJS moduleDeprecated tokensCurrentFilter: deprecated, public
JSObject--allTokens.jsJS moduleAll dataCurrentAll v4.0x release tokens
JSVariables--colorJS ES6Color dataCurrentFilter: color
SCSSVariableMapSassSass variable mapCurrentFilter: size, public
SCSSVariablesSCSSSass variablesCurrentAll v4.0x release tokens
SCSSVariablesMapFlatSCSSSass variable mapCurrentAll v4.0x release tokens
SassCustomPropertiesSCSSCustom propertiesCurrentAll v4.0x release tokens
SassSizeCustomPropertiesSassCustom propertiesCurrentFilter: size, public

Migration from 3.x to 4.x

With the release of Auro Design Tokens 4.x, a new variable namespace was introduced. The project has replaced --auro with --ds to support upcoming theming capabilities.

Since not all Auro web components are using the new tokens, simply replacing the 3.x version with the 4.x version will break your UI.

To ensure a smooth transition between the two sets of design tokens, we highly recommend the following approach:

  1. Install the new @aurodesignsystem/design-tokens@4.x in your app, but DO NOT uninstall @alaskaairux/design-tokens@3.15.5.
  2. Update to use the new @aurodesignsystem/webcorestylesheets, which fully supports the new token naming spec.
  3. Review the Deprecated tokens list for a matrix of changes. Some tokens have been removed from the project and need to be updated.

By supporting both the legacy and new Auro design tokens in your project, you ensure a smooth transition until all Auro components have been updated and your project has also updated local SCSS/CSS files with the new references.

Install with Sass

When working with Sass, the preprocessor scripting language, there are several options for incorporating design tokens into your project. First, ensure that all design tokens are included to fulfill CSS custom property requests. This can be achieved by importing the SCSS file as demonstrated below:

@import "~@aurodesignsystem/design-tokens/dist/tokens/SassCustomProperties.scss";

Even if Sass isn't utilized, SassCustomProperties.scss remains an option, though not mandatory. Alternatively, you can load all tokens using CSSCustomProperties.css anywhere within the project's header.

Moreover, if project specifications dictate the use of Sass variables, SCSSVariables.scss can be imported. This is necessary for projects utilizing WCSS due to a dependency on these variables.

@import "~@aurodesignsystem/design-tokens/dist/tokens/SCSSVariables.scss";

NOTE: When developing new UI code in Sass, it's still advisable to leverage CSS custom properties over Sass variables. See Install with CSS below.

Install with CSS

For React or similar frameworks, simply import the CSS file directly from npm:

import "@aurodesignsystem/design-tokens/dist/tokens/CSSCustomProperties.css"

For other frameworks, you'll need to copy the CSS file from the npm resource into your project using a build scenario.

Install ESModules

In a webpack-supported application or a type="module" script:

import { AuroColorAlertNotificationOnLight, AuroColorBorderErrorOnLight } from '@aurodesignsystem/design-tokens/dist/tokens/JSVariables--color.js';

Install from CDN

Using the https://cdn.jsdelivr.net/npm/ CDN, every file in the dist directory can be accessed like so:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm//@aurodesignsystem/design-tokens@latest/dist/tokens/CSSCustomProperties.css">

Note: Exercise caution when using this CDN solution. The Auro team is NOT responsible for the maintenance of the CDN https://cdn.jsdelivr.net/ uptime and are unable to effectively troubleshoot response issues. It is recommended to use the installed version of Auro Design Tokens for critical UIs. Any additional CDN solution must be maintained by the team using this solution per this Discussion.

4.4.0

4 days ago

4.3.1

4 months ago

4.3.0

5 months ago

4.2.0

6 months ago

4.1.1

8 months ago

4.1.0

8 months ago

4.0.0

8 months ago