{"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":{"integrity":"sha512-C2AugXIpRGQTxaCW0N7n5jD/p5irUmCrwl03TrnMFBHDbdq44CFWR2zO7rK9xPN4Eo3pUxC4vQzQgbIpzrD1PQ==","shasum":"38fe2d8422190607cdb19c273c42303b774daf99","tarball":"http://registry-npm.ywwl.com/css-shorthand-properties/download/css-shorthand-properties-1.1.2.tgz","fileCount":5,"unpackedSize":11204,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3I9ljKyr3yDMKJs3rhCFPsZCXjyHFUyasOC5VasNGNwIhAIp9lEZu3Smmki+ha8QAYj9z8XQDyaux2uTpKw3NGpAs"}],"size":3990,"noattachment":false,"key":"/css-shorthand-properties/-/css-shorthand-properties-1.1.2.tgz"},"_npmUser":{"name":"gilmoreorless","email":"gilmoreorless@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/css-shorthand-properties_1.1.2_1727425644674_0.2685252434407501"},"_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","publish_time":1727425644844,"maintainers":[{"name":"gilmoreorless","email":"gilmoreorless@gmail.com"}],"_cnpm_publish_time":1727425644844,"dist-tags":{"latest":"1.1.2"}}