{"_id":"css-tokens","_rev":"25-bc2d00f95ed89b53eb90b9c6736d0729","name":"css-tokens","description":"A regex that tokenizes CSS.","dist-tags":{"latest":"2.0.0"},"versions":{"0.1.0":{"name":"css-tokens","version":"0.1.0","author":{"name":"Simon Lydell"},"license":"MIT","description":"A regex that tokenizes CSS.","main":"index.js","repository":{"type":"git","url":"git://github.com/lydell/css-tokens"},"keywords":["CSS","css","token","tokenize","regex"],"scripts":{"test":"mocha"},"devDependencies":{"mocha":"^1.17.1","coffee-script":"~1.7.1"},"bugs":{"url":"https://github.com/lydell/css-tokens/issues"},"homepage":"https://github.com/lydell/css-tokens","_id":"css-tokens@0.1.0","dist":{"shasum":"8b397e0d877a48ea06848419a1fbad2fa1e06acb","tarball":"https://registry.npmjs.org/css-tokens/-/css-tokens-0.1.0.tgz","integrity":"sha512-/JRP5co2sZ297B9X3LtX56Xk9dL5SCsBtSTRF2vG9qYoA8K+YJn5aRBDEDtwGyq+VUeh228nTaXzblgGv3KgYQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCf/EJh1ktaiOS4T0/+B+ItWmJcY10osmqZaIIh0B0ZxAIgTP1eg3IJd78pq1MI1tOi/JOiMYvrneh11VooLOy2Oow="}]},"_from":".","_npmVersion":"1.4.4","_npmUser":{"name":"lydell","email":"simon.lydell@gmail.com"},"maintainers":[{"name":"lydell","email":"simon.lydell@gmail.com"}],"directories":{},"deprecated":"Use @csstools/tokenizer instead."},"0.2.0":{"name":"css-tokens","version":"0.2.0","author":{"name":"Simon Lydell"},"license":"MIT","description":"A regex that tokenizes CSS.","main":"index.js","repository":{"type":"git","url":"git://github.com/lydell/css-tokens"},"keywords":["CSS","css","token","tokenize","regex"],"scripts":{"test":"mocha"},"devDependencies":{"mocha":"^1.17.1","coffee-script":"~1.7.1"},"bugs":{"url":"https://github.com/lydell/css-tokens/issues"},"homepage":"https://github.com/lydell/css-tokens","_id":"css-tokens@0.2.0","dist":{"shasum":"3169ae0857549472fee6a5a14f81d06e35d331a4","tarball":"https://registry.npmjs.org/css-tokens/-/css-tokens-0.2.0.tgz","integrity":"sha512-LLKj4NnQ1Y5Rl53uzenvtMEUKEB6UFGHYTFJHW2JBnbYJ0ZZXCLHl0xUzEd7qaepaWrhijHI1saZYt5hPPB57g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICsmxn3VCinXQhSfjabtCRWcTmwUrwErq3tzTwNUtltjAiEA+H7Zu+Ml/rOYIHpStvsUYxgmLIuC1REKftcwke6JjwE="}]},"_from":".","_npmVersion":"1.4.4","_npmUser":{"name":"lydell","email":"simon.lydell@gmail.com"},"maintainers":[{"name":"lydell","email":"simon.lydell@gmail.com"}],"directories":{},"deprecated":"Use @csstools/tokenizer instead."},"0.3.0":{"name":"css-tokens","version":"0.3.0","author":{"name":"Simon Lydell"},"license":"MIT","description":"A regex that tokenizes CSS.","main":"index.js","keywords":["CSS","css","token","tokenize","regex"],"repository":{"type":"git","url":"git://github.com/lydell/css-tokens"},"scripts":{"test":"mocha"},"devDependencies":{"mocha":"^1.17.1","coffee-script":"~1.7.1"},"bugs":{"url":"https://github.com/lydell/css-tokens/issues"},"homepage":"https://github.com/lydell/css-tokens","_id":"css-tokens@0.3.0","_shasum":"44a1f4e12bd0f625693bdd3d6bbc0088c3d9629b","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"lydell","email":"simon.lydell@gmail.com"},"maintainers":[{"name":"lydell","email":"simon.lydell@gmail.com"}],"dist":{"shasum":"44a1f4e12bd0f625693bdd3d6bbc0088c3d9629b","tarball":"https://registry.npmjs.org/css-tokens/-/css-tokens-0.3.0.tgz","integrity":"sha512-gZvJwUmW6QgWK3kiiy7Ry/abQvcULWI4sJI2ioCqcig8XiM52LKQOFPzTlOBUJWPpf92HlFIV9IeMTkBOXBAkg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCYlGSm9G1+MFaUXCxRB0vexRYmtKnBDtN/an9uDAW0wAIhAJvEqnhoYe/0wll2mpiLnfVMk1quSKzEDQYdIII68R6Y"}]},"directories":{},"deprecated":"Use @csstools/tokenizer instead."},"0.4.0":{"name":"css-tokens","version":"0.4.0","author":{"name":"Simon Lydell"},"license":"MIT","description":"A regex that tokenizes CSS.","keywords":["CSS","css","token","tokenize","regex"],"repository":{"type":"git","url":"https://github.com/lydell/css-tokens"},"scripts":{"test":"mocha --ui tdd","build":"node generate-index.js","dev":"npm run build && npm test"},"devDependencies":{"coffee-script":"^1.8.0","mocha":"^2.0.1"},"gitHead":"a613028c411d48752e5c266217d25c2710599990","bugs":{"url":"https://github.com/lydell/css-tokens/issues"},"homepage":"https://github.com/lydell/css-tokens","_id":"css-tokens@0.4.0","_shasum":"3f37284ccd5b192cfbee0d421e7774bffa6c76cd","_from":".","_npmVersion":"2.1.7","_nodeVersion":"0.10.33","_npmUser":{"name":"lydell","email":"simon.lydell@gmail.com"},"maintainers":[{"name":"lydell","email":"simon.lydell@gmail.com"}],"dist":{"shasum":"3f37284ccd5b192cfbee0d421e7774bffa6c76cd","tarball":"https://registry.npmjs.org/css-tokens/-/css-tokens-0.4.0.tgz","integrity":"sha512-dUdnJhoeh7SB741golhOjTIkvSwnRAktNx7nAkXgAoQXykPMlK4Z+lc+D5xy1pYFADaaRPKwqYXgQqr4PAYswg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFSV852Ja0A++WePUM8NiYwAnAehW3dSqeeZOxrvGzaBAiBc6RsoVsAqHYcjeJcfKmCsftqmFZvw7zcBOWlDgE6FqQ=="}]},"directories":{},"deprecated":"Use @csstools/tokenizer instead."},"0.4.1":{"name":"css-tokens","version":"0.4.1","author":{"name":"Simon Lydell"},"license":"MIT","description":"A regex that tokenizes CSS.","keywords":["CSS","css","token","tokenize","regex"],"repository":{"type":"git","url":"https://github.com/lydell/css-tokens"},"scripts":{"test":"mocha --ui tdd","build":"node generate-index.js","dev":"npm run build && npm test"},"devDependencies":{"coffee-script":"^1.8.0","mocha":"^2.0.1"},"gitHead":"60d7c1f9a8d93b42008fe7cea260c05a11c7fa0c","bugs":{"url":"https://github.com/lydell/css-tokens/issues"},"homepage":"https://github.com/lydell/css-tokens","_id":"css-tokens@0.4.1","_shasum":"92fa97493bcaa0333838c522599206372455e95a","_from":".","_npmVersion":"2.1.16","_nodeVersion":"0.10.35","_npmUser":{"name":"lydell","email":"simon.lydell@gmail.com"},"maintainers":[{"name":"lydell","email":"simon.lydell@gmail.com"}],"dist":{"shasum":"92fa97493bcaa0333838c522599206372455e95a","tarball":"https://registry.npmjs.org/css-tokens/-/css-tokens-0.4.1.tgz","integrity":"sha512-f2xscMyvjhocqw+B4KZLrvpwaudq0uJHnVKR8c1ivkPBZVKnVNEZO8XuB9kYDD+1nAYHTeTNQakJ7fDSevHo4w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF6zpV+0dSk9hYUk51mXaTKnXTIcOJ5xHdCIlHuLadt1AiEA7CspkSzR7Kdbrsm20GwGiHFORUHdjzzY+GAGgJhusIo="}]},"directories":{},"deprecated":"Use @csstools/tokenizer instead."},"0.4.2":{"name":"css-tokens","version":"0.4.2","author":{"name":"Simon Lydell"},"license":"MIT","description":"A regex that tokenizes CSS.","keywords":["CSS","css","token","tokenize","regex"],"repository":{"type":"git","url":"https://github.com/lydell/css-tokens"},"scripts":{"test":"mocha --ui tdd","build":"node generate-index.js","dev":"npm run build && npm test"},"devDependencies":{"coffee-script":"^1.8.0","mocha":"^2.0.1"},"gitHead":"2666ede74417c993cf92607a6d3061dec8c11750","bugs":{"url":"https://github.com/lydell/css-tokens/issues"},"homepage":"https://github.com/lydell/css-tokens","_id":"css-tokens@0.4.2","_shasum":"5300a4fa1e76e0feeb977e744b6300e0d8cc34b4","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"lydell","email":"simon.lydell@gmail.com"},"maintainers":[{"name":"lydell","email":"simon.lydell@gmail.com"}],"dist":{"shasum":"5300a4fa1e76e0feeb977e744b6300e0d8cc34b4","tarball":"https://registry.npmjs.org/css-tokens/-/css-tokens-0.4.2.tgz","integrity":"sha512-PbcYQAojP6IwVoALKpMnqDPi2an1zvd9YlIE/lwJw/ZgfYqErp3jnJ06+gWyH0qcr8e9Iy7v919ZgNQ5Sd5b8A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHx17HVRlL6GMsyqiye9Bh2CYF1fFotT/fJ49T5dDol+AiEAxUp5JDthpODkqnSMuAdvt4FDYe2caaN2kvHy3r82QHU="}]},"directories":{},"deprecated":"Use @csstools/tokenizer instead."},"1.0.0":{"name":"css-tokens","version":"1.0.0","author":{"name":"Simon Lydell"},"license":"MIT","description":"A regex that tokenizes CSS.","keywords":["CSS","css","token","tokenize","regex"],"repository":{"type":"git","url":"https://github.com/lydell/css-tokens"},"scripts":{"test":"mocha --ui tdd","build":"node generate-index.js","dev":"npm run build && npm test"},"devDependencies":{"coffee-script":"^1.8.0","mocha":"^2.0.1"},"gitHead":"c012065452dd0efea3de432bc7a7283bb831766c","bugs":{"url":"https://github.com/lydell/css-tokens/issues"},"homepage":"https://github.com/lydell/css-tokens","_id":"css-tokens@1.0.0","_shasum":"eebba9eb596ce529f65d373d928b01c2955c874b","_from":".","_npmVersion":"2.6.0","_nodeVersion":"0.10.36","_npmUser":{"name":"lydell","email":"simon.lydell@gmail.com"},"maintainers":[{"name":"lydell","email":"simon.lydell@gmail.com"}],"dist":{"shasum":"eebba9eb596ce529f65d373d928b01c2955c874b","tarball":"https://registry.npmjs.org/css-tokens/-/css-tokens-1.0.0.tgz","integrity":"sha512-eWKobppkfzwew+lFBzfBGm5KU2TuGEAxpoRf+1h8h4q1hxDfhRYE0A5BrcVy4Sm7PV+nVFQ3RqSz3LyQXNiaJQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICbj1kV8QzPRBLfDoFaweoDAg7O8aop1Du4dttsOx8MCAiEAiyaww5zDaAGWVeh2gz9ueQtqJXy3DLCQNk4NqLOHKGw="}]},"directories":{},"deprecated":"Use @csstools/tokenizer instead."},"1.0.1":{"name":"css-tokens","version":"1.0.1","author":{"name":"Simon Lydell"},"license":"MIT","description":"A regex that tokenizes CSS.","keywords":["CSS","css","token","tokenize","regex"],"repository":{"type":"git","url":"git+https://github.com/lydell/css-tokens.git"},"scripts":{"test":"mocha --ui tdd","build":"node generate-index.js","dev":"npm run build && npm test"},"devDependencies":{"coffee-script":"~1.9.3","mocha":"^2.2.5"},"gitHead":"43cdc2f4ba29639fe151a1bcfc86cd8582cb006e","bugs":{"url":"https://github.com/lydell/css-tokens/issues"},"homepage":"https://github.com/lydell/css-tokens#readme","_id":"css-tokens@1.0.1","_shasum":"49ed0d2c9a60e81fad09f35a10092825ef185f98","_from":".","_npmVersion":"2.8.3","_nodeVersion":"1.8.1","_npmUser":{"name":"lydell","email":"simon.lydell@gmail.com"},"dist":{"shasum":"49ed0d2c9a60e81fad09f35a10092825ef185f98","tarball":"https://registry.npmjs.org/css-tokens/-/css-tokens-1.0.1.tgz","integrity":"sha512-khEe31ED+WNy358KD7rTLNkXL2A9fEsznN+fwklTvUV/bSomLaKsKOXi2meu7Bs4tJCrNZaQRai20HrBoD4RXQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCHa4t59lS8cIsWLcu6VPguEOkw03g8VWov3TGgnDCajQIgJ7vnezW9ylITeP1leaK3CaEew2+812bj8beVz+WZt7c="}]},"maintainers":[{"name":"lydell","email":"simon.lydell@gmail.com"}],"directories":{},"deprecated":"Use @csstools/tokenizer instead."},"2.0.0":{"name":"css-tokens","version":"2.0.0","author":{"name":"Simon Lydell"},"license":"MIT","description":"A regex that tokenizes CSS.","keywords":["CSS","css","token","tokenize","regex"],"files":["index.js"],"repository":{"type":"git","url":"git+https://github.com/lydell/css-tokens.git"},"scripts":{"test":"mocha --ui tdd","build":"node generate-index.js","dev":"npm run build && npm test"},"devDependencies":{"coffee-script":"~1.12.2","mocha":"^3.2.0"},"gitHead":"42bbe0be9412fd7894f037fcc797b4386f5569e0","bugs":{"url":"https://github.com/lydell/css-tokens/issues"},"homepage":"https://github.com/lydell/css-tokens#readme","_id":"css-tokens@2.0.0","_shasum":"f01601949265dc2237a86f5a31a56212c1d6c6d4","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.2.0","_npmUser":{"name":"lydell","email":"simon.lydell@gmail.com"},"dist":{"shasum":"f01601949265dc2237a86f5a31a56212c1d6c6d4","tarball":"https://registry.npmjs.org/css-tokens/-/css-tokens-2.0.0.tgz","integrity":"sha512-u00S7q9xhm6xGoc5t5iefgB+9Hv9JoBfz/hdQKNnVLfQh3QeQ15+L/L3536l4OOdroyXXrkA0lW1zcfHGXZwAQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB5D43Ar9+adB9F26eealzP9fF20aU5qMeEg3T1ry8b3AiEAy6ZW6sC/FARjSi3VGaSAJwR5MzR5joMKqSQpfMCERwg="}]},"maintainers":[{"name":"lydell","email":"simon.lydell@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/css-tokens-2.0.0.tgz_1484167105259_0.8892029207199812"},"directories":{},"deprecated":"Use @csstools/tokenizer instead."}},"readme":"Overview [![Build Status](https://travis-ci.org/lydell/css-tokens.png?branch=master)](https://travis-ci.org/lydell/css-tokens)\n========\n\nA regex that tokenizes CSS.\n\n```js\nvar cssTokens = require(\"css-tokens\").default\n\nvar cssString = \".foo{prop: foo;}\\n...\"\n\ncssString.match(cssTokens)\n// [\".foo\", \"{\", \"prop\", \":\", \" \", \"foo\", \";\", \"}\", \"\\n\", ...]\n```\n\n\nInstallation\n============\n\n- `npm install css-tokens`\n\n```js\nimport cssTokens from \"css-tokens\"\n// or:\nvar cssTokens = require(\"css-tokens\").default\n```\n\n\nUsage\n=====\n\n### `cssTokens` ###\n\nA regex with the `g` flag that matches CSS tokens.\n\nThe regex _always_ matches, even invalid CSS and the empty string.\n\nThe next match is always directly after the previous.\n\n### `var token = matchToToken(match)` ###\n\n```js\nimport {matchToToken} from \"css-tokens\"\n// or:\nvar matchToToken = require(\"css-tokens\").matchToToken\n```\n\nTakes a `match` returned by `cssTokens.exec(string)`, and returns a `{type:\nString, value: String}` object. The following types are available:\n\n- string\n- comment\n- number\n- unquotedUrl\n- name\n- punctuator\n- whitespace\n- invalid\n\nComments and strings also have a `closed` property indicating if the token was\nclosed or not (see below).\n\nStrings come in two flavors. To distinguish them, check if the token starts with\n`'` or `\"`.\n\nNames may start with `@` (as in at-rule names), `.` (as in class selectors) and\n`#` (as in id selectors and hex colors).\n\n\nInvalid code handling\n=====================\n\nUnterminated strings are still matched as strings. CSS strings cannot contain\n(unescaped) newlines, so unterminated strings simply end at the end of the\nline.\n\nUnterminated multi-line comments are also still matched as comments. They\nsimply go on to the end of the string.\n\nUnterminated unquoted urls are also still matched as unquoted urls. They\ncontinue as long as there are valid characters.\n\nInvalid ASCII characters have their own capturing group.\n\n\nLimitations\n===========\n\nTokenizing CSS using regexes—in fact, _one single regex_—won’t be\nperfect. But that’s not the point either.\n\n### Quoted vs. unquoted urls ###\n\nThe following is hardly a “limitation”, but could be mentioned:\n\n```css\nurl(http://www.w3.org/2000/svg)\nurl('http://www.w3.org/2000/svg')\n```\n\nThe first line is matched as one single token (unquotedUrl), while the second\nis matched as four (name + punctuator + string + punctuator). This _could_ be\nfixed, but isn’t to simplify the regex.\n\n\nLicense\n=======\n\n[MIT](LICENSE).\n","maintainers":[{"name":"lydell","email":"simon.lydell@gmail.com"}],"time":{"modified":"2022-06-14T04:54:25.012Z","created":"2014-03-09T13:04:36.809Z","0.1.0":"2014-03-09T13:04:36.809Z","0.2.0":"2014-03-11T19:54:26.804Z","0.3.0":"2014-06-19T20:50:23.357Z","0.4.0":"2014-12-19T18:24:13.358Z","0.4.1":"2015-01-08T18:27:54.297Z","0.4.2":"2015-02-21T17:56:40.994Z","1.0.0":"2015-02-26T09:57:54.192Z","1.0.1":"2015-06-20T06:56:53.212Z","2.0.0":"2017-01-11T20:38:25.907Z"},"homepage":"https://github.com/lydell/css-tokens#readme","keywords":["CSS","css","token","tokenize","regex"],"repository":{"type":"git","url":"git+https://github.com/lydell/css-tokens.git"},"author":{"name":"Simon Lydell"},"bugs":{"url":"https://github.com/lydell/css-tokens/issues"},"license":"MIT","readmeFilename":"README.md","users":{}}