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

rework

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rework - npm Package Compare versions

Comparing version 0.9.2 to 0.10.0

lib/plugins/extend.js

5

component.json
{
"name": "rework",
"version": "0.9.2",
"version": "0.10.0",
"description": "CSS manipulations built on CSSOM",

@@ -8,2 +8,3 @@ "keywords": ["css", "manipulation", "preprocess", "transform"],

"visionmedia/css": "1.0.7",
"visionmedia/debug": "*",
"component/path": "*"

@@ -26,2 +27,2 @@ },

]
}
}
0.10.0 2012-12-10
==================
* add .mixin -> .mixins alias
* add debug to component.json
* add `extends` support
0.9.2 / 2012-12-05

@@ -3,0 +10,0 @@ ==================

1

lib/plugins/mixin.js

@@ -13,2 +13,3 @@

module.exports = function(mixins) {
if (!mixins) throw new Error('mixins object required');
return function(style, rework){

@@ -15,0 +16,0 @@ style.rules.forEach(function(rule){

@@ -82,5 +82,6 @@

exports.media = require('./plugins/media');
exports.mixin = require('./plugins/mixin');
exports.mixin = exports.mixins = require('./plugins/mixin');
exports.prefix = require('./plugins/prefix');
exports.colors = require('./plugins/colors');
exports.extend = require('./plugins/extend');
exports.references = require('./plugins/references');

@@ -87,0 +88,0 @@ exports.prefixValue = require('./plugins/prefix-value');

{
"name": "rework",
"version": "0.9.2",
"version": "0.10.0",
"description": "CSS manipulations built on CSSOM",

@@ -13,3 +13,4 @@ "keywords": ["css", "manipulation", "preprocess", "transform"],

"commander": "1.0.4",
"color-parser": "0.0.1"
"color-parser": "0.0.1",
"debug": "*"
},

@@ -16,0 +17,0 @@ "devDependencies": {

@@ -85,3 +85,54 @@ # rework

- [mixin](#mixinobjects) — add custom property logic with mixing
- [extend](#extend) — add `extend: selector` support
### .extend()
Add support for extending existing rulesets:
```css
button {
padding: 5px 10px;
border: 1px solid #eee;
border-bottom-color: #ddd;
}
.green {
background: green;
padding: 10px 15px
}
a.join {
extend: button;
extend: .green;
}
a.button
input[type='submit'],
input[type='button'] {
extend: button
}
```
yields:
```css
button,
a.button,
input[type='submit'],
input[type='button'],
a.join {
padding: 5px 10px;
border: 1px solid #eee;
border-bottom-color: #ddd;
}
.green,
a.join {
background: green;
padding: 10px 15px
}
```
### .media(obj)

@@ -167,4 +218,6 @@

```css
logo {
background-image: url('/public/images/logo.png')
.logo {
background-image: url('component.png');
width: 289px;
height: 113px
}

@@ -176,4 +229,6 @@ ```

```css
logo {
background-image: url('/public/images/logo.png')
.logo {
background-image: url('component.png');
width: 289px;
height: 113px
}

@@ -183,3 +238,4 @@

.logo {
background-image: url("/public/images/logo@2x.png")
background-image: url("component@2x.png");
background-size: contain
}

@@ -186,0 +242,0 @@ }

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