{"name":"gatsby-design-tokens","version":"5.16.0-next.0","author":{"name":"Florian Kissling","email":"flo@gatsbyjs.com"},"license":"MIT","_id":"gatsby-design-tokens@5.16.0-next.0","maintainers":[{"name":"pieh","email":"misiek.piechowiak@gmail.com"},{"name":"kathmbeck","email":"katherine.beck@netlify.com"},{"name":"serhalp-netlify","email":"philippe.serhal@netlify.com"},{"name":"mlgualtieri-gatsby","email":"mike.gualtieri@netlify.com"},{"name":"dschau","email":"dustinschau@gmail.com"}],"homepage":"https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-design-tokens#readme","bugs":{"url":"https://github.com/gatsbyjs/gatsby/issues"},"dist":{"shasum":"0bb68c7269a42393a62469aabc3c41f35dab856c","tarball":"http://registry-npm.ywwl.com/gatsby-design-tokens/download/gatsby-design-tokens-5.16.0-next.0.tgz","fileCount":10,"integrity":"sha512-UFTTDesm6XOHMQ8Ycyp8ATmCkN1tc0z3n3ZIw/WdZJjbuCFEtNAloHw+LHh5bb6Fl+B9DtDdSH71OtybmOgzzg==","signatures":[{"sig":"MEUCIQDPwt726CZ6AUxbnZode9dcke+zLDa3W5Xv2Jszq9yL2gIgF9fOkm1kIlvhPtLdmoDWr8icZQp+Cr4wA6S520WI9b8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":92585,"size":16926,"noattachment":false,"key":"/gatsby-design-tokens/-/gatsby-design-tokens-5.16.0-next.0.tgz"},"main":"dist/index.js","module":"dist/index.esm.js","source":"src/index.js","engines":{"node":">=18.0.0"},"gitHead":"32f2d1e7f81c8bbd97d4623fc06fea8d5f367ae5","scripts":{"build":"npm run build:tokens && npm run build:theme && npm run build:theme-gatsbyjs-org","watch":"microbundle watch src/index.js src/theme.js src/theme-gatsbyjs-org.js --sourcemap=false -f es,cjs","prepare":"cross-env NODE_ENV=production npm run build","build:theme":"(microbundle build src/theme.js -o dist/theme.js --sourcemap=false -f es,cjs) || node -e \"console.log('\\nMicrobundle failed, make sure you\\'re using node version 10.16 or higher\\n');process.exit(1)\"","build:tokens":"(microbundle build --sourcemap=false -f es,cjs) || node -e \"console.log('\\nMicrobundle failed, make sure you\\'re using node version 10.16 or higher\\n');process.exit(1)\"","build:theme-gatsbyjs-org":"(microbundle build src/theme-gatsbyjs-org.js -o dist/theme-gatsbyjs-org.js --sourcemap=false -f es,cjs) || node -e \"console.log('\\nMicrobundle failed, make sure you\\'re using node version 10.16 or higher\\n');process.exit(1)\""},"_npmUser":{"name":"serhalp-netlify","email":"philippe.serhal@netlify.com"},"repository":{"url":"git+https://github.com/gatsbyjs/gatsby.git","type":"git","directory":"packages/gatsby-design-tokens"},"_npmVersion":"lerna/3.22.1/node@v18.20.7+arm64 (darwin)","description":"Gatsby Design Tokens","directories":{},"sideEffects":"false","_nodeVersion":"18.20.7","dependencies":{"hex2rgba":"^0.0.1","@babel/runtime":"^7.20.13"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"cross-env":"^7.0.3","microbundle":"^0.15.0","preval.macro":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/gatsby-design-tokens_5.16.0-next.0_1756301682974_0.7340804949032218","host":"s3://npm-registry-packages-npm-production"},"readme":"# gatsby-design-tokens\n\n<a href=\"https://www.npmjs.org/package/gatsby-design-tokens\">\n  <img src=\"https://img.shields.io/npm/v/gatsby-design-tokens.svg\" alt=\"Current npm package version.\" />\n</a>\n<a href=\"https://npmcharts.com/compare/gatsby-design-tokens?minimal=true\">\n  <img src=\"https://img.shields.io/npm/dm/gatsby-design-tokens.svg\" alt=\"Downloads per month on npm.\" />\n</a>\n<a href=\"https://npmcharts.com/compare/gatsby-design-tokens?minimal=true\">\n  <img src=\"https://img.shields.io/npm/dt/gatsby-design-tokens.svg\" alt=\"Total downloads on npm.\" />\n</a>\n\n## Introduction\n\n> Design tokens are the visual design atoms of the design system — specifically, they are named entities that store visual design attributes. We use them in place of hard-coded values (such as hex values for color or pixel values for spacing) in order to maintain a scalable and consistent visual system for UI development.\n\nThis quote from the [Lightning Design System Design Tokens documentation](https://www.lightningdesignsystem.com/design-tokens/) accurately describes the tokens contained in this package — to be a bit more specific: `gatsby-design-tokens` offers _plain objects or arrays of values for related **CSS properties**_. Currently.\n\nGatsby's design tokens are following the [System UI Theme Specification](https://system-ui.com/theme/) as well as the [Theme UI Theme Specification](https://theme-ui.com/theme-spec).\n\n### Project state and versioning\n\n`gatsby-design-tokens` is a work-in-progress, but versions _do_ follow the [Semantic Versioning](https://semver.org/) specification:\n\n- Minor fixes to tokens will be released as patch versions.\n- Major design changes will be released as minor versions\n- _Breaking_ public API changes will be released in major versions only.\n\nTo prevent your site from breaking due to a breaking change or looking dramatically different due to a minor version bump, we recommend the [~](https://docs.npmjs.com/misc/semver#tilde-ranges-123-12-1) comparator when using this package.\n\n## Installation\n\nUsing [npm](https://www.npmjs.com/):\n\n```shell\nnpm install gatsby-design-tokens --save\n```\n\nUsing [Yarn](https://yarnpkg.com/):\n\n```shell\nyarn add gatsby-design-tokens\n```\n\n## Tokens 🍒🍋🍏\n\nAll exports provide either plain objects or arrays of values for related CSS properties:\n\n```js\nimport {\n  borders,\n  // [ 0, `1px solid`, `2px solid` ]\n  breakpoints,\n  // { xs:`400px`, sm:`550px`, …}\n  breakpointsArray,\n  // [ \"400px\", \"550px\", …]\n  colors,\n  // { primary:`#639`, blackFade: { 5: `rgba(…)`, 10: …}, …}\n  fonts,\n  // { body: `-apple-system, …, sans-serif`, monospace: {…} }\n  fontsLists,\n  // { body: [`-apple-system`, …, `sans-serif`], monospace: […] }\n  fontSizes,\n  // [ `0.75rem`, …, `5.75rem` ]\n  fontSizesPx,\n  // [ `12px`, …, `92px` ]\n  fontSizesRaw,\n  // [ 12, 14, 16, 18, 20, 24, 28, 32, …, 84, 92 ]\n  fontWeights,\n  // { body: 400, semiBold: 600, …, heading: 700 }\n  letterSpacings,\n  // { normal: \"normal\", tracked: \"0.075em\", tight: \"-0.015em\" }\n  lineHeights,\n  // { solid: 1, dense: 1.25, … }\n  mediaQueries,\n  // { xs: \"@media (min-width: 400px)\", …, xxl: \"@media (min-width: 1600px)\" }\n  radii,\n  // [ 0, \"2px\", \"4px\", \"8px\", \"16px\", \"9999px\", \"100%\" ]\n  shadows,\n  // { raised: `0px 1px 2px rgba(46,…)`, floating: `0px 2px 4px…` }\n  space,\n  // [ \"0rem\", \"0.25rem\", \"0.5rem\", …, \"4.5rem\"]\n  spacePx,\n  // [ \"0px\", \"4px\", \"8px\", …, \"72px\"]\n  spaceRaw,\n  // [ 0, 4, 8, 12, 16, 20, 24, 32, 40, 48, 56, 64, 72]\n  transition,\n  // transition = {\n  //   default: `250ms cubic-bezier(0.4, 0, 0.2, 1)`,\n  //   curve: { default: `cubic-bezier(0.4, 0, 0.2, 1)`, … },\n  //   speed: { faster: `50ms`, … },\n  // }\n} from \"gatsby-design-tokens\"\n```\n\n- `rem` values are based on a `font-size` of `16px` for the root element.\n- All tokens work in the context of [Theme UI's Theme Scales](https://theme-ui.com/theme-spec/#theme-scales), with the exception of `breakpoints`: Use `breakpointsArray` for `theme-ui` and its [responsive styles](https://theme-ui.com/getting-started/#responsive-styles) feature.\n\n## `theme-ui` themes 🎨\n\n### `theme`\n\nA basic `theme-ui` theme composed of unmodified tokens, with one exception: `colors` are modified to provide the basic set of variables described in https://theme-ui.com/theme-spec#color.\n\nTBD: Adopt the `theme-ui` definitions for the basic `colors` tokens.\n\n```js\nimport { theme } from \"gatsby-design-tokens/dist/theme\"\n\n// when used with `gatsby-plugin-theme-ui`, export the theme\n// as default from `src/gatsby-plugin-theme-ui/index.js`\nexport { theme as default } from \"gatsby-design-tokens/dist/theme\"\n\n// in case you need theme tokens outside of the `emotion` context\nimport {\n  breakpoints,\n  colors,\n  fonts,\n  fontSizes,\n  fontWeights,\n  letterSpacings,\n  lineHeights,\n  mediaQueries,\n  radii,\n  shadows\n  space,\n  transition,\n} from \"gatsby-design-tokens/dist/theme\n```\n\n### `theme-gatsbyjs-org`\n\nThe theme currently in use on gatsbyjs.com via `gatsby-plugin-theme-ui`:\n\n- Extends the base theme's `colors` with a couple .org-specific things, and provides a `dark` mode (ref. https://theme-ui.com/color-modes).\n- Adds .org-specific `sizes` and `zIndices`.\n- Adds a couple of `variants`.\n- Uses `hex2rgba` to create rgba colors.\n\n```js\nimport { theme } from \"gatsby-design-tokens/dist/theme-gatsbyjs-org\"\n\n// when used with `gatsby-plugin-theme-ui`, export the theme\n// as default from `src/gatsby-plugin-theme-ui/index.js`\nexport { theme as default } from \"gatsby-design-tokens/dist/theme-gatsbyjs-org\"\n\n// in case you need theme tokens outside of the `emotion` context\nimport {\n  breakpoints,\n  colors,\n  fonts,\n  fontSizes,\n  fontWeights,\n  letterSpacings,\n  lineHeights,\n  mediaQueries,\n  radii,\n  shadows,\n  sizes,\n  space,\n  transition,\n  zIndices,\n} from \"gatsby-design-tokens/dist/theme-gatsbyjs-org\"\n```\n\n## Local development\n\nThe Gatsby monorepo, which hosts this package, also contains the source for gatsbyjs.com, aka `www` — where `theme-gatsbyjs-org` is in use. Using a little helper called `gatsby-dev` we can develop and test both of them locally.\n\n### 1. Clone the `gatsby` monorepo and set it up for local dev\n\nFollow the [official guide](https://www.gatsbyjs.com/contributing/setting-up-your-local-dev-environment/#fork-clone-and-branch-the-repository) to clone/fork and set up the Gatsby monorepo. This will roughly look like this:\n\n```shell\n# clone the repo/your fork\ngit clone https://github.com/gatsbyjs/gatsby.git\ncd gatsby\n\n# set up the repo, install dependencies for `packages`, and build the latter\nyarn run bootstrap\n\n# make sure tests are passing\nyarn test\n\n# create a new feature branch\ngit checkout -b topics/new-feature-name\n```\n\n#### Install `gatsby-dev-cli` to ease testing your local changes to `packages`\n\nAssuming `gatsby-cli` [is installed](https://www.gatsbyjs.com/contributing/setting-up-your-local-dev-environment/#gatsby-functional-changes), let's install [`gatsby-dev-cli`](<(https://www.npmjs.com/package/gatsby-dev-cli)>) with\n\n```shell\nyarn global add gatsby-dev-cli\n```\n\n`gatsby-dev-cli` needs to know where your local Gatsby repository lives; navigate to its root folder, get the absolute path to it via `pwd`, and tell `gatsby-dev-cli` about it with\n\n```shell\ngatsby-dev --set-path-to-repo /path-to-local-gatsby/gatsby\n```\n\n### 2. Get `www` running on `localhost`\n\n```shell\ncd /path-to-local-gatsby/gatsby/www\n\nyarn # to install dependencies\n```\n\nFollow the [README instructions](https://github.com/gatsbyjs/gatsby/blob/master/www/README.md) to [add a .env.development file](https://github.com/gatsbyjs/gatsby/blob/master/www/README.md#environment-variables) in `www`, and add `GATSBY_SCREENSHOT_PLACEHOLDER=true` to\n\n> […] skip downloading screenshots and generating responsive images for all screenshots and replace them with a placeholder image\n\nRun `yarn develop`, which thanks to the previous step shouldn't take ~40 minutes but way less. Hopefully you should be able to browse a local version of gatsbyjs.com after this. Let's leave `yarn develop` running!\n\n### 3. Rebuild `gatsby-design-tokens` when it changes, and use `gatsby-dev` to copy the changed-and-compiled package over to `www/node_modules`\n\n- Open a new terminal window, go to the root of your local `gatsby` repo, and run `yarn run watch` to watch for changes in `packages`, and recompile the modified package.\n  - To watch only certain packages, use `yarn run watch --scope=gatsby-design-tokens` or `--scope={gatsby,gatsby-cli}`.\n- Last, in another new terminal window, go to `gatsby/www`, and run `gatsby-dev --packages=gatsby-design-tokens` to copy the latest local version of the `gatsby-design-tokens` package over to `www/node_modules`.\n  - Alternatively pass an array to watch multiple packages, or use plain `gatsby-dev` to copy the latest versions of all local packages that are used in your project's `package.json`.\n\n### 4. Finally!\n\nLet's try if everything is running and watching and recompiling!\nLet's open `packages/gatsby-design-tokens/src/fonts.js`, and replace\n\n```js\nconst header = [Futura PT, ...system]\n```\n\nwith\n\n```js\nconst header = system\n```\n\nand you should see `Futura PT` turning into `system-ui` within a few moments on your `http://localhost:8000`.\n","publish_time":1756301683297,"_cnpm_publish_time":1756301683297,"dist-tags":{"alpha-9689ff":"4.23.0-alpha-9689ff.25","alpha-qe-sm":"3.14.0-alpha-qe-sm.46","alpha-transformer-json":"4.14.0-alpha-transformer-json.41","alpha-v5":"5.0.0-alpha-v5.d20221012t101120.57","drupal-proxyurl":"5.0.0-alpha-drupal-proxyurl.14","drupal-self-reference":"4.18.0-alpha-drupal-self-reference.30","image-helpers":"2.2.0-image-helpers.58","latest":"5.16.0","latest-v3":"3.15.0","latest-v4":"4.25.0","next":"5.17.0-next.0","otp-test":"1.0.3-otp-test.69","preview-gh-api":"4.23.0-alpha-preview-gh-api.26","reach-router":"3.0.0-reach-router.13","unifiedroutes":"2.0.5-unifiedroutes.433","v3rc":"3.0.0-v3rc.0","wp-image-cdn-auth":"4.15.0-alpha-wp-image-cdn-auth.48"}}