Giter Site home page Giter Site logo

design-tokens's Introduction

Patternfly Design Tokens

Export tokens from Figma

Information about exporting tokens from the Figma Design Tokens & Styles library is with the custom exporter.

Usage

Once the design token JSON files are exported from Figma to the tokens directories, use yarn build:scss to build the SCSS files to the /build directory

By default yarn build:scss outputs the SCSS with :root as a selector, but you can also pass the --selector flag (or just -s for short) and specify any selector you want, i.e. yarn build:scss -s .foo will replace the :root selector with .foo in the generated SCSS files.

To generate token variables for PatternFly core, use

yarn build:scss -s "@mixin pf-v6-tokens"

yarn build:docs and yarn serve:docs will build and run the docs locally.

Note

We are temporarily pushing the built SCSS files to the repo for ease of access. Additional PRs should rebuild and repush updated SCSS files if they would be affected by the PR changes, to keep them up to date.

Docs build

Whenever yarn build:docs is executed:

  • the build-js-for-docs.js script is run to turn the scss files into a javascript object.
  • The javascript object is stored in the scssAsJson.json file.
  • The code for generating the table containing all tokens is the tokensTable.js, which consumes the javascript object from scssAsJson.json as data.
  • Ultimately, the markdown file which is rendering the docs is all-patternfly-tokens.md. This markdown file imports the tokensTable.js.

design-tokens's People

Contributors

srambach avatar nicolethoen avatar wise-king-sullyman avatar mcoker avatar kmcfaul avatar evwilkin avatar jessiehuff avatar mfrances17 avatar thatblindgeye avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.