{"_id":"postcss-short-css-vars","_rev":"30-ca6c797396b495982724542c76690a74","name":"postcss-short-css-vars","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"postcss-short-css-vars","version":"1.0.0","keywords":["postcss","postcss-plugin","css","variables","custom","properties","short","hash","name","shorten"],"author":{"name":"GoDaddy Operating Company, LLC"},"license":"MIT","_id":"postcss-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/postcss-short-css-vars#readme","bugs":{"url":"https://github.com/godaddy/short-css-vars/issues"},"dist":{"shasum":"db419ff558bd99fa30ef054089767d0720b30953","tarball":"https://registry.npmjs.org/postcss-short-css-vars/-/postcss-short-css-vars-1.0.0.tgz","fileCount":6,"integrity":"sha512-Vz8UHYeB+aERDVCuA/gv/zNXz6ZBtADUjDa/QZQssT2xGgIWbz0I/dfHYJTfKkliqHOFOUkl6AmaxmmAEEW3Ag==","signatures":[{"sig":"MEYCIQDsfu/6DVwZkb3Hk55fZ5GQCwwltkAQvDp3Xxfu3RzC2gIhAPob+msXSV3146Rv+ARK30PEQRHwpOhiXEzA4x2dnMqQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11276,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGIcRCRA9TVsSAnZWagAAR2AP/1Rtw0ZclhVA1wPFx4cH\nJ8ZmMc2Sz2Hs8tme5hX08uLfGnskHMIyNyydu2Io6liYNDg5FC2+zF7E5Yr8\nypzX/hS8L6L/tnF0ko9gUpaAr6aVyhTpEZ5qBJs/U8bA2XCe7SAhd0TOxr5v\nLR8JbjM41Y+gvkbniYLhu0pWVVw5ch5d3soTJUqWLUMwk7ANxMTXOyl1MEMN\nJ6yxEua9szb9krq4/s/WhqVP1AR8Hp4YFW4mvpU2J5W+M0HA14MOHHq7OUAU\nHGZz23L7d3xThFOJsvzAkRoW+5AEg9zlZe8KaPOhnoAuFPYG5LEjnC8k85qN\n/ak5rsjcdO9iJPrV+Uh6+l8HeBQ41llcjsxBOJEWLuPnBHp37TtkAts85yp+\nl9y3wvj5VvEL2ybVrj6LdZUvGxVgnoTujxflNcYua5Gz4W69T9TwGRmeyn6W\nAooDow10jP2Ou3ItAuW94sE+U41/VZUeSjOraaOzrgGtiGDGAYAZK0ajmugD\nKiYt8S8XLljK2F1CVfjMsJdvo1LrmL53sYL0nRNqnYByIAW3Ocbv+Khk4MvD\nhB4IwyPEiNne3xlf4qjOLkDqYox8dADlZaNw9CIO6OLpwZPnWpYtHZuqUIig\n2Np9iCVE165biVVw+nYfNIoFZiyrxNZMIya5+QHQkrOiuVgvX25e7+ZpyXMR\n6Ofp\r\n=ehi8\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"5a0023d93a1ff3b8fda737ad74e0d6e64a697e64","scripts":{"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":{"postcss":"^7.0.32","short-css-vars":"^1.0.0"},"eslintConfig":{"extends":"godaddy"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^15.1.0","mocha":"^8.0.1","assume":"^2.2.0","eslint":"^7.4.0","eslint-plugin-json":"^2.1.1","eslint-plugin-mocha":"^7.0.1","eslint-config-godaddy":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/postcss-short-css-vars_1.0.0_1595442960586_0.7239750404551268","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"postcss-short-css-vars","version":"1.1.0","keywords":["postcss","postcss-plugin","css","variables","custom","properties","short","hash","name","shorten"],"author":{"name":"GoDaddy Operating Company, LLC"},"license":"MIT","_id":"postcss-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/postcss-short-css-vars#readme","bugs":{"url":"https://github.com/godaddy/short-css-vars/issues"},"dist":{"shasum":"7c2aded212bd4c7468d1dabfad7410e9e79166e7","tarball":"https://registry.npmjs.org/postcss-short-css-vars/-/postcss-short-css-vars-1.1.0.tgz","fileCount":6,"integrity":"sha512-b/c2V7/bGHqWBmHpHNL+AZXKTeenUxx4+4+jZDXC/qy4Ta+4wSI1lN0zBTEkV0BESdAqddUTFVzLwkKPiq5xEA==","signatures":[{"sig":"MEUCIQDd6xwtIT7gCr2DrZ8wEooa3uOanJDur328ealE6DidzAIgB9y6xupORkA6KruZL4wMQdUEPab/epTZTaTg+f7DAr0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11895,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTr81CRA9TVsSAnZWagAAyroP/jsPrpWLQ1OXo/Igj77g\nHrxFGiUsmHzgVU6FKIpDslON9sXEGL1zb20DaTPzz/VL4Z9qsURzQeHFXvWH\nDexkuehneGbnLjwHVdF2EXMTIzjqPP4lY0GbwRZLk+MN/sPZzwiEe5esRcPo\nQPWaxwhsKU/T7Oq364ZW0sgeMTG8w1UJsojCLqHUXpAMoZxDPqewK1sNIfpN\nt65JBzcM93b1Sxj7V0gBLaZpbGoFG2sSv+kfqX/CLynDa2fA47rUkNWA6s7a\nod9FpcOeeQ21ENv/AG1YAW6qNFu7ahfU8SyrINf2EJ6HkgyDtV7gLWJWnn0p\n29Jt6NIK9QR+4GJO/Qa1t9iAeXSCQpzhGAf2ApbvwhN0V01zG8OfayjS/ukc\ni2R7Rd+5QTPYMz78HZQRw2M/0e8RYgnm++95yOxNfk4JQ508o+P9tHRpr4Z/\nR0/e6KRB/BxRmTn7M2T0f1sm7KCpmiwZxeMMF19FPDcGG0LJ5hE4COKmRjMh\npzgSwRNx0W/MJIRP/U1Osik7JNOHW+q5+obveeH5q2RXKEr/bOKxBjYFYMQY\nVE8ggQkXzdKuMC/JHsStEP/RU277oWkWPQ3MOZ6R6+pn+KxVHSpVWgbT6m7m\nGX4Mmu2bzLHdzEpm0Cu9GNstCCtP+0fLUcDMOCVsg0XI2khWzJAXmrt1jmCE\nHcxz\r\n=jrvb\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"e2c069d4ecb8d7624df8b60fe68841093cd52368","scripts":{"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":{"postcss":"^7.0.32","short-css-vars":"^1.1.0"},"eslintConfig":{"extends":"godaddy"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^15.1.0","mocha":"^8.0.1","assume":"^2.2.0","eslint":"^7.4.0","eslint-plugin-json":"^2.1.1","eslint-plugin-mocha":"^7.0.1","eslint-config-godaddy":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/postcss-short-css-vars_1.1.0_1598996276893_0.21851281159329372","host":"s3://npm-registry-packages"}}},"time":{"created":"2020-07-22T18:36:00.543Z","modified":"2025-10-06T15:57:30.464Z","1.0.0":"2020-07-22T18:36:00.701Z","1.1.0":"2020-09-01T21:37:57.031Z"},"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/postcss-short-css-vars#readme","keywords":["postcss","postcss-plugin","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":"# postcss-short-css-vars\n\n[![NPM Version](https://img.shields.io/npm/v/postcss-short-css-vars?style=flat-square)](https://www.npmjs.com/package/postcss-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](https://img.shields.io/github/license/godaddy/short-css-vars?style=flat-square)](LICENSE.md)\n\nPostCSS plugin using [short-css-vars] to shorten the names of CSS variables in\nstylesheets.\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## Installation\n\n```\n$ npm install postcss-short-css-vars --save-dev\n```\n\n## Example\n\n**Input**\n\n```css\n:root {\n --long-variable-name-that-defines-a-particular-color: blue;\n}\n\n.my-class {\n  color: var(--long-variable-name-that-defines-a-particular-color);\n}\n```\n\n**Output**\n\n```css\n:root {\n --1vf2dsn: blue;\n}\n\n.my-class {\n  color: var(--1vf2dsn);\n}\n```\n\n## Usage\n\nSee the [PostCSS docs] for examples on how to use this plugin in different\nenvironments.\n\n### Options\n\nThis plugin supports all the [utility options] with the addition of a callback\nto retrieve the rename map.\n\n#### callback\n\nA `callback` can be provided which will be provided with an object to show what\nvariables were renamed as.\n\n```json\n{\n  \"long-variable-name-that-defines-a-particular-color\": \"1vf2dsn\"\n}\n```\n\nYou can utilize this for logging or other tracking purposes.\n\n```js\nconst postcss = require('postcss');\nconst shortCssVars = require('postcss-short-css-vars');\nconst fs = require('fs');\n\npostcss([shortCssVars({\n  callback: map => {\n    console.log(JSON.stringify(map));\n    fs.writeFile('css-vars-map.json', JSON.stringify(map), 'utf8');    \n  }\n})])\n```\n\n#### formatter\n\nSee the utility for how the [default formatting] works. If you wish to use a\ndifferent pattern, simply provide a different formatter function via options.\n\n```js\nconst postcss = require('postcss');\nconst shortCssVars = require('postcss-short-css-vars');\nconst fnv1a = require('fnv1a');\n\npostcss([shortCssVars({\n  formatter: name => fnv1a(name).toString(36)\n})])\n```\n\nThe `name` provided to the formatter is the variable name WITHOUT the '--'\nprefix. The return value should also be name-only. So `my-custom-var` rather\nthan `--my-custom-var`.\n\n#### ignore\n\nIf you need to avoid hashing certain variable names, you can ignore them with\nthis option by either RegExp, function, or string (which will be turned into\nRegExp). This can be useful if you are referencing CSS Variables in an app,\nyet you do not have control over some of the declarations.\n\n```js\nconst postcss = require('postcss');\nconst shortCssVars = require('postcss-short-css-vars');\n\npostcss([shortCssVars({\n  ignore: /^third-party-theme/\n})])\n```\n\nIn another scenario, if you have several short variable names (for example\n`--blue`) you can use a function to ignore names by length.\n\n```js\npostcss([shortCssVars({\n  ignore: name => name.length <= 4\n})])\n```\n\nThe `name` provided to ignore is the variable name WITHOUT the '--' prefix. So\n`blue` rather than `--blue`.\n\n<!-- LINK -->\n\n[short-css-vars]: ../short-css-vars/README.md\n[default formatting]: ../short-css-vars/README.md#formatting\n[utility options]: ../short-css-vars/README.md#new-shortcssvarsoptions\n[PostCSS docs]: https://github.com/postcss/postcss#usage\n\n","readmeFilename":"README.md"}