Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@alaskaairux/orion-design-tokens

Package Overview
Dependencies
Maintainers
2
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alaskaairux/orion-design-tokens

Alaska Air Orion Design System token repository

  • 2.10.11
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
549
decreased by-17.94%
Maintainers
2
Weekly downloads
 
Created
Source
Orion Design System Logo

Build Status npm (scoped) NPM

Orion Design Tokens

Orion Design Tokens are abstract UI atomic values that make up the greater Orion Design System (ODS).

The goal of this project is to maintain these core values in such a way as to feed the UI of other engineering efforts, rather than be a manually communicated design dependency.

Contained within this repository

This repository serves two purposes:

  1. To maintain the single source of record of the distributed token files
  2. Export pre-defined resources for projects to consume

The ./src dir

Within the project's src/ dir are the various token values stored in .json format. These are the production resources distributed via npm.

Config filter API

The following table illustrated the different JSON options currently being used to filter the data output.

By default, no tokens are exposed in an output file unless specifically designated by a config filter option. See the table below for the different types of filters currently in use.

filtertypedescription
attributes {category/type/option}stringfollow the pattern of the CTI Structure to determine the value of a category, type or option in the JSON
classicbooleantoken filter for classic theme values
deprecatedbooleantoken marked as deprecated will be deleted with next MAJOR release version
legacybooleantoken filter for legacy values
opacitybooleantoken filter for base colors with an alpha transparency
publicbooleantoken filter for publicly exposed Design System tokens per the most recent spec
redirectbooleantoken filter for legacy values that have a new reference
  • Classic: Tokens that reference Alaska CLASSIC themes
  • Legacy: Tokens established prior to v2.8 release
  • Public: Currently approved for use Orion Design Tokens

Additional content options are made available within the token data. See the table below for these options and their descriptions.

optiontypedescription
commentstringcomment that will appear in CSS/Sass output
referencestringnew token redirect reference
usagestringdescription of token use
wcagstringWCAG accessibility rating if applicable
valuestring / numberthe value of the token

Contributing

Please be sure to follow current Design Token patterns and follow the CTI Structure. Any submissions to this project that does not follow these guidelines will be considered non-compliant and your submission will be rejected.

Also, please see this repo's contributing guidelines.

Before submitting a pull request, please ensure that your JSON is formatted correctly. Testing is easy, you can build out resource files that are not added to the repo's version control.

To mimic a CI Build and ensure a successful build with a merge, please run the following command to test the build pipeline:

$ npm run ciBuild

All tests will run with the automated build, but it's a good idea to run tests locally to ensure stability of pull request

Install

To install in your project, see instructions from npmjs.org

npm i @alaskaairux/orion-design-tokens

Install pre-processed resources

Located in the Orion Design Tokens npm in the ./tokens directory.

└── tokens
  ├── CSSCustomProperties--classicColors.css
  ├── CSSCustomProperties.css
  ├── CSSOpacityProperties.scss
  ├── CSSSizeCustomProperties.css
  ├── SCSSSizeCustomProperties.css
  ├── CSSTokenProperties.css
  ├── JSData--color.js
  ├── JSObject--allTokens.js
  ├── JSObject--classicColors.js
  ├── JSObject--deprecated.js
  ├── JSVariables--color.js
  ├── SCSSOpacityVariables.scss
  ├── SCSSVariableMap.scss
  ├── SCSSVariables.scss
  ├── SassCustomProperties--classicColors.scss
  ├── SassCustomProperties.scss
  ├── TokenColorVariables.js
  ├── TokenVariables.esm.js
  ├── _TokenProperties.scss
  └── _TokenVariables.scss
filesyntaxtypestatusfilter type / description
CSSCustomProperties--classicColorsCSScustom propertiescurrentfilter: classic
CSSCustomPropertiesCSScustom propertiesdeprecatedfull list of v2.8 release tokens
CSSOpacityPropertiesSasscustom propertiescurrentfilter: opacity
CSSSizeCustomPropertiesCSScustom propertiescurrentfilter: size, public
SCSSSizeCustomPropertiesSasscustom propertiescurrentfilter: size, public
JSData--colorJS modulecolor datacurrentfilter: color, current
JSObject--allTokens.jsJS moduleall datacurrentfilter: public
JSObject--classicColorsjs modulecolor datacurrentfilter: classic
JSObject--deprecatedjs moduledeprecated tokenscurrentfilter: deprecated
JSVariables--colorjs es6color datacurrentfilter: color
SCSSOpacityVariablesSassSass variablescurrentfilter: opacity
SCSSVariableMapSassSass variable mapcurrentfilter: size, public
SCSSVariablesscssSass variablescurrentfull list of v2.8 release tokens
SassCustomProperties--classicColorsscsscustom propertiescurrentfilter: classic
SassCustomPropertiesscsscustom propertiescurrentfull list of v2.8 release tokens
TokenColorVariablesjs modulecolor datadeprecatedfilter: color
CSSTokenPropertiesCSScustom propertiesdeprecatedfull list of < v2.8 tokens
TokenVariables.esmjs es6all datadeprecatedfull list of < v2.8 tokens
_TokenPropertiesscsscustom propertiesdeprecatedfull list of < v2.8 tokens
_TokenVariablesscssSass variablesdeprecatedfull list of < v2.8 tokens

To install in Sass file:

@import "~@alaskaairux/orion-design-tokens/dist/tokens/SCSSVariables";

// or

@import "~@alaskaairux/orion-design-tokens/dist/tokens/SassCustomProperties";

To install CSS file:

With React or similar framework, the CSS file can be imported directly from the npm:

import "@alaskaairux/orion-design-tokens/tokens/dist/CSSCustomProperties.css";

For other frameworks, it's suggested that the CSS file be copied from the npm into the scope of the project with a build scenario.

To install ESModules file:

Within a webpacked application or a type="module" script:

import { ColorAlertNotificationOnLight, ColorBorderErrorOnLight } from '@alaskaairux/orion-design-tokens/dist/tokens/JSVariables--color.js';

Managing deprecated resources

All the Orion tokens are supported with the v2.8 release. All the new Auro tokens have been added to allow for deprecation of Orion tokens. Once v3.0 of the Design Tokens is released, all Orion tokens will be deleted from this repo.

Orion pre-processed resources

If your project is already using pre-processed resources as listed below, your project should see no change in token support.

filesyntaxtypestatusfilter type / description
TokenColorVariablesjs modulecolor datadeprecatedfilter: color
CSSTokenPropertiesCSScustom propertiesdeprecatedfull list of < v2.8 tokens
TokenVariables.esmjs es6all datadeprecatedfull list of < v2.8 tokens
_TokenPropertiesscsscustom propertiesdeprecatedfull list of < v2.8 tokens
_TokenVariablesscssSass variablesdeprecatedfull list of < v2.8 tokens

Orion local build support

If your project is using a local Style Dictionary build, by upgrading to v2.8 you will get ALL the tokens. This will include Classic, Orion and Auro.

Adding the following filters to your config.json file will filter out all the new Auro tokens and only produce a tokens stylesheet with legacy Orion and Classic tokens.

  "files": [
    {
      "filter": {
        "legacy": true
      }
    }
  ]

Moving from Orion to Auro tokens

When using the Design Tokens, all the deprecated token files have comments as to the status of the token. See examples below for comments that denote a new token to be used in place of a deprecated one, a token that should only be used with CLASSIC UIs, and a deprecated token with no replacement and will be removed with the next major release.

:root {

   --breakpoint-width-narrow: 480px; /*
  // New token, see breakpoint-sm */

   --color-classic-calm: #8ba6c1; /*
  // DO NOT USE for anything other than legacy projects or classic component themes */

   --color-background-booking-bar: #156fad; /*
  // Deprecated, no replacement; token to be REMOVED in next MAJOR release */

}

A web view of all the deprecated tokens will be made available. If required, please see the following data file for reference:

filesyntaxtypestatusfilter type / description
JSObject--deprecatedjs moduledeprecated tokenscurrentfilter: deprecated

Sass or CSS Custom Properties?

Style Dictionary is able to output variable files in either Sass or CSS Custom Properties (variables) format. The example pipeline and the style.scss file has references to both Sass and CSS variables.

Important: CSS variables need to have their references available to them in the final output CSS. Whereas Sass will convert these values to static values in the output CSS.

The example build pipeline addresses this by concatenating the CSS variables with the final CSS output file.

Hex Codes

Style Dictionary requires that color definitions be established as hex values that then can be transformed into various outputs, e.g. rgba, rgb 6-digit hex, iOS and Android color vars.

To support alpha values, it is suggested to use 8-digit or RGBA hex values, where the last digit(s) represents the alpha value. For more information see 8-Digit Hex Codes? and here for a full #RRGGBBAA table.

Native output support

Style Dictionary fully supports native platforms and is able to output resources that are usable in both iOS and Android native development.

Alaska Airlines Orion Design System
Copyright 2019 Alaska Airlines, Inc. or its affiliates. All Rights Reserved.

Keywords

FAQs

Package last updated on 22 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc