5 ms·
I know, i am using transitions/gradients on my project and i have to write 5(!) different rules just to set one property. This is for production code. backgr
by Achshar 14y ago
I know, i am using transitions/gradients on my project and i have to write 5(!) different rules just to set one property. This is for production code.
background: -webkit-linear-gradient(#fff, #fdd 75%, #fcc);
background: -moz-linear-gradient(#fff, #fdd 75%, #fcc);
background: -ms-linear-gradient(#fff, #fdd 75%, #fcc);
background: -o-linear-gradient(#fff, #fdd 75%, #fcc);
background: linear-gradient(#fff, #fdd 75%, #fcc);
And this is used every time i have to set a gradient. I really wish there were some better options than prefixes. I am not surprised at all if developers move to supporting just webkit. This is a lot of work and maintaining. And without css variables, it is a mess to change a color. It is very tempting to just use the -webkit- version and probably a non prefixed one for future compatibility. 2 is far better than 5.
Edit: And i should mention, this is not a mobile website, it's a desktop site.
- TazeTSchnitzel 14y agoYeah. And that's without supporting older versions of syntax. You might need another 2 or 3 lines if you're unlucky, or possibly worse. Many people including myself think prefixes should be eliminated entirely[1], or replaced with a single prefix for the experimental[2]. [1] http://paulirish.com/2012/vendor-prefixes-are-not-developer-friendly/ http://paulirish.com/2012/vendor-prefixes-are-not-developer-... [2] http://www.quirksmode.org/blog/archives/2010/03/css_vendor_pref_1.html http://www.quirksmode.org/blog/archives/2010/03/css_vendor_p...
- ars 14y agoMissed one: background: -webkit-gradient(linear, 0 0, 0 100%, from(#fff) color-stop(75%, #fdd) to(#fcc)); (I hope I got that syntax right.) This one should go above webkit-linear-gradient. And it's also an example of why prefixes were invented - the syntax is totally different. I think vendors should unprefix the moment their prefix matches the spec.
- cleverjake 14y ago>>I think vendors should unprefix the moment their prefix matches the spec. most of the time when all prefixed version are the same it means there isn't a CR for the spec, and it is therefore in flux. unprefixing it would mean sites would break if and when it is changed before reaching recommendation.
- ars 14y agoDon't know what "CR" is (community recommendation?), but obviously I mean once the spec is finalized, not just when the spec is proposed.
- robin_reala 14y agoCandidate Recommendation; the state of a W3 recommendation where they call for vendor implementations.
- cleverjake 14y agoand as I said, this is not the case for most things that are prefixed.
- TazeTSchnitzel 14y agoThey would break anyway, what's your point?
- Natsu 14y agoWhy not uses SASS and let mixins do that crap?
- Achshar 14y agoIt's probably just me but I don't use libraries and secondary "languages" that compile to another language (in web development context). So no jquery, coffeescript, SASS, LESS, pIE etc. I don't feel satisfied when my code's efficiency/speed depends on some one else's code. It somehow means i am not in full control of things. I like to keep dependencies to a minimum. Which basically means I don't want to include any files in my webpage that are not written by me. (Google Analytics is an exception though) It's kind of an obsession really, to the point that I furiously try not to use any third party library unless absolutely needed. And I haven't needed one until now. And I have also yet to regret these decisions.
- TazeTSchnitzel 14y agoI use CoffeeScript, but I'm reluctant to use SASS or LESS, since they are ugly and I generally want to avoid having to use software to manipulate my HTML/CSS content. I'm fine with JS, but I like my compile script only having to copy my index.html and style.css file across, not having to invoke a CSS compiler.
- Achshar 14y agoThe CSS compilers really dont make much sense to me. The language is very easy/simple as is (vendor prefixes are a mess though) and having a compiler's overhead on every request does not feel right to me. I love JS though, in fact it's my favorite go to language for all kinds of work, heavy duty or light. I thinks that is also a part of the reason I am not inclined towards languages that compile to JS, they kind of destroy the experience of writing JS, which I am very fond of.
- TazeTSchnitzel 14y agoWhat request overhead? I thought people used them when developing and pushed the compiled result to the server. And I love JS too, but I use CoffeeScript since it's basically syntactic sugar for JS that saves me some keystrokes and makes my code more readable.
- tomjen3 14y agoWhy include the MS prefix? the only browser that support is not yet in production and will presumably unprefix it before it ships.
- Achshar 14y agoThe project i am working on needs IE support, and i won't be making big changes to code once it has been deployed. It's a contract based work and not employment. So if it is not unprefixed by august, i will still have support for the browser.
- tomjen3 14y agoNot really, unless you only contracted to support IE 10. There is a proprietary filter property that works on previous versions IE.
- zobzu 14y ago"I am not surprised at all if developers move to supporting just webkit." that's why Mozilla is unprefixing IMO. But yep, so much for standards.
- erikb 14y agoYour comment actually explains to me, what I didn't know without CSS experience: What this post is actually about.
- cpeterso 14y agoDoes WebKit implement unprefixed property names alongside -webkit- prefixed names?
- Achshar 14y agoFor some properties, it does, for others, not yet. It just depends on how stable the spec it.
- Karunamon 14y agoLooks like this is begging for a macro. Write it once, highlight, ctrl+something, the other specific versions are automatically created in place.
- neotek 14y agoI recently switched to Sublime Text[1] as my editor of choice, and one of the available packages is a macro that runs CSS blocks through prefixr[2]. It's been an absolute godsend (and Sublime Text in general is ... sublime.) [1] http://www.sublimetext.com/ http://www.sublimetext.com/ [2] http://prefixr.com/ http://prefixr.com/