maximkoretskiy / postcss-initial

PostCSS plugin to fallback initial keyword
MIT License
187 stars 11 forks source link

Color property fallback #15

Closed dzhiriki closed 8 years ago

dzhiriki commented 8 years ago

Why fallback for color: initial is a color: inherit? It's gave different result. Example Initial is a browser default color. Does it has to be black?

Nitive commented 8 years ago

font-family and text-align inherit too. Should it be sans-serif and left?

sylvainbaronnet commented 8 years ago

color, font-family and text-align are inherited by default so I think inherit is the right fallback

maximkoretskiy commented 8 years ago

You are right. I will check all inherit props and create fix after some experiments.

maximkoretskiy commented 8 years ago

Hi, guys. Sorry for long response. After some experiments, I'm sure that we can replace all inherit values with something more specific.

Here is current changeset. https://gist.github.com/maximkoretskiy/8b2ede7f06cfdb7a78c0

The only thing we can't fix without any doubt is text-align. It depends on browser default text direction. There is a modern way to set universal initial value for text-align: text-align: start. But it doesn't work in old browsers.

Have U any idea for this case?

maximkoretskiy commented 8 years ago

@ai We need your advice

ai commented 8 years ago

I think color: inherit is a bad thing. All inherited styles should be declared explicit:

all: inital;
font: inherit;
Nitive commented 8 years ago

direction is already reseted to ltr so I think text-align: left is right fallback.

maximkoretskiy commented 8 years ago

Just published new release.