{"_id":"css-shorthand-properties","_rev":"3792025","name":"css-shorthand-properties","description":"A simple list of CSS shorthand properties and which longhand properties they expand to","dist-tags":{"latest":"1.1.2"},"maintainers":[{"name":"gilmoreorless","email":"gilmoreorless@gmail.com"}],"time":{"modified":"2025-06-05T10:22:23.000Z","created":"2014-10-23T21:16:27.351Z","1.1.2":"2024-09-27T08:27:24.844Z","1.1.1":"2018-07-17T01:12:39.547Z","1.1.0":"2017-11-11T11:32:08.192Z","1.0.0":"2014-11-24T03:06:27.934Z","0.1.0":"2014-10-23T21:16:27.351Z"},"users":{},"author":{"name":"Gilmore Davidson"},"repository":{"type":"git","url":"git://github.com/gilmoreorless/css-shorthand-properties.git"},"versions":{"1.1.2":{"name":"css-shorthand-properties","description":"A simple list of CSS shorthand properties and which longhand properties they expand to","keywords":["css","shorthand","short","list"],"version":"1.1.2","author":{"name":"Gilmore Davidson"},"homepage":"https://github.com/gilmoreorless/css-shorthand-properties","repository":{"type":"git","url":"git://github.com/gilmoreorless/css-shorthand-properties.git"},"main":"index.js","license":"MIT","_id":"css-shorthand-properties@1.1.2","gitHead":"130ff6b453fe552b03810ca17163f1869123a770","bugs":{"url":"https://github.com/gilmoreorless/css-shorthand-properties/issues"},"_nodeVersion":"20.12.0","_npmVersion":"10.8.3","dist":{"shasum":"38fe2d8422190607cdb19c273c42303b774daf99","size":3990,"noattachment":false,"key":"/css-shorthand-properties/-/css-shorthand-properties-1.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/css-shorthand-properties/download/css-shorthand-properties-1.1.2.tgz"},"_npmUser":{"name":"gilmoreorless","email":"gilmoreorless@gmail.com"},"directories":{},"maintainers":[{"name":"gilmoreorless","email":"gilmoreorless@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/css-shorthand-properties_1.1.2_1727425644674_0.2685252434407501"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-09-27T08:27:24.844Z","publish_time":1727425644844,"_source_registry_name":"default","_cnpm_publish_time":1727425644844},"1.1.1":{"name":"css-shorthand-properties","description":"A simple list of CSS shorthand properties and which longhand properties they expand to","keywords":["css","shorthand","short","list"],"version":"1.1.1","author":{"name":"Gilmore Davidson"},"homepage":"https://github.com/gilmoreorless/css-shorthand-properties","repository":{"type":"git","url":"git://github.com/gilmoreorless/css-shorthand-properties.git"},"main":"index.js","licenses":[{"type":"MIT","url":"http://gilmoreorless.mit-license.org/"}],"gitHead":"2dc6a7ce94383ba00707445becd9f21418d2d369","bugs":{"url":"https://github.com/gilmoreorless/css-shorthand-properties/issues"},"_id":"css-shorthand-properties@1.1.1","_npmVersion":"6.2.0","_nodeVersion":"9.3.0","_npmUser":{"name":"gilmoreorless","email":"gilmoreorless@gmail.com"},"dist":{"shasum":"1c808e63553c283f289f2dd56fcee8f3337bd935","size":3972,"noattachment":false,"key":"/css-shorthand-properties/-/css-shorthand-properties-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/css-shorthand-properties/download/css-shorthand-properties-1.1.1.tgz"},"maintainers":[{"name":"gilmoreorless","email":"gilmoreorless@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/css-shorthand-properties_1.1.1_1531789959445_0.9688998812837999"},"_hasShrinkwrap":false,"publish_time":1531789959547,"_cnpm_publish_time":1531789959547},"1.1.0":{"name":"css-shorthand-properties","description":"A simple list of CSS shorthand properties and which longhand properties they expand to","keywords":["css","shorthand","short","list"],"version":"1.1.0","author":{"name":"Gilmore Davidson"},"homepage":"https://github.com/gilmoreorless/css-shorthand-properties","repository":{"type":"git","url":"git://github.com/gilmoreorless/css-shorthand-properties.git"},"main":"index.js","licenses":[{"type":"MIT","url":"http://gilmoreorless.mit-license.org/"}],"gitHead":"95e2a3bf99bfdde51b4caadb3c5ba3bf2e24445e","bugs":{"url":"https://github.com/gilmoreorless/css-shorthand-properties/issues"},"_id":"css-shorthand-properties@1.1.0","_npmVersion":"5.5.1","_nodeVersion":"8.1.4","_npmUser":{"name":"gilmoreorless","email":"gilmoreorless@gmail.com"},"dist":{"shasum":"e40a11e17f003cc1a9a772b19865508323659fff","size":2934,"noattachment":false,"key":"/css-shorthand-properties/-/css-shorthand-properties-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/css-shorthand-properties/download/css-shorthand-properties-1.1.0.tgz"},"maintainers":[{"name":"gilmoreorless","email":"gilmoreorless@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/css-shorthand-properties-1.1.0.tgz_1510399928106_0.514916957821697"},"directories":{},"publish_time":1510399928192,"_cnpm_publish_time":1510399928192,"_hasShrinkwrap":false},"1.0.0":{"name":"css-shorthand-properties","description":"A simple list of CSS shorthand properties and which longhand properties they expand to","keywords":["css","shorthand","short","list"],"version":"1.0.0","author":{"name":"Gilmore Davidson"},"homepage":"https://github.com/gilmoreorless/css-shorthand-properties","repository":{"type":"git","url":"git://github.com/gilmoreorless/css-shorthand-properties.git"},"main":"index.js","licenses":[{"type":"MIT","url":"http://gilmoreorless.mit-license.org/"}],"gitHead":"4f8f66852ff44d450515e36b85581b29dd48bea1","bugs":{"url":"https://github.com/gilmoreorless/css-shorthand-properties/issues"},"_id":"css-shorthand-properties@1.0.0","scripts":{},"_shasum":"567be671103679b9aa05a48155e51474b275877f","_from":".","_npmVersion":"2.1.8","_nodeVersion":"0.10.33","_npmUser":{"name":"gilmoreorless","email":"gilmoreorless@gmail.com"},"maintainers":[{"name":"gilmoreorless","email":"gilmoreorless@gmail.com"}],"dist":{"shasum":"567be671103679b9aa05a48155e51474b275877f","size":2625,"noattachment":false,"key":"/css-shorthand-properties/-/css-shorthand-properties-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/css-shorthand-properties/download/css-shorthand-properties-1.0.0.tgz"},"directories":{},"publish_time":1416798387934,"_cnpm_publish_time":1416798387934,"_hasShrinkwrap":false},"0.1.0":{"name":"css-shorthand-properties","description":"A simple list of CSS shorthand properties and which longhand properties they expand to","keywords":["css","shorthand","short","list"],"version":"0.1.0","author":{"name":"Gilmore Davidson"},"homepage":"https://github.com/gilmoreorless/css-shorthand-properties","repository":{"type":"git","url":"git://github.com/gilmoreorless/css-shorthand-properties.git"},"main":"index.js","licenses":[{"type":"MIT","url":"http://gilmoreorless.mit-license.org/"}],"gitHead":"ca1bd9f40c4b9d945cb4f6a1cfe2e4da7a432e76","bugs":{"url":"https://github.com/gilmoreorless/css-shorthand-properties/issues"},"_id":"css-shorthand-properties@0.1.0","scripts":{},"_shasum":"dd3ab16c9de0f61bcac3917b2b14863316d9af70","_from":".","_npmVersion":"2.0.0-beta.2","_npmUser":{"name":"gilmoreorless","email":"gilmoreorless@gmail.com"},"maintainers":[{"name":"gilmoreorless","email":"gilmoreorless@gmail.com"}],"dist":{"shasum":"dd3ab16c9de0f61bcac3917b2b14863316d9af70","size":2214,"noattachment":false,"key":"/css-shorthand-properties/-/css-shorthand-properties-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/css-shorthand-properties/download/css-shorthand-properties-0.1.0.tgz"},"directories":{},"publish_time":1414098987351,"_cnpm_publish_time":1414098987351,"_hasShrinkwrap":false}},"readme":"# CSS Shorthand Properties\n\nA simple way to list all [shorthand](https://www.w3.org/TR/CSS2/about.html#shorthand) CSS properties and which properties they expand to.\n\nI tried to search for an existing simple list but couldn't find one, so I trawled through the various [W3C CSS specs](https://www.w3.org/Style/CSS/current-work) and collated the data.\n\nOnly specs that are Candidate Recommendations or better are counted, with the exception of some Working Drafts that have a lot of traction in browser implementations. So far the WD specs included here are Animation and Transitions.\n\n## Usage\n\nAvailable on npm as `css-shorthand-properties`, or in the browser as a global called `cssShorthandProps`\n\n### Properties\n\n#### shorthandProperties\n\nThe core data as a simple JS object. Each key is a CSS shorthand property. Each value is a compacted list of CSS properties that the shorthand expands to.\n\nThere is a convenience method (listed below) that means you shouldn’t need to access this list directly, but it’s available for other use cases.\n\n\n### Methods\n\n#### isShorthand\n\n* Returns a boolean indicating if a CSS property is a shorthand.\n* **Parameters**:\n    * `property` _(String)_ Shorthand property to expand.\n* **Returns**: _Boolean_\n\n```js\ncssShorthandProps.isShorthand('border');  // true\ncssShorthandProps.isShorthand('display');  // false\n```\n\n#### expand\n\n* Takes a CSS shorthand property and returns a list of longhand properties.\n* **Parameters**:\n    * `property` _(String)_ Shorthand property to expand.\n    * `recurse` _(Boolean – optional, default `false`)_ If true, each longhand property will also be run through `expand()`. This is only useful for the `border` property.\n* **Returns**: _Array_ with a list of longhand properties that the given property expands to. If the property is not a shorthand, the array contains only the original property.\n\n```js\n// Standard usage\ncssShorthandProps.expand('list-style');\n// ['list-style-type', 'list-style-position', 'list-style-image']\n\n// Non-shorthand properties return themselves in an array\ncssShorthandProps.expand('color');\n// ['color']\n\n// Using 'border' in normal mode...\ncssShorthandProps.expand('border');\n// ['border-width', 'border-style', 'border-color']\n\n// ...but the border properties are also shorthands\ncssShorthandProps.expand('border-width');\n// ['border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width']\n\n// Using 'border' with recursion returns an array of arrays\ncssShorthandProps.expand('border', true);\n/*\n[\n  ['border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width'],\n  ['border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style'],\n  ['border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color']\n]\n*/\n```\n\n## Licence\n\nMIT: [https://gilmoreorless.mit-license.org/]()\n\n","_attachments":{},"homepage":"https://github.com/gilmoreorless/css-shorthand-properties","bugs":{"url":"https://github.com/gilmoreorless/css-shorthand-properties/issues"},"license":"MIT"}