Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

added gradient support #12

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
2 participants

piatra commented Oct 14, 2012

Added gradient support for linear-gradient and radial-gradient

Owner

tj commented Oct 15, 2012

that's what the .prefixValue() plugin does

piatra commented Oct 15, 2012

That's what I get for not reading the documentation properly, sorry !

piatra commented Oct 15, 2012

Using
.use(rework.prefixValue('linear-gradient', ['-webkit-']))
on
background: linear-gradient(#aaa, #ddd);
returned
-webkit-background: -webkit-linear-gradient(#aaa, #ddd); background: linear-gradient(#aaa, #ddd)
It prefixed the background property as well. Is there something I'm doing wrong ?

Owner

tj commented Oct 15, 2012

hmm are you using any others?

piatra commented Oct 15, 2012

No. Here is my example

var rework = require('rework');
var read = require('fs').readFileSync;
var css = rework(read('example.css', 'utf8'))
  .use(rework.prefixValue('linear-gradient', ['-webkit-']))
  .toString();

console.log(css);
body {
    background: linear-gradient(#aaa, #ddd);
}
body {
  -webkit-background: -webkit-linear-gradient(#aaa, #ddd);
  background: linear-gradient(#aaa, #ddd)
}
Owner

tj commented Oct 15, 2012

oh damn, i guess that's a bit of a bug haha https://github.com/visionmedia/rework/blob/master/lib/plugins/prefix-value.js
i had it tailored for transform

piatra commented Oct 15, 2012

You should check out my pull req, and the example included. I did just that for gradients.

@tj tj closed this in 6bc9c49 Nov 29, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment