Closed AliMD closed 10 years ago
but rgba has support for transparency... hex does not... how would we add full backwards compatibility?
Not need to full compatibly
Just 2 color for old browser support ! its better no color
Normally stylus convert hsl to hex and hsla to rgba, great but i want to fix this warning
http://csslint.net/ for IE6,IE7,IE8
Fallback color (hex or RGB) should precede RGBA color.
I'm not entirely sure that nib should add a hex fallback when using rgba because, often, that transparency is important and might not look right without it. Also, there's no way for us to determine what the correct color should be... it would probably be color_of_the_element * opacity_of_the_color + background_color * (1 - opacity_of_the_color)
... or something like that... but we can't tell from just the css what the background color will be... also that would only work for the color of the element... using rgba in the background color would be even harder to determine.
Adding a fallback like this that isn't fully (or at least mostly) backwards-compatible would cause issues in places where custom fallbacks are really needed. Also, it would add a lot of bloat to the css since rgba can be used anywhere that hex can. And with 87.27% browser support for rgba
, I don't think it's worth it... unless you know of a good solution.
just add a function for color and background-color to write double color for every transparent color. or guide me to add it to my own. thank you.
@visionmedia could you please check this issue.
TJ is very busy because he manages like 300 open source projects (which is why I'm managing nib for him)... so I wouldn't expect him to have time to reply here.
As for writing your own mixin, Stylus provides docs here: http://learnboost.github.io/stylus/docs/mixins.html ... Imma close this since adding partial backwards compatibility for something like this is likely to cause issues... If you can think of a better solution, feel free to reopen.
@slang800 i don't know why you don't understand me !
nib try to fix all css issue in all browser i need to fix this issue too
i want to write this
p
color hlsa(...)
and nib convert it to this
p {
color #...;
color rgba(...);
}
if you agree with me i can sent a pull request
If you can think of a better solution, feel free to reopen.
i cant reopen this !
I'm managing nib for him
I did not know this, i think you don't know why TJ make nib ! so sorry
I understand what you want to do, but I don't understand why.
Adding a fallback like this that isn't fully (or at least mostly) backwards-compatible would cause issues in places where custom fallbacks are really needed. Also, it would add a lot of bloat to the css since rgba can be used anywhere that hex can. And with 87.27% browser support for rgba, I don't think it's worth it... unless you know of a better solution.
As for why TJ made nib, it is to make prefixing and other redundant parts of CSS easier. But nib is not supposed to make assumptions about whether or not a different color (one without transparency) would be a suitable fallback for one that has transparency.
If you would like to implement this on your own, then go right ahead and fork nib... you can make whatever you want. However, I don't think a partial fallback like this belongs in nib.
Ok This is only a feature request.
But i don't agree with you
I don't understand why
And i don't understand why not
If you are using rgba
for example for background-color
you don't have any color in background in 12.73% of browsers.
we don't want to have alpha fallback just fallback for backcolor.
Thank you anyway
I usually use hsla for my colors, and it not work in old browser. I request to add backward compatibility like this