0.1.4 • Published 2 years ago

@cambridgecore/cup-pattern-library v0.1.4

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

Pattern Library

Pattern library PoC for HE, Core, OLS

Developing


Install dependencies Use --force flag for npm to ignore React dependency error form Storybook addon

npm install --force

// or

yarn install

Run

npm run dev 

Storybook


Storybook is used to document and test components in isolation.

Run Storybook locally and see in browser http://localhost:6006/

npm run storybook

Build static Storybook for online deployment

npm run build-storybook

Preview statice Storybook built

npx http-server ./path/to/build

npm package


PoC Pattern library is a npm package @cambridgecore/cup-pattern-library

Build / Publish

Include component to export in components/index.js Build npm package

npx vite build

Login to npm account

npm login

Publish npm package

npm publish

Usage

Install npm package

npm i @cambridgecore/cup-pattern-library

Tokens


Tokens are names for style values used in Figma and transformed into CSS variables (or other format e.g. JS, SCSS). Transformation process is done with Style Dictionary

Transformation

  1. Export tokens from Figma Tokens plugin to figma-tokens.json in location src/assets/tokens/figma-tokens.json and push to GitLab repository

  2. Transform figma-tokens.json from Figma format to Style Dictionary format with command

 npx token-transformer src/assets/tokens/figma-tokens.json src/assets/tokens/sd-tokens.json
  1. Transform sd-tokens.json to CSS variables with command
node transform-tokens.js

Configuration

Configuration and additional transformation options are in file transform-tokens.js More details on configuration are in Style Dictionary documentation

Full configuration file for Style Dictionary transformation by Jan Six https://gist.github.com/six7/9cbce8bcbb16b308c5c87f3729392d21

0.1.2

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.31

2 years ago

0.0.30

2 years ago

0.0.29

2 years ago

0.0.28

2 years ago

0.0.27

2 years ago

0.0.26

2 years ago

0.0.25

2 years ago

0.0.24

2 years ago

0.0.23

2 years ago

0.0.22

2 years ago

0.0.21

2 years ago

0.0.19

2 years ago

0.0.18

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago