What is known-css-properties?
The known-css-properties npm package provides a comprehensive list of all known CSS properties. It is useful for validating CSS properties, building CSS parsers, or creating tools that need to work with CSS properties.
What are known-css-properties's main functionalities?
List all known CSS properties
This feature allows you to retrieve a list of all known CSS properties. The code sample demonstrates how to import the package and log the list of properties to the console.
const knownCssProperties = require('known-css-properties');
console.log(knownCssProperties.all);
Check if a property is known
This feature allows you to check if a specific CSS property is known. The code sample shows how to check if 'color' is a known CSS property.
const knownCssProperties = require('known-css-properties');
const isKnown = knownCssProperties.all.includes('color');
console.log(isKnown); // true
Other packages similar to known-css-properties
css-properties
The css-properties package provides a list of all CSS properties, similar to known-css-properties. It is useful for validating and working with CSS properties. However, it may not be as comprehensive or up-to-date as known-css-properties.
mdn-data
The mdn-data package provides data from the MDN (Mozilla Developer Network) about various web technologies, including CSS properties. It offers a broader range of data beyond just CSS properties, making it more versatile but potentially more complex to use for just CSS properties.
CSS properties
List of standard and browser specific CSS properties.
Source
- Standard properties (only 'REC', 'CR', 'LC', 'WD', 'FPWD', 'ED' statuses): http://www.w3.org/Style/CSS/all-properties.en.json
- Browser supported properties from
window.getComputedStyle
/ document.body.style
Windows
| XP | 7 | 8 | 10 |
---|
Chrome | 18-49 | 18-50 | 22-50 | 37-56 |
Firefox | 6-45 | 6-45 | 16-45 | 32-52 |
Internet Explorer | | 8-11 | 10-11 | 11 |
Edge | | | | 13-14 |
OSX
| 10.6 | 10.11 | 10.12 |
---|
Chrome | 14-49 | 14-58 | 59-60 |
Firefox | 6-42 | 6-52 | 53-54 |
Others:
- Safari: 6, 6.2, 7, 8, 9, 9.1, 10.0
- Mobile Safari: 6, 7, 8, 8.3, 9.0, 9.3, 10.0, 10.2, 10.3
- Chrome Android: 30, 35, 37, 44, 46, 55, 56, 57, 58, 59
- Firefox mobile: 47, 52, 53, 54
- IE mobile: 11
- Opera Win XP: 12.10, 12.14, 12.15, 12.16
- Opera Win 8: 36-38
- Opera OSX: 36-40, 45
- Opera Mobile: 42.7
- Samsung internet: 4.0
- UC browser: 11.2
JavaScript API
const properties = require('known-css-properties').all;
Thanks
We use SauceLabs testing solution for getting most of the data.