stylus / nib

Stylus mixins, utilities, components, and gradient image generation
http://stylus.github.io/nib
MIT License
1.91k stars 249 forks source link

Linear gradient with browser prefix #240

Closed yfr closed 10 years ago

yfr commented 10 years ago

I would like to use linear-gradients with just one browser prefix which i define in my stylus file. I don't want to vendorize. But not generally. This is an exeption. So basically when i write a linear-gradient with a browser prefix in my stylus file. I just want that one. When i write without browser prefix i want them to be added. And both versions (with predefined prefixes and with vendorized) in the same file.

Is this possible?

When i do this:

background: -webkit-linear-gradient(top, #07524b, #96353e)

i get this:

background:-webkit--webkit-linear-gradient(top, #07524b, #96353e);
background:-webkit--moz-linear-gradient(top, #07524b, #96353e);
background:-webkit--o-linear-gradient(top, #07524b, #96353e);
background:-webkit--ms-linear-gradient(top, #07524b, #96353e);
background:-webkit-linear-gradient(to bottom, #07524b, #96353e);

But i want this:

background:-webkit-linear-gradient(to bottom, #07524b, #96353e);
notslang commented 10 years ago

As a work-around, you could write that small part in CSS and wrap it in @css {}, the CSS Literal.

Other than that I'm not sure how you'd go about it. This is a pretty weird use case - could you explain why this particular gradient shouldn't be vendorized?

yfr commented 10 years ago

Ah CSS literal. Obviously! Thanks!

my usecase is a gradient on text. It's possible with webkit and -webkit-background-clip property like so:

article
      background: -webkit-linear-gradient(top, #07524b, #96353e)
      -webkit-background-clip: text
      -webkit-text-fill-color: transparent

And since this is only possible in webkit i only want address webkit with the prefixes. Every other browser could go with the normal text as fallback.

notslang commented 10 years ago

ah, makes sense

yfr commented 10 years ago

closing. Thanks again!