{"_id":"@atb-as/token","_rev":"7-435f9e9aeae8e4a5a86aae2dc8bce228","name":"@atb-as/token","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.1":{"name":"@atb-as/token","version":"0.0.1","keywords":["postcss","css","postcss-plugin","design-tokens","postcss-typesafe-design-tokens","design-system","atb"],"license":"EUPL-1.2","_id":"@atb-as/token@0.0.1","maintainers":[{"name":"abelvanbeek","email":"abel.van.beek@tromsfylke.no"},{"name":"jonasbl_mittatb","email":"jonas.brunvoll.larsson@mittatb.no"},{"name":"hanne-at-atb","email":"hanne.overrein@mittatb.no"},{"name":"reidzeibel","email":"reidzeibel@gmail.com"},{"name":"marius-at-atb","email":"marius@mittatb.no"},{"name":"adriansberg","email":"adrian_berg96@hotmail.com"},{"name":"jorelosorio","email":"jorelosorio@gmail.com"},{"name":"mortennordseth","email":"morten@nordseth.net"},{"name":"nshrautela","email":"nshrautela@gmail.com"},{"name":"rosvik","email":"j.rosvik@gmail.com"},{"name":"mikaelb","email":"mikaelbre@gmail.com"},{"name":"atb-martin","email":"martin@mittatb.no"},{"name":"gorandalum","email":"goran.dalum@gmail.com"}],"dist":{"shasum":"79d85508ff6d1a9cf04070d932fb8669a5ca8ece","tarball":"https://registry.npmjs.org/@atb-as/token/-/token-0.0.1.tgz","fileCount":4,"integrity":"sha512-Thw6Xw86Lcxj2LCwAq7m3jQRLShJLybIwLqVsff6K9ytWAwdb9fAJ6ryCeoqr3u+FlnjXFLjFOR7RXgK8a60RQ==","signatures":[{"sig":"MEQCIFIuZk4sti/fnZEZCC4j5WsNCY/T4QAZqLxKK2CXyZNmAiASUTiKjAYv1dLutry9k5oOzhU9GnyGxWQodITtTSX66Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8344},"type":"commonjs","engines":{"node":">=18.0.0"},"gitHead":"c7ed85616cb8c649da753fc6e3eb5b8dec08f306","scripts":{"test":"npm run unit && eslint .","unit":"node --test index.test.js"},"_npmUser":{"name":"abelvanbeek","email":"abel.van.beek@tromsfylke.no"},"_npmVersion":"lerna/8.1.6/node@v20.12.2+arm64 (darwin)","description":"PostCSS plugin that adds a token() function to CSS. It accepts a variable in dot separated syntax. This call will fail if the CSS variable does not exist.","directories":{},"_nodeVersion":"20.12.2","dependencies":{"postcss-functions":"4.0.2"},"eslintConfig":{"env":{"es6":true,"node":true},"extends":["eslint:recommended"],"parserOptions":{"ecmaVersion":2017}},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.47.0","postcss":"^8.4.27","@atb-as/theme":"11.0.1"},"peerDependencies":{"postcss":"^8.4.27","@atb-as/theme":"11.0.1"},"_npmOperationalInternal":{"tmp":"tmp/token_0.0.1_1731573709605_0.7799683023872912","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"@atb-as/token","version":"0.0.2","keywords":["postcss","css","postcss-plugin","design-tokens","postcss-typesafe-design-tokens","design-system","atb"],"license":"EUPL-1.2","_id":"@atb-as/token@0.0.2","maintainers":[{"name":"abelvanbeek","email":"abel.van.beek@tromsfylke.no"},{"name":"jonasbl_mittatb","email":"jonas.brunvoll.larsson@mittatb.no"},{"name":"hanne-at-atb","email":"hanne.overrein@mittatb.no"},{"name":"reidzeibel","email":"reidzeibel@gmail.com"},{"name":"marius-at-atb","email":"marius@mittatb.no"},{"name":"adriansberg","email":"adrian_berg96@hotmail.com"},{"name":"jorelosorio","email":"jorelosorio@gmail.com"},{"name":"mortennordseth","email":"morten@nordseth.net"},{"name":"nshrautela","email":"nshrautela@gmail.com"},{"name":"rosvik","email":"j.rosvik@gmail.com"},{"name":"mikaelb","email":"mikaelbre@gmail.com"},{"name":"atb-martin","email":"martin@mittatb.no"},{"name":"gorandalum","email":"goran.dalum@gmail.com"}],"dist":{"shasum":"00e33e8924877ee0c04c231f65ce60a447eea14e","tarball":"https://registry.npmjs.org/@atb-as/token/-/token-0.0.2.tgz","fileCount":4,"integrity":"sha512-eCgyU7Wrww4QbwHHXTQzeC1zNe9YQQs+hJxHPZCUisz2TAlsQBXn8MA5KJmLr8FyOMghJn2dnkdnTjMu9L9s0w==","signatures":[{"sig":"MEUCIFXMSsrwuO9Q5TqqyPe9jO5fwRGSxB0nqmXYminvRRZqAiEAuTypcmw8tQvDnohYzppgMU3PXjYV+DanQymkrmwl5WY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8344},"type":"commonjs","engines":{"node":">=18.0.0"},"gitHead":"677aed2c9185a9edb34cd112deb2f8ddd79075e1","scripts":{"test":"npm run unit && eslint .","unit":"node --test index.test.js"},"_npmUser":{"name":"abelvanbeek","email":"abel.van.beek@tromsfylke.no"},"_npmVersion":"lerna/4.0.0/node@v20.12.2+arm64 (darwin)","description":"PostCSS plugin that adds a token() function to CSS. It accepts a variable in dot separated syntax. This call will fail if the CSS variable does not exist.","directories":{},"_nodeVersion":"20.12.2","dependencies":{"postcss-functions":"4.0.2"},"eslintConfig":{"env":{"es6":true,"node":true},"extends":["eslint:recommended"],"parserOptions":{"ecmaVersion":2017}},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.47.0","postcss":"^8.4.27","@atb-as/theme":"11.0.1"},"peerDependencies":{"postcss":"^8.4.27","@atb-as/theme":"11.0.1"},"_npmOperationalInternal":{"tmp":"tmp/token_0.0.2_1732023670106_0.5678420443334231","host":"s3://npm-registry-packages"}},"0.0.3":{"name":"@atb-as/token","version":"0.0.3","keywords":["postcss","css","postcss-plugin","design-tokens","postcss-typesafe-design-tokens","design-system","atb"],"license":"EUPL-1.2","_id":"@atb-as/token@0.0.3","maintainers":[{"name":"abelvanbeek","email":"abel.van.beek@tromsfylke.no"},{"name":"jonasbl_mittatb","email":"jonas.brunvoll.larsson@mittatb.no"},{"name":"hanne-at-atb","email":"hanne.overrein@mittatb.no"},{"name":"reidzeibel","email":"reidzeibel@gmail.com"},{"name":"marius-at-atb","email":"marius@mittatb.no"},{"name":"adriansberg","email":"adrian_berg96@hotmail.com"},{"name":"jorelosorio","email":"jorelosorio@gmail.com"},{"name":"mortennordseth","email":"morten@nordseth.net"},{"name":"nshrautela","email":"nshrautela@gmail.com"},{"name":"rosvik","email":"j.rosvik@gmail.com"},{"name":"mikaelb","email":"mikaelbre@gmail.com"},{"name":"atb-martin","email":"martin@mittatb.no"},{"name":"gorandalum","email":"goran.dalum@gmail.com"}],"dist":{"shasum":"3a31b81c7b9fcd67f8931721722cb8d81f0f70b2","tarball":"https://registry.npmjs.org/@atb-as/token/-/token-0.0.3.tgz","fileCount":4,"integrity":"sha512-ZeMfhAq46kWVL0aFzVfhoQN1i3xKRUEvPhAQ4NcQaSdPYGqlJaQ6cjHEmFTdpZWR06usfY8Cd6Jo8gYXgDAprA==","signatures":[{"sig":"MEYCIQDcLriT2GQEjNlE1JOTC09laa+lnAxLSjRaUKHgL1a4/QIhAIbi1OFft+gKAUF73/sEHh9k8I52bYovcCJkL75hWhti","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8313},"type":"commonjs","engines":{"node":">=18.0.0"},"gitHead":"8c69354bab6dea924eb74ab8592ecb04fd519b75","scripts":{"test":"npm run unit && eslint .","unit":"node --test index.test.js"},"_npmUser":{"name":"abelvanbeek","email":"abel.van.beek@tromsfylke.no"},"_npmVersion":"lerna/4.0.0/node@v20.12.2+arm64 (darwin)","description":"PostCSS plugin that adds a token() function to CSS. It accepts a variable in dot separated syntax. This call will fail if the CSS variable does not exist.","directories":{},"_nodeVersion":"20.12.2","dependencies":{"postcss-functions":"4.0.2"},"eslintConfig":{"env":{"es6":true,"node":true},"extends":["eslint:recommended"],"parserOptions":{"ecmaVersion":2017}},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.47.0","postcss":"^8.4.27","@atb-as/theme":"11.0.1"},"peerDependencies":{"postcss":"^8.4.27","@atb-as/theme":"11.0.1"},"_npmOperationalInternal":{"tmp":"tmp/token_0.0.3_1732279506888_0.9289213791302564","host":"s3://npm-registry-packages"}},"0.0.4":{"name":"@atb-as/token","version":"0.0.4","description":"PostCSS plugin that adds a token() function to CSS. It accepts a variable in dot separated syntax. This call will fail if the CSS variable does not exist.","type":"commonjs","keywords":["postcss","css","postcss-plugin","design-tokens","postcss-typesafe-design-tokens","design-system","atb"],"license":"EUPL-1.2","scripts":{"unit":"node --test index.test.js","test":"npm run unit && eslint ."},"engines":{"node":">=18.0.0"},"peerDependencies":{"@atb-as/theme":"11.0.1","postcss":"^8.4.27"},"dependencies":{"postcss-functions":"4.0.2"},"devDependencies":{"@atb-as/theme":"11.0.1","eslint":"^8.47.0","postcss":"^8.4.27"},"eslintConfig":{"parserOptions":{"ecmaVersion":2017},"env":{"node":true,"es6":true},"extends":["eslint:recommended"]},"_id":"@atb-as/token@0.0.4","dist":{"shasum":"7f49ea26b8b2265957f789fce0244a12f2eb1e53","integrity":"sha512-KVtpyFQGh0gjy0HzceLV/U+BXexU/xUcG/i+ebm8BO2RFUmIumaU7EUOT4MEExFPBaNgA7jFyY5Y44Eyfq8AqQ==","tarball":"https://registry.npmjs.org/@atb-as/token/-/token-0.0.4.tgz","fileCount":6,"unpackedSize":8569,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCTt4ULzzJXucp95JQeiQEG27NQDtGcqcfrRbsB59hGpgIgGthR0LIISgk9XCazFIOSXckV0QCPwnl0IpMtllvdg2I="}]},"_npmUser":{"name":"rosvik","email":"j.rosvik@gmail.com"},"directories":{},"maintainers":[{"name":"marius-at-atb","email":"marius@mittatb.no"},{"name":"mikaelb","email":"mikaelbre@gmail.com"},{"name":"atb-martin","email":"martin@mittatb.no"},{"name":"gorandalum","email":"goran.dalum@gmail.com"},{"name":"rosvik","email":"j.rosvik@gmail.com"},{"name":"abelvanbeek","email":"abel.van.beek@tromsfylke.no"},{"name":"nshrautela","email":"nshrautela@gmail.com"},{"name":"mortennordseth","email":"morten@nordseth.net"},{"name":"reidzeibel","email":"reidzeibel@gmail.com"},{"name":"hanne-at-atb","email":"hanne.overrein@mittatb.no"},{"name":"jorelosorio","email":"jorelosorio@gmail.com"},{"name":"jonasbl_mittatb","email":"jonas.brunvoll.larsson@mittatb.no"},{"name":"adriansberg","email":"adrian_berg96@hotmail.com"},{"name":"strandlie","email":"hakon@strandlie.co"},{"name":"jorunn-at-atb","email":"jorunn.leithe@atb.no"},{"name":"magnudah","email":"magnudah@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/token_0.0.4_1762258131200_0.43634906938737594"},"_hasShrinkwrap":false}},"time":{"created":"2024-11-14T08:41:49.497Z","modified":"2025-11-04T12:08:51.783Z","0.0.1":"2024-11-14T08:41:49.766Z","0.0.2":"2024-11-19T13:41:10.254Z","0.0.3":"2024-11-22T12:45:07.017Z","0.0.4":"2025-11-04T12:08:51.362Z"},"license":"EUPL-1.2","keywords":["postcss","css","postcss-plugin","design-tokens","postcss-typesafe-design-tokens","design-system","atb"],"description":"PostCSS plugin that adds a token() function to CSS. It accepts a variable in dot separated syntax. This call will fail if the CSS variable does not exist.","maintainers":[{"name":"marius-at-atb","email":"marius@mittatb.no"},{"name":"mikaelb","email":"mikaelbre@gmail.com"},{"name":"atb-martin","email":"martin@mittatb.no"},{"name":"gorandalum","email":"goran.dalum@gmail.com"},{"name":"rosvik","email":"j.rosvik@gmail.com"},{"name":"abelvanbeek","email":"abel.van.beek@tromsfylke.no"},{"name":"nshrautela","email":"nshrautela@gmail.com"},{"name":"mortennordseth","email":"morten@nordseth.net"},{"name":"reidzeibel","email":"reidzeibel@gmail.com"},{"name":"hanne-at-atb","email":"hanne.overrein@mittatb.no"},{"name":"jorelosorio","email":"jorelosorio@gmail.com"},{"name":"jonasbl_mittatb","email":"jonas.brunvoll.larsson@mittatb.no"},{"name":"adriansberg","email":"adrian_berg96@hotmail.com"},{"name":"strandlie","email":"hakon@strandlie.co"},{"name":"jorunn-at-atb","email":"jorunn.leithe@atb.no"},{"name":"magnudah","email":"magnudah@gmail.com"}],"readme":"# PostCSS plugin for typesafe CSS Custom Properties \n\nThis package adds a `token(...)` function to your CSS, which checks and parses the token passed in the argument and turns it into a CSS Custom Property (`var(--variable-name)`).\n\n## Install\n\nInstall PostCSS and this plugin as dev dependencies.\n\n```sh\nyarn add postcss @atb-as/token --dev\n```\n\n### Configure the plugin\n\nAdd a `postcss.config.json` file in the root of your project with the following content, or extend the current one.\n\n```json\n/** postcss.config.json */\n\n{\n  \"plugins\": [\n    \"@atb-as/token\"\n  ]\n}\n```\n\n#### NextJS\n\n> ⚠️ [NextJS preconfigures PostCSS](https://nextjs.org/docs/pages/building-your-application/configuring/post-css).\n> Therefore, we need to include the entire NextJS config for PostCSS\n> and add the `@atb-as/token` plugin in addition.\n\nFor NextJS `15.0.3`, the default PostCSS configuration with the `@atb-as/token` plugin shows below. This is also\nconfirmed to work on NextJS `14.2.13`.\n\nFor this configuration to work, we also need to add other PostCSS plugins explicitly to our `package.json`.\n\n```sh\nyarn add postcss-flexbugs-fixes postcss-preset-env --dev\n```\n\n```json\n/** postcss.config.json */\n{\n  \"plugins\": [\n    \"postcss-flexbugs-fixes\",\n    [\n      \"postcss-preset-env\",\n      {\n        \"autoprefixer\": {\n          \"flexbox\": \"no-2009\"\n        },\n        \"stage\": 3,\n        \"features\": {\n          \"custom-properties\": false\n        }\n      }\n    ],\n    \"@atb-as/token\"\n  ]\n}\n```\n\n## Usage\n\nThis plugin enables a `token` function in CSS, which checks the validity of the token and returns the\nmatching CSS Custom Property.\n\n`token(variable)`: `string`\nReplaces the token call with the corresponding CSS Custom Property.\n\nThrows an error if the variable does not exist or if the syntax is incorrect.\n\n- `variable`: `string`\nThe camelCase name of a variable surrounded by single quote `'` or double quotes `\"` segmented by a dot `.`.\n\n### Example\n\n```css\n/** button.module.css */\n\n.button--primary {\n  color: token('color.interactive.0.foreground.primary');\n  background-color: token('color.interactive.0.background');\n}\n```\n\nThis is compiled to CSS Custom Properties.\n\n```css\n/** Compiled button.module.css */\n\n.button--primary {\n  color: var(--color-interactive-0-foreground-primary);\n  background-color: var(--color-interactive-0-background);\n}\n```\n\n","readmeFilename":"README.md"}