apartment
Remove properties from a stylesheet
Last updated 4 years ago by bevacqua .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install apartment 
SYNC missed versions from official npm registry.

apartment

remove undesirable properties from a piece of css

motivation

tools like penthouse don't really care about specific properties, but if you have critical content with css rules such as animation or transition, you might end up with a lot more css than what you actually need to inline in your pages.

you can also use apartment to remove rules matching a selector string.

install

npm install apartment --save

examples

using the api:

apartment('.foo{font-size:12px;font-weight:bold}', { properties: ['font-size'] })
// <- '.foo{font-weight:bold}'
apartment('.foo{font-size:12px;}', { properties: ['font-size'] })
// <- ''
apartment('.foo{font-size:12px;font-weight:bold}', { selectors: ['.foo'] })
// <- ''

using the cli:

$ echo '.foo{font-size:12px;font-weight:bold}' | apartment -p font-size
> .foo{font-weight:bold}
$ echo '.foo{font-size:12px;}' | apartment -p font-size
>
$ echo '.foo{font-size:12px;}' | apartment -s .bar
> .foo{font-size:12px}

testing

npm test

license

mit

Current Tags

  • 1.1.1                                ...           latest (4 years ago)

3 Versions

  • 1.1.1                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 5
Last Month 12
Dependencies (4)
Dev Dependencies (2)

Copyright 2014 - 2016 © taobao.org |