5.12.6 • Published 6 days ago

ucla-library-design-tokens v5.12.6

Weekly downloads
-
License
MIT
Repository
github
Last release
6 days ago

UCLA Library Design Tokens

Design tokens for UCLA Library.

The Design Tokens repository stores and syncs design tokens from the UCLA Library Design System using the Figma Tokens plugin and GitHub Actions to generate Sass variables for use.

What are Design Tokens?

Design tokens are the visual design atoms of the design system — specifically, they are named entities that store visual design attributes. We use them in place of hard-coded values (such as hex values for color or pixel values for spacing) in order to maintain a scalable and consistent visual system for UI development. - Salesforce UX

Helpful Explainers:

Requirements

This package requires Dart Sass because LibSass is deprecated. If you are using the node-sass package in your project (which provides the Node.js binding to the deprecated LibSass), please replace it with the sass package:

npm uninstall node-sass && npm install sass --save-dev

Usage

Install the package:

npm install ucla-library-design-tokens --save-dev

Then in your Sass, load the module (e.g., variables, typography, spacing, or helpers):

@import "~ucla-library-design-tokens/scss/variables.scss";
@import "~ucla-library-design-tokens/scss/typography.scss";
@import "~ucla-library-design-tokens/scss/spacing.scss";
@import "~ucla-library-design-tokens/scss/helpers.scss";

Custom Fonts

To use Karbon and Proxima Nova, import ucla-library-design-tokens/scss/fonts.scss once at the global level. For example, in the component library add to the configs (vue-cli, webpack, and rollup).

Variables

Include the desired variable:

:root {
  --color-primary-yellow-01: #{$primary-yellow-01}; // SCSS interpolation syntax needed
}

.category {
  margin-bottom: $component-06 + px; // Using SCSS variable
  color: var(--color-primary-blue-03); // Using CSS variable
}

Mixins

Include the desired mixin:

.category {
  @include overline;
}

SVGs

Include the desired SVG:

import SvgHatchRight from "ucla-library-design-tokens/assets/svgs/graphic-hatch-lines.svg"

Updating to the latest package

Latest release is posted in this repository, but you can also check if your package is outdated:

npm outdated

If you are not running the latest release and would like to, then update the package:

npm install ucla-library-design-tokens@latest

Or, you can update the version number in the package.json file and run npm install.

Files

  • data/tokens.json - Syncs with Figma Tokens plugin
  • data/transformed-tokens.json - Tokens transformed to be usable by Style Dictionary
  • scss/* - Tokens usable by developers
  • assets/* - Assets usable by developers

Best Practices

Helpful reminders to future selves:

  • Use the commit message conventions that trigger semantic releases
    • feat: A new feature
    • fix: A bug fix
    • docs: Documentation only changes
    • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
    • refactor: A code change that neither fixes a bug nor adds a feature
    • perf: A code change that improves performance
    • test: Adding missing or correcting existing tests
    • chore: Changes to the build process or auxiliary tools and libraries such as documentation generation
  • Always leave a comment when creating, reviewing, and merging a pull request
  • When a new release is published, update dependent apps to use the latest, non-breaking version. If the released package is a major version (has breaking changes), then create appropriate tickets for dependent apps to update the design tokens package.
5.12.6

6 days ago

5.12.5

6 days ago

5.12.4

6 days ago

5.12.3

6 days ago

5.12.2

6 days ago

5.12.1

6 days ago

5.12.0

6 days ago

5.11.0

7 days ago

5.10.0

9 days ago

5.9.1

2 months ago

5.9.0

2 months ago

5.8.0

5 months ago

5.6.1

5 months ago

5.6.0

5 months ago

5.7.4

5 months ago

5.7.3

5 months ago

5.7.2

5 months ago

5.7.1

5 months ago

5.7.0

5 months ago

5.5.1

7 months ago

5.5.0

1 year ago

5.3.0

2 years ago

5.1.0

2 years ago

5.4.1

2 years ago

5.4.0

2 years ago

5.2.0

2 years ago

5.0.0

2 years ago

3.9.1

2 years ago

3.9.0

2 years ago

3.4.0

2 years ago

3.2.2

2 years ago

3.8.0

2 years ago

3.10.0

2 years ago

3.6.0

2 years ago

3.2.3

2 years ago

4.4.1

2 years ago

4.4.0

2 years ago

4.6.1

2 years ago

4.6.0

2 years ago

4.0.0

2 years ago

4.2.0

2 years ago

4.6.2

2 years ago

3.3.0

2 years ago

3.7.0

2 years ago

3.5.1

2 years ago

3.5.0

2 years ago

4.5.0

2 years ago

4.7.0

2 years ago

4.1.0

2 years ago

4.3.0

2 years ago

3.2.1

2 years ago

3.2.0

2 years ago

2.5.0

2 years ago

2.4.1

2 years ago

2.4.0

2 years ago

2.4.3

2 years ago

2.4.2

2 years ago

2.4.4

2 years ago

3.1.0

2 years ago

3.0.0

2 years ago

2.3.0

2 years ago

2.2.1

2 years ago

2.2.0

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago

1.0.0

2 years ago

0.9.0

2 years ago

0.8.0

2 years ago

0.7.1

2 years ago

0.7.0

2 years ago

0.6.0

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.3.0

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.1.0

2 years ago

0.0.1

2 years ago