Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
css-shorthand-properties
Advanced tools
A simple list of CSS shorthand properties and which longhand properties they expand to
A simple way to list all shorthand CSS properties and which properties they expand to.
I tried to search for an existing simple list but couldn't find one, so I trawled through the various W3C CSS specs and collated the data.
Only 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.
Available on npm as css-shorthand-properties
, or in the browser as a global called cssShorthandProps
The 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.
There 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.
property
(String) Shorthand property to expand.cssShorthandProps.isShorthand('border'); // true
cssShorthandProps.isShorthand('display'); // false
property
(String) Shorthand property to expand.recurse
(Boolean – optional, default false
) If true, each longhand property will also be run through expand()
. This is only useful for the border
property.// Standard usage
cssShorthandProps.expand('list-style');
// ['list-style-type', 'list-style-position', 'list-style-image']
// Non-shorthand properties return themselves in an array
cssShorthandProps.expand('color');
// ['color']
// Using 'border' in normal mode...
cssShorthandProps.expand('border');
// ['border-width', 'border-style', 'border-color']
// ...but the border properties are also shorthands
cssShorthandProps.expand('border-width');
// ['border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width']
// Using 'border' with recursion returns an array of arrays
cssShorthandProps.expand('border', true);
/*
[
['border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width'],
['border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style'],
['border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color']
]
*/
1.1.2 - 2024-09-27
package.json
to remove deprecated syntax. (#7)FAQs
A simple list of CSS shorthand properties and which longhand properties they expand to
The npm package css-shorthand-properties receives a total of 677,196 weekly downloads. As such, css-shorthand-properties popularity was classified as popular.
We found that css-shorthand-properties demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.