Skip to content

ads-design-tokens 0.0.1

Install from the command line:
Learn more about npm packages
$ npm install @onehub/ads-design-tokens@0.0.1
Install via package.json:
"@onehub/ads-design-tokens": "0.0.1"

About this version

CSS/SCSS Integration Process

Overview

This document outlines the process for approving and pulling in CSS/SCSS design changes into your project. The integration process involves collaboration between the design and programming teams, ensuring smooth adoption of design updates.

Notification and Versioning

  • Teams will be notified via email and team notifications when a new version of the design changes is available.
  • The notification includes a list of changes in that version for teams to review.

Submodule Integration

  • The main branch, now containing the approved design changes, will be used as a submodule in each team's project.

Example Git Commands for Submodule Integration

# Add the submodule to your project
git submodule add -b main https://github.com/onehub/ads-design-tokens.git path/to/submodule

# Initialize and update the submodule
git submodule update --init --recursive

Teams should replace the placeholder URLs and paths with their actual repository URL and desired submodule path. The -b main flag specifies the branch to track.

Updating Submodules

# Fetch the latest changes in the submodule
git submodule update --remote --merge

Replace the placeholder messages with meaningful commit messages.

Integrating submodules with scripts

Using bash scripting (or any sort that suits your team), can allow you to have a seamless setup. You could have a script to; only save the necessary files from the submodule desired, automatically move files where you want them to go, or automatically check out the tag/commit hash associated with the commit to the repo that you'd like.

Example of bash script that allows parameters of submodule name and version of submodule for easy checking out of submodule versions.

In the following example, it's assumed that the submodule has already been integrated, but you want an easy command line argument to easily switch between versions.

#!/bin/bash

while getopts "N:V:" flag
do
    case "${flag}" in
        N) NAME_OF_SUBMODULE=${OPTARG};;
        V) SUBMODULE_VERSION=${OPTARG};;
    esac
done

cd $NAME_OF_SUBMODULE
git checkout $SUBMODULE_VERSION
cd ..

Then, on command line, the following could be run to check out the submodule and version of submodule desired:

bash script.sh -N v1.1 -N submodule-test

Example of bash script that allows automatic checkout of a particular submodule and version (with file moves)

In this example, we have a script that has a set version and automatically adds the submodule with that version, moves the files to a directory, and then deletes the submodule. This could be valuable in the case where a team wants a particular version of the files, but does not want the actual submodule itself.

version=v1.0

git submodule add git@github.com:onehub/ads-design-tokens.git
cd ads-design-tokens
git checkout $version
rm -rf ../output/css/_variables.css
cp -R . ../output/css/_variables.css
cd ..
rm -rf ads-design-tokens
git rm ads-design-tokens
rm -rf .git/modules/ads-design-tokens

To run: bash script-2.sh

As we can see from the above 2 examples, using scripting we can achieve a variety of results. We can use this same sort of scripting in both builds and pipelines, so it's possible to fully automate these sort of outcomes.

Conclusion

By following this structured process, teams can efficiently collaborate, review, and integrate design changes into their projects. Effective communication and timely updates are crucial for maintaining a seamless workflow between the design and programming teams.


More about the ADS Design Tokens

Design tokens represent the repeated decisions which make up ADS. Tokens replace static values with semantic references. Tokens are generated in Figma using Tokens Studio within ADS/Foundation. In general, tokens are namespaced using the following convention:

$type.category/element.property.variant.state.scale

Core

This tier holds all of the hard-coded values for our most foundational design elements including color swatches, font families, and effects. All other tiers hold references to these tokens.

Examples
Token Value
$core.color.Swatch.Neutral.900 #1a1a1a
$core.font-family.Display FreightDisp Pro

Semantic

This tier holds universal named references to Core tokens for things like primary text colors and heading styles.

Examples
Token Value
$semantic.color.Connotation.Success {color.Swatch.Teal.700}
$semantic.typography.Desktop.Heading.1 {"fontFamily": "{font-family.Display}","fontWeight": "{font-weight.Display.Medium}","lineHeight": "{line-height.Heading.XXL}","fontSize": "{font-size.Heading.XXL}"}

Light

This tier holds semantic references unique to light themes. For every token in this tier, there is a matching Dark token.

Examples
Token Value
$light.color.Light.Background.Surface {color.Swatch.Neutral.0}
$light.color.Light.Text.Secondary {color.Swatch.Neutral.600}

Dark

This tier holds semantic references unique to light themes. For every token, there is a matching Light token.

Examples
Token Value
$dark.color.Dark.Background.Surface {color.Swatch.Neutral.900}
$dark.color.Dark.Text.Secondary {color.Swatch.Neutral.300}

Details


Assets

  • ads-design-tokens-0.0.1.tgz

Download activity

  • Total downloads 2
  • Last 30 days 0
  • Last week 0
  • Today 0

Recent versions

View all