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

@volvo-cars/ui-design-tokens

v2.17.0

Published

_Questions? Ask in [Slack #design-system-web](https://vcc-consumer-digital.slack.com/archives/C041K092P4P)_

Downloads

8,963

Readme

Volvo Cars UI Design Tokens

Questions? Ask in Slack #design-system-web

Design tokens capture the low-level design properties like colors, grid, spacing and typography. These tokens provide a single source of truth and feed into the different UI components.

Tokens in this repository should be in sync with the design libraries in Figma.

Usage

If you are using VCC UI, design tokens will be made available through built-in features in an upcoming release.

If you want to use the tokens directly outside of VCC UI:

Install the design tokens package by running

yarn add @volvo-cars/ui-design-tokens

The following CSS files are available from the package:

  • ./css/tokens.css - CSS custom properties / variables with design tokens
  • ./css/volvo-broad.css - @font-face rules for Volvo Broad
  • ./css/volvo-novum.css - @font-face rules for Volvo Novum

Include the CSS files in your page, and add the versioned root class name, e.g. <html class="volvo_0_1"> (available as classNames.root).

To switch a section of the page to the dark color scheme, use the scheme-dark (classNames.schemeDark) class name and the scheme-light (classNames.schemeLight) class name to switch back.

Class names and tokens are available as JavaScript exports with TypeScript types for usage with CSS-in-JS or inline styles. The tokens refer to the CSS variables in the static CSS files, and will update dynamically based on the wrapping color scheme class name.

import { classNames, tokens } from '@volvo-cars/ui-design-tokens';

<div
  className={classNames.schemeLight}
  style={{
    background: tokens.colorBackgroundPrimary,
    color: tokens.colorPrimary,
    paddingBlock: tokens.size,
  }}
/>;

Next.js

Import the CSS in your project with the following imports

import '@volvo-cars/ui-design-tokens/css/tokens.css';
import '@volvo-cars/ui-design-tokens/css/volvo-broad.css';
import '@volvo-cars/ui-design-tokens/css/volvo-novum.css';

Add the appropriate class names

import { classNames } from '@volvo-cars/ui-design-tokens';

export default class MyDocument extends Document {
  render() {
    return <Html className={classNames.root}></Html>;
  }
}

Legacy Output

Legacy tokens are still available in 2.x in the following output structure

- build/
  - web
    - volvo
      - tokens.css
      - tokens.json
      - tokens.scss
    - volvo-dark
  - android
    - volvo
    - volvo-dark
  - ios
    - volvo
    - volvo-dark

Development

To build the design tokens locally run yarn build