CSS property constructor
Install with npm
npm install --save css-property
var selector = require('style-selector'),
property = require('css-property'),
bodySelector = selector('body'),
prop = property('font-family', 'Arial', bodySelector);
console.log(prop.prop); // font-family
console.log(prop.value); // Arial
console.log(prop.selector.text); // body
console.log(prop.toString()); // font-family: Arial;
var Selector = require('style-selector'),
Property = require('css-property'),
bodySelector = new Selector('body'),
prop = new Property('font-family', 'Arial', bodySelector);
console.log(prop.prop); // font-family
console.log(prop.value); // Arial
console.log(prop.selector.text); // body
console.log(prop.toString()); // font-family: Arial;
Type: String
Default: none
Property
Type: String
Default: none
Value
Type: Object
Default: none
Selector the property originates from.
Compares with another Property based on Selector#specificity.
Type: Object
Default: none
Property to compare.
Returns CSS property.
Type: String
Default: none
Property
Type: String
Default: none
Value
Type: Object
Default: none
Selector the property originates from.
Compares with another Property based on Selector#specificity.
Type: Object
Default: none
Property to compare.
Returns CSS property.
The code for this module was originally taken from the Juice library.
MIT