JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 357
  • Score
    100M100P100Q104076F
  • License MIT

CSS property constructor.

Package Exports

  • css-property

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (css-property) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

css-property Build Status Coverage Status

NPM

CSS property constructor

Install

Install with npm

npm install --save css-property

Usage

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;

API

Property(prop, value, selector)

prop

Type: String
Default: none

Property

value

Type: String
Default: none

Value

selector

Type: Object
Default: none

Selector the property originates from.

Property.prototype.compare(property)

Compares with another Property based on Selector#specificity.

property

Type: Object
Default: none

Property to compare.

Property.prototype.toString()

Returns CSS property.

Credit

The code for this module was originally taken from the Juice library.

License

MIT