Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

css-property

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-property

CSS property constructor.

  • 2.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
422
decreased by-30.48%
Maintainers
1
Weekly downloads
 
Created
Source

css-property Build Status Coverage Status

NPM

CSS property constructor

Install

Install with npm

npm install --save css-property

Usage v2

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;

Usage v1

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;

v2 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.compare(property)

Compares with another Property based on Selector#specificity.

property

Type: Object
Default: none

Property to compare.

property.toString()

Returns CSS property.

v1 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

Keywords

FAQs

Package last updated on 15 Jan 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc