@cambridgecore/cup-pattern-library v0.1.4
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 installRun
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 storybookBuild static Storybook for online deployment
npm run build-storybookPreview statice Storybook built
npx http-server ./path/to/buildnpm 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 buildLogin to npm account
npm loginPublish npm package
npm publishUsage
Install npm package
npm i @cambridgecore/cup-pattern-libraryTokens
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
Export tokens from Figma Tokens plugin to
figma-tokens.jsonin locationsrc/assets/tokens/figma-tokens.jsonand push to GitLab repositoryTransform
figma-tokens.jsonfrom Figma format to Style Dictionary format with command
npx token-transformer src/assets/tokens/figma-tokens.json src/assets/tokens/sd-tokens.json- Transform
sd-tokens.jsonto CSS variables with command
node transform-tokens.jsConfiguration
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
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago