npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@axa-ch/design-tokens

v2.1.2

Published

AXA Design Tokens

Downloads

1,374

Readme

AXA CH Design Tokens

Build Status MIT License NPM version NPM downloads

The AXA CH Design Tokens project exports design tokens for use in multiple technologies. The following technologies are supported:

  • CSS Variables + Media Queries with @custom-media
  • SCSS Variables
  • JS/TS Variables
  • Tailwind Config

If you need our design tokens for a web project you might check this Online demo

Supported Tokens

The project supports the following design tokens:

  • Animation: Variables needed to handle component animations.
  • Breakpoints/Media Queries: AXA viewport breakpoints and additional media query utilities.
  • Color: AXA colors.
  • Radius: Box radius variables.
  • Shadow: Box shadow variables.
  • Spacing: AXA Design System spacing variables.
  • Typography: AXA Design System font styles.

Installation

To install the AXA CH Design Tokens, run the following command:

npm i @axa-ch/design-tokens

Usage

To use the AXA CH Design Tokens in your project, import them based on your technology. Here are some implementation examples that may inspire you:

CSS Usage

You can import the CSS variables into your files as follows:

@import url('@axa-ch/design-tokens/tokens.css');

.component {
  width: var(--spacing-base-3);
}

Note that for CSS media queries via @custom-media you will need a postCSS plugin

@import url('@axa-ch/design-tokens/tokens.css');

.component {
  width: var(--spacing-base-3);

  @media (--mq-respond-up-sm) {
    width: var(--spacing-base-6);
  }
}

Plain CSS

If you want to simply import the pre-bundled css variables without relying on a build process, you can import the minified tokens.min.css file as follows:

<link
  rel="stylesheet"
  href="@axa-ch/design-tokens/tokens.min.css"
/>

Note that the css above doesn't contain @custom-media variables because this directive is not yet supported by any modern browser.

SCSS Usage

You can import the SCSS variables into your files as follows:

@use '@axa-ch/design-tokens/tokens.scss';

.component {
  width: tokens.$spacing-base-3;

  @media (tokens.$mq-respond-up-sm) {
    width: tokens.$spacing-base-6;
  }
}

In case you want to import and scope the css variables into your SCSS application, without relying on the :root global selector, you might want to use our mixins as follows:

@use '@axa-ch/design-tokens/tokens.scss';

.component {
  // scope the css variables under the .component class
  @include tokens.get-animation-css-vars;
  @include tokens.get-breakpoints-css-vars;
  @include tokens.get-color-css-vars;
  @include tokens.get-radius-css-vars;
  @include tokens.get-shadow-css-vars;
  @include tokens.get-spacing-css-vars;
  @include tokens.get-typography-css-vars;
}

JS/TS Usage

You can import the JS variables into your files as follows:

import * as tokens from '@axa-ch/design-tokens';

console.log(tokens.ColorBaseAxaBlue);

Tailwind Usage

You can extend your tailwind.config.js file as follows:

module.exports = {
  presets: [require('@axa-ch/design-tokens/tailwind.config')],
  // ...
};

Figma usage

You can import the tokens.json into figma via Tokens Studio Plugin. This will allow to sync your figma library with the tokens exposed in this project.