{"_id":"short-css-vars","_rev":"30-39c3bd378842351b736bd6bd47f92d13","name":"short-css-vars","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"short-css-vars","version":"1.0.0","keywords":["css","variables","custom","properties","short","hash","name","shorten"],"author":{"name":"GoDaddy Operating Company, LLC"},"license":"MIT","_id":"short-css-vars@1.0.0","maintainers":[{"name":"kinetifex","email":"andrew@kinetifex.com"}],"contributors":[{"name":"Andrew Gerard","email":"agerard@godaddy.com"}],"homepage":"https://github.com/godaddy/short-css-vars/packages/short-css-vars#readme","bugs":{"url":"https://github.com/godaddy/short-css-vars/issues"},"dist":{"shasum":"3446199a393bc57bf6003869c81c2e698af0edac","tarball":"https://registry.npmjs.org/short-css-vars/-/short-css-vars-1.0.0.tgz","fileCount":7,"integrity":"sha512-RGYttAC6cvZoSKEa2h/cT//VdyADqvyNktwKmC3lpxH8C1hF5Psz3N6vnSoh0FJhFJ53VbtrgPgpO4OwGzzJCw==","signatures":[{"sig":"MEQCIGDwTtgAR/B0a0B36+km2Y5zNj2T8h07+4lDJ7tvkrKKAiA7JfBVfpn+6x2y6D9eAs1o1eo8XYUWJezdXc3gBWcPOw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15318,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGIcMCRA9TVsSAnZWagAAciMP/2NdFV0mT1Coc2el6piE\nvmKy0wMmgGJKSulSFCaQ1Tz0odMlMZz0I2kgy97j8lB3DSFHZrLf6IJnlL1U\nI80pEtAAHXVp8MoZUdHGaHZ18gdgvphCIfTb3IF79gP0qyY9Uij9Nj1qYbv9\nBwl8/5Rdljaz5u8osshnKqBj2OHQD8a2L2mqW0nViVhf7K6IDjdP/s+C771w\nhMkEtl7XJyv/dZtXrtXFgocmkqiOHzSgHHjolrySU2xm4QXgk0tfMt8ggJ1b\n6F5maJ0qvN5sKHKLxeUYPdn7W0I3U+j18ZhSBySCL4U1bSOMol+YD3ILuIod\naa18PpMfMRIrNqXR/+Ripg1Ez2IPgK1exobOZMgxVAk9/BYCg6wSAcQmzYmV\nqFFYBqr0cf1/7RT5T/EUj2I5vtjJSwWn1jjv+L1d8tfWJT6WqNwI0/MhwtgX\nsxglhU0GHt2MiamrI9bNk3rOyrq/1VHRjFQYcdHTSNScK16FLhZv0ZaHPOPu\nNjI7ptPfK61EqbjV4Uj4M6W+CUB/FlBvYKsJNP7cg7RIVWa1IOuABywKx6WO\n5IRLJDd7u0NbWLcQ/rTjNFlKOjrK4UeeHPjudF6LBIi3RRTdw3pTc8vickXO\nrjjekB7bX6KJr92aP3bmZHO8ZMil//5HSWqaFHU8rfDB7fGfHtp9e4E/1m4y\ndN82\r\n=7CUY\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"5a0023d93a1ff3b8fda737ad74e0d6e64a697e64","scripts":{"docs":"jsdoc2md -t README.template.md --plugin @godaddy/dmd --files index.js > README.md","lint":"eslint .","test":"nyc --reporter=lcov mocha index.test.js","lint:fix":"npm run lint -- --fix","posttest":"npm run lint"},"_npmUser":{"name":"kinetifex","email":"andrew@kinetifex.com"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","repository":{"url":"git+https://github.com/godaddy/short-css-vars.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v10.16.3+x64 (darwin)","description":"Optimization plugin to shorten the names of CSS variables","directories":{},"_nodeVersion":"10.16.3","dependencies":{"string-hash":"^1.1.3"},"eslintConfig":{"extends":"godaddy"},"eslintIgnore":["fixtures"],"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^15.1.0","mocha":"^8.0.1","assume":"^2.2.0","eslint":"^7.4.0","@godaddy/dmd":"^1.0.3","jsdoc-to-markdown":"^6.0.1","eslint-plugin-json":"^2.1.1","eslint-plugin-mocha":"^7.0.1","eslint-config-godaddy":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/short-css-vars_1.0.0_1595442955545_0.2697364433962881","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"short-css-vars","version":"1.1.0","keywords":["css","variables","custom","properties","short","hash","name","shorten"],"author":{"name":"GoDaddy Operating Company, LLC"},"license":"MIT","_id":"short-css-vars@1.1.0","maintainers":[{"name":"celiawaggoner","email":"cmwaggoner@gmail.com"},{"name":"decompil3d","email":"npm@jonathankeslin.com"},{"name":"elubin","email":"elubin@mit.edu"},{"name":"indexzero","email":"charlie.robbins@gmail.com"},{"name":"jh2oman","email":"jacobrwaterman@gmail.com"},{"name":"jpage","email":"jpage@godaddy.com"},{"name":"kinetifex","email":"andrew@kinetifex.com"},{"name":"kquerna","email":"kirsten@querna.org"},{"name":"rxmarbles","email":"rmarkins@gmail.com"},{"name":"salilagrawal","email":"agrwlsk@gmail.com"},{"name":"sbw","email":"silasbw@gmail.com"}],"contributors":[{"name":"Andrew Gerard","email":"agerard@godaddy.com"}],"homepage":"https://github.com/godaddy/short-css-vars/packages/short-css-vars#readme","bugs":{"url":"https://github.com/godaddy/short-css-vars/issues"},"dist":{"shasum":"e1277bbf16574cc361bb96eecf275a6af59a28d4","tarball":"https://registry.npmjs.org/short-css-vars/-/short-css-vars-1.1.0.tgz","fileCount":7,"integrity":"sha512-up4/2HgrfEBbL+s0hkMWNph70eb64k9u6oQaJvDFPNyhrgRRHys/3oYTh9xOx3cjL/Zr8eGA1rIbuTZYVvjWTA==","signatures":[{"sig":"MEYCIQCwAUo7bUVGvypkD3W4edt7R6XyQQzkmj7E5cnvxVbWJgIhAO8OC9mAKBHrgsTfcFnT6WMkOFSGf4EHJodGl/TA3EQR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":16921,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTr8yCRA9TVsSAnZWagAAje8P/17KTiNF1aZGvgAHh524\nhurtfttz49AsVyJiDS4zOPu9eUTUPVRp44bDzv9ObLdmpfCzQTcxsLb8xrjk\neT5T1VVt3As2tt4ri6Yi8O7KtkYRPt87iUUolKalemhLw51YeRSutXRf0GBP\n1C5CbUssG+qBvmNd5kwvTMw9yeAY3BWdQNjpvJFbySOJOIy6k/WNSJhNFxtP\nn4b22SyYy0UMTLfNS42Gb49JKJ47u1sv6h6L4AYfnJvQwtk8RKBQGenviD+7\n/yLU9hJYz+zqr5aoVIadP+WwQ9SYucOFvNTgp0OqewUCV+6mB4JHifzFUoCp\nc0ToaLwxC7FTiYpjOjQaIMfT7IXTfEMjx6vDEquTD8U+K4vg+EoG0N/NHqoy\neuJlxSvY6T0gNutV1fyDynQGM2/U5IXXbSM/mVBUo2cLGMKALWt22lA0QxBQ\nkcuvLDPtLdlEf8RxqM0MSaqwnUp6cuIzmPmc6vxnrDd8pv4ZWnZnIR+fmw4+\nbFu22KllcpoAcDEoWNh36y2ILk88NJynn73jnEYlikHl59HLL5DEpYe1vzT2\nXV0kbT3iXjL4d840g3uZ2BvNuNB/KlOxbZB3MQ2tIrfpg91QyxvzUd5rJYgq\nBk/wBOUBa7WEuvvN7e5dLGrTjMvyN0ztQ10hx0JTSxUQz7wJLESOE0cS53vW\npICB\r\n=R3xV\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"e2c069d4ecb8d7624df8b60fe68841093cd52368","scripts":{"docs":"jsdoc2md -t README.template.md --plugin @godaddy/dmd --files index.js > README.md","lint":"eslint .","test":"nyc --reporter=lcov mocha index.test.js","lint:fix":"npm run lint -- --fix","posttest":"npm run lint"},"_npmUser":{"name":"kinetifex","email":"andrew@kinetifex.com"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","repository":{"url":"git+https://github.com/godaddy/short-css-vars.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (darwin)","description":"Optimization plugin to shorten the names of CSS variables","directories":{},"_nodeVersion":"12.18.3","dependencies":{"string-hash":"^1.1.3"},"eslintConfig":{"extends":"godaddy"},"eslintIgnore":["fixtures"],"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^15.1.0","mocha":"^8.0.1","assume":"^2.2.0","eslint":"^7.4.0","@godaddy/dmd":"^1.0.3","jsdoc-to-markdown":"^6.0.1","eslint-plugin-json":"^2.1.1","eslint-plugin-mocha":"^7.0.1","eslint-config-godaddy":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/short-css-vars_1.1.0_1598996273525_0.7929557196657073","host":"s3://npm-registry-packages"}}},"time":{"created":"2020-07-22T18:35:55.512Z","modified":"2025-10-06T15:56:44.929Z","1.0.0":"2020-07-22T18:35:55.683Z","1.1.0":"2020-09-01T21:37:53.656Z"},"bugs":{"url":"https://github.com/godaddy/short-css-vars/issues"},"author":{"name":"GoDaddy Operating Company, LLC"},"license":"MIT","homepage":"https://github.com/godaddy/short-css-vars/packages/short-css-vars#readme","keywords":["css","variables","custom","properties","short","hash","name","shorten"],"repository":{"url":"git+https://github.com/godaddy/short-css-vars.git","type":"git"},"description":"Optimization plugin to shorten the names of CSS variables","contributors":[{"name":"Andrew Gerard","email":"agerard@godaddy.com"}],"maintainers":[{"email":"jpage@godaddy.com","name":"jpage"},{"email":"igor-brandao@outlook.com","name":"ibrandao"},{"email":"andrew@kinetifex.com","name":"kinetifex"},{"email":"rmarkins@gmail.com","name":"rxmarbles"},{"email":"kirsten@querna.org","name":"kquerna"},{"email":"npmjs@3rd-Eden.com","name":"3rdeden"},{"email":"jcrugzz@gmail.com","name":"jcrugzz"},{"email":"jeremiah@gowdy.me","name":"jgowdy"},{"email":"martijn@swaagman.online","name":"swaagie"},{"email":"jpina1@godaddy.com","name":"jpina1-godaddy"},{"email":"mmason2@godaddy.com","name":"mmason2"},{"email":"sgore@godaddy.com","name":"sgore-godaddy"},{"email":"rmarkins@godaddy.com","name":"rmarkins"},{"email":"wcole1@godaddy.com","name":"wcole1-godaddy"}],"readme":"# short-css-vars\n\n[![NPM Version](https://img.shields.io/npm/v/short-css-vars?style=flat-square)](https://www.npmjs.com/package/short-css-vars)\n[![Build Status](https://img.shields.io/circleci/build/gh/godaddy/short-css-vars?style=flat-square)](https://circleci.com/gh/godaddy/short-css-vars)\n[![License MIT](https://img.shields.io/github/license/godaddy/short-css-vars?style=flat-square)](LICENSE.md)\n\nUtility to shorten the names of CSS variables in stylesheets.\n\nCSS variables are renamed with a unique hash that is consistent across processed\nfiles. This allows you to have common style files that reference variables with\nvarying values defined in theme files.\n\n## Usage\n\nFor many cases you can simply configure these plugins in your build chains:\n- [postcss-short-css-vars]\n- [babel-plugin-short-css-vars]\n\nOtherwise, see the [API] docs below to use the utility directly.\n\n## Formatting\n\nThe default formatter uses the popular [string-hash] with a djb2-like algorithm,\nthen [base-36] encodes the result. In the rare chance of collisions, an error\nwill be thrown with the colliding names. A custom formatter can provided via\nthe [options](#new-shortcssvarsoptions)\n\n## Installation\n\n```\n$ npm install short-css-vars\n```\n\n## ShortCssVars\n\nShorten lengthy CSS variable names\n\n**Kind**: global class  \n\n* [ShortCssVars]\n    * [new ShortCssVars(\\[options\\])]\n    * [.replaceName(varName)]\n    * [.replaceCss(css)]\n    * [.getMap()]\n\n\n### new ShortCssVars(\\[options\\])\n\nEach instance keeps track of renamed variables to check for collisions and\nto provide a mapping of changed names.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| \\[options\\] | `object` | Optional configurations |\n| \\[options.formatter\\] | `function` | Custom formatter |\n| \\[options.ignore\\] | `RegExp` \\| `string` \\| `function` | Rule to ignore certain variable names |\n\n\n### shortCssVars.replaceName(varName)\n\nShortens the name part of a variable string\n\n**Kind**: instance method of [`ShortCssVars`]  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| varName | `string` | Variable name including -- prefix |\n\n\n### shortCssVars.replaceCss(css)\n\nShortens the names of variables throughout CSS\n\n**Kind**: instance method of [`ShortCssVars`]  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| css | `string` | Text containing CSS variables |\n\n\n### shortCssVars.getMap()\n\nGet a mapping of original names to shortened names\n\n**Kind**: instance method of [`ShortCssVars`]  \n**Example**  \n```js\n{\n  'long-variable-name-that-defines-a-particular-color': '1vf2dsn'\n}\n```\n<!-- LINKS -->\n\n[ShortCssVars]:#shortcssvars\n[`ShortCssVars`]:#new-shortcssvarsoptions\n[new ShortCssVars(\\[options\\])]:#new-shortcssvarsoptions\n[.replaceName(varName)]:#shortcssvarsreplacenamevarname\n[.replaceCss(css)]:#shortcssvarsreplacecsscss\n[.getMap()]:#shortcssvarsgetmap\n\n[API]:#installation\n[postcss-short-css-vars]:../postcss-short-css-vars/README.md\n[babel-plugin-short-css-vars]:../babel-plugin-short-css-vars/README.md\n[base-36]:https://en.wikipedia.org/wiki/Base36\n[string-hash]:https://www.npmjs.com/package/string-hash\n","readmeFilename":"README.md"}