You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That way we don’t need to add all the browser-specific prefixes manually in the CSS. Especially because we will always forget some, they might deprecate soon, and it makes the code messy.
Less or Compass or Sass (I don’t care) don’t solve the original problem because they just push all the prefixes in the files, which is 5 times as much as would normally be there for lots of selectors. prefixfree on the other hand checks what is needed and just appends those prefixes.
Also, these CSS preprocessors add a syntax everyone needs to learn and a compilation step. I honestly find them really annoying.
On a related note, from the prefixfree FAQ:
»"Something like this belongs to the server-side"
A server side script would need to add all prefixes, making the size of the CSS file considerably larger. Also, it should maintain a list of features that need prefixes, or add them all and unnecessarily bloat the stylesheet. -prefix-free automatically detects what needs a prefix and what doesn’t.«
Technically, you could also check on server side which browser is used by checking the user agent (though it's not failsafe in case the value is modified by the user).
Yes, but that will a) make it slow and b) be sniffing. There’s no reason to check the client on the server side if you can do it client-side, especially when there’s already a library which does what we need.
You can cache on the server side, but not on the client. So from a performance perspective, I see problems rather on client side. I agree with b). The answer in the FAQ is just not 100% correct.
You would need to cache client-specific stylesheets on the server-side. Then take a round trip to the server to return the correct one.
And of course you can cache on the client-side – and it makes way more sense when it’s client-specific like here. The browser does it automatically sometimes, and we should start to use AppCache anyway.
I thought about this more and, at least in core, there are not that many prefixes used. Only ~20 occurences. I don’t think this warrants adding another library, dependency and increase in load time. Most prefixes for the common stuff we use will be possible to phase out soon anyway.
Activity
blizzz commentedon Nov 1, 2012
I see that it eases development, but on the other side JS+CSS manipulation sounds like another performance slowdown.
LukasReschke commentedon Nov 1, 2012
OT: http://caniuse.com/ is a nice website to check which prefixes you can safely drop.
DeepDiver1975 commentedon Nov 1, 2012
Can lesscss.org help us out here?
(From the Rails world I know http://thoughtbot.github.com/bourbon/ and http://sass-lang.com/)
SASS and LESSCSS can be "compiled" to the real css and no js on client side is necessary (but also possible)
The necessary compilation step increases development and deployment overhead. (CI could help a bit - but still)
LukasReschke commentedon Nov 1, 2012
Yes. But personally I prefer Compass:
becomes:
jancborchardt commentedon Nov 1, 2012
Less or Compass or Sass (I don’t care) don’t solve the original problem because they just push all the prefixes in the files, which is 5 times as much as would normally be there for lots of selectors. prefixfree on the other hand checks what is needed and just appends those prefixes.
Also, these CSS preprocessors add a syntax everyone needs to learn and a compilation step. I honestly find them really annoying.
On a related note, from the prefixfree FAQ:
»"Something like this belongs to the server-side"
A server side script would need to add all prefixes, making the size of the CSS file considerably larger. Also, it should maintain a list of features that need prefixes, or add them all and unnecessarily bloat the stylesheet. -prefix-free automatically detects what needs a prefix and what doesn’t.«
blizzz commentedon Nov 2, 2012
Technically, you could also check on server side which browser is used by checking the user agent (though it's not failsafe in case the value is modified by the user).
jancborchardt commentedon Nov 2, 2012
Yes, but that will a) make it slow and b) be sniffing. There’s no reason to check the client on the server side if you can do it client-side, especially when there’s already a library which does what we need.
blizzz commentedon Nov 2, 2012
You can cache on the server side, but not on the client. So from a performance perspective, I see problems rather on client side. I agree with b). The answer in the FAQ is just not 100% correct.
jancborchardt commentedon Nov 2, 2012
You would need to cache client-specific stylesheets on the server-side. Then take a round trip to the server to return the correct one.
And of course you can cache on the client-side – and it makes way more sense when it’s client-specific like here. The browser does it automatically sometimes, and we should start to use AppCache anyway.
raghunayyar commentedon Jan 27, 2013
@jancborchardt are we finally including prefixfree? Should I make a PR for the same?
jancborchardt commentedon Jan 28, 2013
I thought about this more and, at least in core, there are not that many prefixes used. Only ~20 occurences. I don’t think this warrants adding another library, dependency and increase in load time. Most prefixes for the common stuff we use will be possible to phase out soon anyway.