I totally agree that we should try and keep things together instead of the madness of the way that JavaScript went in IE/Netscape etc. but remember all these prefixes -webkit-border-radius and -moz-border-radius are used in the meantime until the standards settle down, they only take the prefix off when it is standardised (and they will then follow the real border-radius property). This is so you can test the functionality while it is still fluid, the plan is not to have multiple implementations in the future all with similar names. The difference with the JavaScript comparison was that this was how things worked, there was no standardisation.
CSS3 for older versions of IE and cleaner CSS code is awesome-ness, though I don’t see myself using it on projects with larger style-sheets, but I believe it will be a great way to demo CSS3.
The spirit of this article is understood, but the examples let it down. Opera and WebKit browsers support border-radius without prefixes, and according to the spec; so you only need to specify:
I think prefixed properties are an important part of getting CSS implemented faster, and as long as it is well understood that they are subject to change then they can be used – sparingly – in many (but not all) production sites.
I echo the previous comments about the shadow and black border colour not showing up in Webkit browsers on OS X. I checked in Webkit nightly (6533.16, r60742) and Chrome (5.0.375.70).
While I do agree with part of this concept, I am hesitant to implement it as this is just one more piece of JavaScript for my page to rely on. At this point, I don’t write enough CSS3 in my sites to justify the use of eCSStender. I would rather write a few extra lines in my CSS and just remove them when CSS3 becomes more straight forward in browsers. It seems like we are just trading cleaner code for another file to rely on.
Kudos for the noble intentions, but I agree with a lot of the other comments above. We rely on javascript way too much as it is, I don’t think this is worth the extra page weight.
Like jquery, I think this is a great idea. However one huge question comes to mind… What if the end user has javascript disabled?
Sure, you can have a custom message that states you’ll have a better viewing experience if you have javascript turned on. But from a designer stand point, I’m looking at the type of end user that isn’t tech savvy enough to say “Ah, ok! Hey, now the site doesn’t look broken anymore!”
This is exactly what I’ve been looking for for ages; something that allows me to write code semantically without the annoying forking that I’ve been having to do. Going to take a little time out of my working day to look over the JS and see if it’s what I’m looking for.
Just a side note, there’s a typo on the second bit of code under the header “Using eCSStender” where you’re explaining that one could create a custom extension library – instead of saying <script> it says <scrip>. Feel free to delete this part of the comment when the typo is amended.
I was wondering if there was a way to make CSS3 work on all browsers. If flash can do it why couldn’t CSS?
Implementing this through Javascript is even better, the users don’t even have to install any plugin.
However the working example isn’t really… working. I’ll be checking the download link until I manage to get the libraries, I’ll test them in all major browsers including IE6 on Windows XP or Firefox on Ubuntu.
I’ll post the results here, that’s if I ever manage to download the scripts :)
As posted in the “eCSStender FAQ”:http://ecsstender.org/faq and in response to several comments:
As much as we’d love to say everyone should be using eCSStender, it’s just not practical in many instances. The following are a few reasons eCSStender may not be a good choice for you:
You use CSS3 selectors and properties sparingly (e.g. you only use border-radius in a handful of places and that’s it)
You don’t care about backward-compatibility (e.g. IE6 is a not-so-fond, but rather distant memory)
You aren’t looking to use the extensions to CSS that are available.
Reasons you may want to use eCSStender include:
You use CSS3 all over the place and need backwards compatibility with older browsers (e.g. you want your CSS transitions to work in IE6 so you don’t have to learn JavaScript).
You want to take advantage of cutting edge enhancements or proposed additions to the CSS language (e.g. OOCSS, CSS variables, etc.).
When it comes down to it, there’s a trade-off of file size and flexibility. eCSStender currently weighs in under 20K (before GZipping), but you also need to factor in the size of the extensions as well. It’s a small performance hit (especially if you munge the minified files together and serve them over a CDN), but it’s probably not going to balance out minimal use of advanced properties.
If you’re considering using eCSStender to get away from vendor-specific prefixes, we’d recommend taking your non-prefixed stylesheet and giving eCSStender a whirl on a dev server. You can, using a developer toolbar of some sort, copy out the content of the stylesheets it embeds in the document and add those rules to your CSS file, comment out eCSStender, and see if there’s a noticeable speed improvement.
If you’re having problems downloading, please try one of the methods mentioned on “this page”:http://ecsstender.org/documentation/downloading-ecsstender. If you still can’t get a copy, please drop a message on the mailing list to let me know what it is.
Copy & paste the code below to embed this comment.
combus
I liked the article, and thought it was a certainly a possible solution if combined with Modernizr. However, when I started to try it, the support for properties like border-radius and box-shadow is not consistent at all. And the point of the project is pretty much lost that way, at least in my opinion.
There’s been a ton of debate over the necessity of vendor prefixes, so I thought it worth mentioning that I don’t think vendor prefixes are inherently bad. They serve a very important purpose: allowing implementors (the browser makers) to develop their implementations to track an evolving spec while giving them the leeway to get things wrong during that process.
eCSStender is not an attempt to get rid of this necessary step in the process (in fact it fosters more people’s involvement in the development of experimental CSS). This library does, however, allow us to even things out the authoring side when it comes to these disparate implementations, leaving it to the extensions themselves to deal with the juggling act of serving the appropriate rules to the appropriate browser. From an author’s perspective (that’s you and me), having to write the same thing umpteen different ways (especially when it involves having to manually overcome incomplete or botched implementations) is an issue we shouldn’t have to deal with. That’s where eCSStender really helps: it makes it possible to write a single rule and leaves it to the extension to make it work everywhere.
So, in summary, I’m not against vendor prefixes as a tool, I just think we have enough other things to worry about that we should not have to constantly tweak our stylesheets as vendor-prefixed implementations change (which they do). JavaScript is great at doing mundane tasks like that.
Main problem: my Firefox freezes for 10 to 25 seconds when loading your website. Not a network/CDN issue.
Also: maybe you’re introducing “leaky abstractions” to prevent “forking”? ie, fixing the “CSS purity” problem with a tool that’s probably beyond the skillset of many a CSS coder if something goes wrong.
Using this to prototype CSS extensions sounds cool though.
I don’t see the point in the eCSStender, since it doesn’t seem to work: IE7, IE8 don’t show rounded corners, neither on the eCCStender-site, nore on the ALA-demo-site.
I’m been a bit perplexed at why you would want to use any of these hack CSS3 declarations in the first place. Right now too many browsers don’t support CSS3, and therefore you shouldn’t use them.
I can’t imagine telling a client that their site looks great in modern browers but the people that visit the website that use older browsers will get a less aesthetically pleasing site. Clients just don’t accept this and furthermore I don’t. Each user should be given the best experience possible no matter what browser they use (unless it’s something like ie 5).
I ensure my websites look great in all browsers and therefore at this time you have to use background images for rounded corners etc (sprite them if you wish).
So overall eCSStender is a great plugin despite it not working that well and is slow. But the problem they it is solving is one that shouldn’t even be used in the first place.
Copy & paste the code below to embed this comment.
atk
I mean, get serious! Most of the untidyness problems of those CSS forks are only of concern to the development. Therefore, the correct solution for this problem is not in the client, but in the deployment process.
So, what is really needed: a versatile filter framework for deployment of CSS, with the ability to expand those (and other) shorthands – and while we’re at it, to clean those comments you do not want the world to see, put multiple files together and minify the CSS if necessary. And btw, a JS version of such a framework would be useful, too.
If anyone was having issues with eCSStender in IE, there was a bug introduced in version 1.2.4 that has been fixed in version 1.2.5. Please visit http://test.ecsstender.org/ and post a message to the mailing list if you see any further errors.
Good concept but the eCSStender example page (Spoooon) looks very different in different browsers. It looks great in Safari and very good in Chrome (no drop shadows). There are drop shadows in Opera, but the action of the color boxes is not smooth. With Firefox, there are white letters against a blue square and no moving color boxes. IE 6 cuts off some letters, which are located in the upper left corner, with no color or moving boxes on hover.
Copy & paste the code below to embed this comment.
lewismc
I’m sorry, I appreciate the want by some to indulge in extending CSS, but aren’t what is referred to as hacks actually standards compliant vendor prefixes that will eventually dissappear once fully integrated to the specific browser that simply allow for the vendors (and experimental coders) to start testing these new additions to the CSS fold?
I just feel the hack comparison slightly misplaced, although I concede for the time being the code looks bloated, it is neither ‘forking’ or ‘hacking’.
I’m not sure it’s a good idea to hide away vendor prefixes. They are there precisely because some people want to use experimental CSS, like border-radius for example. WebKit and Firefox used different syntaxes precisely because the spec was still in flux, and they correctly used vendor prefixes as this was an experimental implementation. (Opera, by the way, has supported border-radius reliably since version 10, without any vendor prefix and using the final syntax.)
Other uses of vendor prefixes are for proprietary vendor extensions to CSS, such as gradients. Again, WebKit and Firefox have non-interoperable syntaxes so vendor prefixes are the only way to make sure that each gets the right rule.
Developers should use each vendor prefix in their code; I advise writing the declarations in alphabetical order (so moz, ms, o, then webkit) and finally having a declaration with no vendor prefix, for future browsers that support the final standard. Sure, there’s a risk that the standard might change but if you don’t use the non-prefixed version, you are guaranteed to lock out other browsers – in the same way that if your code doesn’t use plain border-radius, you guarantee that it will not work in IE9.
This is a developer’s responsibility. If you as a developer choose to use experimental, pre-standardised code on a production site, then you need to live with the consequennce of that choice.
I have read all 5 pages of comments and I think a little controversy is good. Let’s everyone know there is a viable issue at hand. Many good points. This banter reminds me of something else… the screen resolution debacle.
I was going to JS-Fork a website for North American audiences vs. “Global” audiences because I mistakenly believed that there needed to be smaller screen res for the Global community. Turns out that on average, it is the Americans using the highest % of 800×600. In that discussion, several “experts” stood firmly by the 760 for websites – in 2010! Others argued the fluid layout rule. Seems many people can’t maintain “enough” flexibility, combined with “enough” ingenuity, combined with enough “common sense” to render a real decision about the value of a given technology.
I love the “functional” arguments whose thrust seems to be educating others how this library will function case-specific for them. Function is an Applied Science, not a Pure one.
I think the library is a great idea which hits its mark and performs a valid service to the much sought after styling of the day. By the time there are standards for border-radius, the hype over rounded corners will be over, (I am using square and round alternating corners for a balanced, masculine/feminine appeal) and it will be left to a designer to express (semantically) what should be either function or fancy.
In the meantime, tools help take the bleed out of the cutting edge. Thanks, Aaron.
Any time you can move complex work to the server side, you’re going to get a speed improvement and we may add in some server-side components down the line (we’re certainly not ruling it out), but when most people ask this question, they’re weighing eCSStender against a CSS pre-processor like Sass or Less.
Putting aside the debate over whether alternate CSS syntaxes are better or easier to use, there are definite advantages to using a tool that can translate one syntax into another (as some extensions do), but when your solution is 100% back-end, it does not allow for nuance and interpretation, which is where eCSStender excels.
At the core of eCSStender’s power is the eCSStender.isSupported() method. This method allows a developer to test for property and/or selector support and then act upon their findings. Using this method, an extension can see that Safari 4 (and other Webkit-based browsers of its generation) doesn’t understand border radius shorthand with unequal radii (e.g. border-radius: 2px 4px;). If your preprocessor only knows to translate border-radius to -webkit-border-radius, -moz-border-radius, etc. and isn’t aware that it also needs to check the values and make further augmentations for Webkit, that’s a problem. And, if your preprocessor is pushing all of that extra markup over the wire, regardless of whether it’s useful to the browser, that too can become a problem.
Additionally, a pre-processor can’t leverage that nuance to implement JavaScript-based animations as an alternative to CSS-based ones if they aren’t supported because the pre-processors (as they are currently built) take a “one size fits all” approach to handling CSS: everyone gets the same thing. Then there’s also the fact that eCSStender can help you implement a new property or concept you’ve conceived and make it work in the browser in a much more robust way.
There are definite advantages to using a CSS pre-processor, but nuance and conditional translation/augmentation is what makes eCSStender different.
After reading the article, I was expecting some display consistency between browsers for the demo you provided. Is it not supposed to display correctly in IE? Maybe I completely missed the point?
Unfortunately, IE’s support for advanced things like rotation, gradients, etc. relies largely on the non-standard filter property in CSS and, like CSS shorthand, any time you set filter to a new value (which each extension currently tries to do) it supplants anything that was there before instead of adding it to a stack (which is what we really need to happen). We’re currently looking into this limitation and are working with the IE team to figure out the best overall approach to allow access to and manipulation of the filter stack (so we can enable animation of these properties, for instance).
It’s a bit much to wrap my head around at the moment, but I assure you it’s in the works. That said, most of the extensions out there work fine in IE. The only place you run into issues is where you have a combination of properties that need to write to filter being applied to the same element. That’s what’s happening in the case of the Spoon example.
Even though the idea sounds great, I think there is still a way to go. Because eCSStender is 18kbs now but all the weird css in the article has been exampled only takes 726bytes. If we multiply that with 10 bordered stuff in a webpage (who would do that?), that means 7kbs, which is still lighter than the eCSStender. I’d advice a jquery (or any other library) version of it or an implementation in jquery code as default which would be greater.
And an advice, I put these redundant CSS3 and CSS hack stuff in a seperate CSS (or seperate from all other ids’,classes) so when browsers update themselves and become CSS3 and W3 compliant, you can easily get rid of them.
Aaron, thanks for the explanations in comment 32. I can see that eCSStender could be overkill in some situations, while being very useful in others. It’s good to consider it on a case-by-case basis.
Regarding vendor prefixes, the following has been echoed many times:
when browsers update themselves and become CSS3 and W3 compliant, you can easily get rid of them
That will be true at some point, but depending on how far back you may need to support certain browser versions, you may have those prefixes in your stylesheets for some time. Just sayin’.
Copy & paste the code below to embed this comment.
Perkin5
I love the idea of ecsstender but I can’t get it to work in IE – specifically rounded corners or text-shadow. Works OK in webkit and mozilla. Should it work in IE or is that still under development?
Mostly web sides users: approx 70% with IE <= 8.
Even IE8 isn’t using CSS3. I’m testing some of my domains every few days and thing what’s happened with IE9? Or shell we get a other Firefox or Chrome or Safari …
What you’ve assembled is great. It does make for clean use of CSS3. However, I’m taking exception to the premise that you present it in—specifically losing the need to use conditional forks.
You are still forking, but you are using JS routines to sniff and detect browsers. A practice that you derided.
And what happens when JS is disabled? Yes, I know. I know. In this day and age, darn near every site on the web breaks horribly with JS disabled, but the fact is that people do still do it.
Have you considered doing what you do with JS, but doing it with a server-side language? Having it server-side would circumvent the client-side issue.
I’m not diminishing what you’ve done. I think it’s great. It certainly makes life easier, through use of a standard libraries that degrade gracefully. What I’m taking issue with is the context of “no more forking” that you present it in.
It won’t really be useful for us designers until we can guarantee that it will work on all browsers, our clients expect the site to look the same across all platforms and hence we cannot see this as a viable solution.
A shame because I would really love to use this, and it would really make our lives allot easier. :)
btw: you probably already know this but there are still issues with FF on your scripts homepage. :)
I agree with comment #56… it’s a great idea, but to me the beauty of CSS3 is that we can do a great deal of what used to be done with Javascript instead with CSS3. I can’t bring myself to use Javascript to cleanup my slightly messy CSS3, knowing that if someone were to visit my page without Javascript (think poor mobile phone support, people switching it off for security, etc.), they would not be able to see the shadows, animations, etc. that they might (depending on their browser) be able to see simply with pure CSS.
I’d also rather not keep patching up old browsers with Javascript… the more we do this (as developers), the more we’re doing to keep those browsers around. If the web was entirely broken in old versions of IE, would anyone continue to use it? And if they did, would they really care about how sites looked, given that so many would have rendering issues?
The idea (mentioned in prior comments in this thread) of a CSS pre-processor is a nice one though, it’d be great if something like this could be executed in that fashion (a bit like Sprockets?)
i’ve been super excited to try this, but im looking at the Spoon demo site and it’s not working correctly in anything i view it in:
-Chrome 6: animates and has rounded corners but no shadow
-Safari 4: rounded corners with shadows, but no animation
-FFox 3.6: no corners, no animation, no shadows
-IE8: no containing box at all, two small quote marks
Copy & paste the code below to embed this comment.
generalExpert
Well this still doesn’t work in FF. I’m on 3.6.12 / Linux and it’s a no go. Works great in Chrome/Linux though. I’m wondering… with this being such a large file compared to just a few extra lines in our CSS… Is it worth it? I’ve always thought that one of the main points of coding semantically was to reduce bandwidth. So, doesn’t this increase [it] greatly compared to a few extra (ugly) lines of code in our CSS? Am I missing something. Seems like a great tool but just not too sure about the size of the file?
I like this idea a lot and found a similar attempt by Lea Verou. But i have similar concerns.
1. Performance.
2. We are watching evolution of support over browsers like linear-gradient in chrome 10 How is that taken care?
61 Reader Comments
Back to the Articlecasquith
I totally agree that we should try and keep things together instead of the madness of the way that JavaScript went in IE/Netscape etc. but remember all these prefixes -webkit-border-radius and -moz-border-radius are used in the meantime until the standards settle down, they only take the prefix off when it is standardised (and they will then follow the real border-radius property). This is so you can test the functionality while it is still fluid, the plan is not to have multiple implementations in the future all with similar names. The difference with the JavaScript comparison was that this was how things worked, there was no standardisation.
askalot
CSS3 for older versions of IE and cleaner CSS code is awesome-ness, though I don’t see myself using it on projects with larger style-sheets, but I believe it will be a great way to demo CSS3.
Niels Matthijs
Really like the forking rant, completely justified if you ask me. I’m just not sure javascript is really the right way to go here.
Peter Gasston
The spirit of this article is understood, but the examples let it down. Opera and WebKit browsers support border-radius without prefixes, and according to the spec; so you only need to specify:
-moz-border-radius: 10px 5px;
border-radius: 10px 5px;
I think prefixed properties are an important part of getting CSS implemented faster, and as long as it is well understood that they are subject to change then they can be used – sparingly – in many (but not all) production sites.
John Faulds
I echo the previous comments about the shadow and black border colour not showing up in Webkit browsers on OS X. I checked in Webkit nightly (6533.16, r60742) and Chrome (5.0.375.70).
dreamtime214
While I do agree with part of this concept, I am hesitant to implement it as this is just one more piece of JavaScript for my page to rely on. At this point, I don’t write enough CSS3 in my sites to justify the use of eCSStender. I would rather write a few extra lines in my CSS and just remove them when CSS3 becomes more straight forward in browsers. It seems like we are just trading cleaner code for another file to rely on.
Tim-Wright
Kudos for the noble intentions, but I agree with a lot of the other comments above. We rely on javascript way too much as it is, I don’t think this is worth the extra page weight.
picklebob
I like the idea, but I can’t even get the examples included in the download to work.
jcgallaher
Like jquery, I think this is a great idea. However one huge question comes to mind… What if the end user has javascript disabled?
Sure, you can have a custom message that states you’ll have a better viewing experience if you have javascript turned on. But from a designer stand point, I’m looking at the type of end user that isn’t tech savvy enough to say “Ah, ok! Hey, now the site doesn’t look broken anymore!”
traxor
This is exactly what I’ve been looking for for ages; something that allows me to write code semantically without the annoying forking that I’ve been having to do. Going to take a little time out of my working day to look over the JS and see if it’s what I’m looking for.
Just a side note, there’s a typo on the second bit of code under the header “Using eCSStender” where you’re explaining that one could create a custom extension library – instead of saying <script> it says <scrip>. Feel free to delete this part of the comment when the typo is amended.
Radu.Tanasescu
I was wondering if there was a way to make CSS3 work on all browsers. If flash can do it why couldn’t CSS?
Implementing this through Javascript is even better, the users don’t even have to install any plugin.
However the working example isn’t really… working. I’ll be checking the download link until I manage to get the libraries, I’ll test them in all major browsers including IE6 on Windows XP or Firefox on Ubuntu.
I’ll post the results here, that’s if I ever manage to download the scripts :)
Aaron Gustafson
As posted in the “eCSStender FAQ”:http://ecsstender.org/faq and in response to several comments:
As much as we’d love to say everyone should be using eCSStender, it’s just not practical in many instances. The following are a few reasons eCSStender may not be a good choice for you:
Reasons you may want to use eCSStender include:
When it comes down to it, there’s a trade-off of file size and flexibility. eCSStender currently weighs in under 20K (before GZipping), but you also need to factor in the size of the extensions as well. It’s a small performance hit (especially if you munge the minified files together and serve them over a CDN), but it’s probably not going to balance out minimal use of advanced properties.
If you’re considering using eCSStender to get away from vendor-specific prefixes, we’d recommend taking your non-prefixed stylesheet and giving eCSStender a whirl on a dev server. You can, using a developer toolbar of some sort, copy out the content of the stylesheets it embeds in the document and add those rules to your CSS file, comment out eCSStender, and see if there’s a noticeable speed improvement.
Aaron Gustafson
If you’re having problems downloading, please try one of the methods mentioned on “this page”:http://ecsstender.org/documentation/downloading-ecsstender. If you still can’t get a copy, please drop a message on the mailing list to let me know what it is.
combus
I liked the article, and thought it was a certainly a possible solution if combined with Modernizr. However, when I started to try it, the support for properties like border-radius and box-shadow is not consistent at all. And the point of the project is pretty much lost that way, at least in my opinion.
Aaron Gustafson
There’s been a ton of debate over the necessity of vendor prefixes, so I thought it worth mentioning that I don’t think vendor prefixes are inherently bad. They serve a very important purpose: allowing implementors (the browser makers) to develop their implementations to track an evolving spec while giving them the leeway to get things wrong during that process.
eCSStender is not an attempt to get rid of this necessary step in the process (in fact it fosters more people’s involvement in the development of experimental CSS). This library does, however, allow us to even things out the authoring side when it comes to these disparate implementations, leaving it to the extensions themselves to deal with the juggling act of serving the appropriate rules to the appropriate browser. From an author’s perspective (that’s you and me), having to write the same thing umpteen different ways (especially when it involves having to manually overcome incomplete or botched implementations) is an issue we shouldn’t have to deal with. That’s where eCSStender really helps: it makes it possible to write a single rule and leaves it to the extension to make it work everywhere.
So, in summary, I’m not against vendor prefixes as a tool, I just think we have enough other things to worry about that we should not have to constantly tweak our stylesheets as vendor-prefixed implementations change (which they do). JavaScript is great at doing mundane tasks like that.
Manuel Razzari
Main problem: my Firefox freezes for 10 to 25 seconds when loading your website. Not a network/CDN issue.
Also: maybe you’re introducing “leaky abstractions” to prevent “forking”? ie, fixing the “CSS purity” problem with a tool that’s probably beyond the skillset of many a CSS coder if something goes wrong.
Using this to prototype CSS extensions sounds cool though.
rubaff
I don’t see the point in the eCSStender, since it doesn’t seem to work: IE7, IE8 don’t show rounded corners, neither on the eCCStender-site, nore on the ALA-demo-site.
Wattzy
I’m been a bit perplexed at why you would want to use any of these hack CSS3 declarations in the first place. Right now too many browsers don’t support CSS3, and therefore you shouldn’t use them.
I can’t imagine telling a client that their site looks great in modern browers but the people that visit the website that use older browsers will get a less aesthetically pleasing site. Clients just don’t accept this and furthermore I don’t. Each user should be given the best experience possible no matter what browser they use (unless it’s something like ie 5).
I ensure my websites look great in all browsers and therefore at this time you have to use background images for rounded corners etc (sprite them if you wish).
So overall eCSStender is a great plugin despite it not working that well and is slow. But the problem they it is solving is one that shouldn’t even be used in the first place.
atk
I mean, get serious! Most of the untidyness problems of those CSS forks are only of concern to the development. Therefore, the correct solution for this problem is not in the client, but in the deployment process.
So, what is really needed: a versatile filter framework for deployment of CSS, with the ability to expand those (and other) shorthands – and while we’re at it, to clean those comments you do not want the world to see, put multiple files together and minify the CSS if necessary. And btw, a JS version of such a framework would be useful, too.
Aaron Gustafson
If anyone was having issues with eCSStender in IE, there was a bug introduced in version 1.2.4 that has been fixed in version 1.2.5. Please visit http://test.ecsstender.org/ and post a message to the mailing list if you see any further errors.
Biff
Good concept but the eCSStender example page (Spoooon) looks very different in different browsers. It looks great in Safari and very good in Chrome (no drop shadows). There are drop shadows in Opera, but the action of the color boxes is not smooth. With Firefox, there are white letters against a blue square and no moving color boxes. IE 6 cuts off some letters, which are located in the upper left corner, with no color or moving boxes on hover.
lewismc
I’m sorry, I appreciate the want by some to indulge in extending CSS, but aren’t what is referred to as hacks actually standards compliant vendor prefixes that will eventually dissappear once fully integrated to the specific browser that simply allow for the vendors (and experimental coders) to start testing these new additions to the CSS fold?
I just feel the hack comparison slightly misplaced, although I concede for the time being the code looks bloated, it is neither ‘forking’ or ‘hacking’.
bruce-lawson
HI Aaron
I’m not sure it’s a good idea to hide away vendor prefixes. They are there precisely because some people want to use experimental CSS, like border-radius for example. WebKit and Firefox used different syntaxes precisely because the spec was still in flux, and they correctly used vendor prefixes as this was an experimental implementation. (Opera, by the way, has supported border-radius reliably since version 10, without any vendor prefix and using the final syntax.)
Other uses of vendor prefixes are for proprietary vendor extensions to CSS, such as gradients. Again, WebKit and Firefox have non-interoperable syntaxes so vendor prefixes are the only way to make sure that each gets the right rule.
Developers should use each vendor prefix in their code; I advise writing the declarations in alphabetical order (so
moz,ms,o, thenwebkit) and finally having a declaration with no vendor prefix, for future browsers that support the final standard. Sure, there’s a risk that the standard might change but if you don’t use the non-prefixed version, you are guaranteed to lock out other browsers – in the same way that if your code doesn’t use plain border-radius, you guarantee that it will not work in IE9.This is a developer’s responsibility. If you as a developer choose to use experimental, pre-standardised code on a production site, then you need to live with the consequennce of that choice.
bellasys
I have read all 5 pages of comments and I think a little controversy is good. Let’s everyone know there is a viable issue at hand. Many good points. This banter reminds me of something else… the screen resolution debacle.
I was going to JS-Fork a website for North American audiences vs. “Global” audiences because I mistakenly believed that there needed to be smaller screen res for the Global community. Turns out that on average, it is the Americans using the highest % of 800×600. In that discussion, several “experts” stood firmly by the 760 for websites – in 2010! Others argued the fluid layout rule. Seems many people can’t maintain “enough” flexibility, combined with “enough” ingenuity, combined with enough “common sense” to render a real decision about the value of a given technology.
I love the “functional” arguments whose thrust seems to be educating others how this library will function case-specific for them. Function is an Applied Science, not a Pure one.
I think the library is a great idea which hits its mark and performs a valid service to the much sought after styling of the day. By the time there are standards for border-radius, the hype over rounded corners will be over, (I am using square and round alternating corners for a balanced, masculine/feminine appeal) and it will be left to a designer to express (semantically) what should be either function or fancy.
In the meantime, tools help take the bleed out of the cutting edge. Thanks, Aaron.
Aaron Gustafson
Any time you can move complex work to the server side, you’re going to get a speed improvement and we may add in some server-side components down the line (we’re certainly not ruling it out), but when most people ask this question, they’re weighing eCSStender against a CSS pre-processor like Sass or Less.
Putting aside the debate over whether alternate CSS syntaxes are better or easier to use, there are definite advantages to using a tool that can translate one syntax into another (as some extensions do), but when your solution is 100% back-end, it does not allow for nuance and interpretation, which is where eCSStender excels.
At the core of eCSStender’s power is the
eCSStender.isSupported()method. This method allows a developer to test for property and/or selector support and then act upon their findings. Using this method, an extension can see that Safari 4 (and other Webkit-based browsers of its generation) doesn’t understand border radius shorthand with unequal radii (e.g.border-radius: 2px 4px;). If your preprocessor only knows to translateborder-radiusto-webkit-border-radius,-moz-border-radius, etc. and isn’t aware that it also needs to check the values and make further augmentations for Webkit, that’s a problem. And, if your preprocessor is pushing all of that extra markup over the wire, regardless of whether it’s useful to the browser, that too can become a problem.Additionally, a pre-processor can’t leverage that nuance to implement JavaScript-based animations as an alternative to CSS-based ones if they aren’t supported because the pre-processors (as they are currently built) take a “one size fits all” approach to handling CSS: everyone gets the same thing. Then there’s also the fact that eCSStender can help you implement a new property or concept you’ve conceived and make it work in the browser in a much more robust way.
There are definite advantages to using a CSS pre-processor, but nuance and conditional translation/augmentation is what makes eCSStender different.
Jacob North
I forgot Tick used to yell, “Spoooon!”.
Thank you
_rovo
After reading the article, I was expecting some display consistency between browsers for the demo you provided. Is it not supposed to display correctly in IE? Maybe I completely missed the point?
Demo provided
http://ecsstender.org/demos/spoon/
Aaron Gustafson
Unfortunately, IE’s support for advanced things like rotation, gradients, etc. relies largely on the non-standard
filterproperty in CSS and, like CSS shorthand, any time you setfilterto a new value (which each extension currently tries to do) it supplants anything that was there before instead of adding it to a stack (which is what we really need to happen). We’re currently looking into this limitation and are working with the IE team to figure out the best overall approach to allow access to and manipulation of the filter stack (so we can enable animation of these properties, for instance).It’s a bit much to wrap my head around at the moment, but I assure you it’s in the works. That said, most of the extensions out there work fine in IE. The only place you run into issues is where you have a combination of properties that need to write to
filterbeing applied to the same element. That’s what’s happening in the case of the Spoon example.suedejohnny
So to clean up the messy CSS with -webkit, -moz vendor specific properties, we add a Javascript? What good is that going to do?
mulsun
Even though the idea sounds great, I think there is still a way to go. Because eCSStender is 18kbs now but all the weird css in the article has been exampled only takes 726bytes. If we multiply that with 10 bordered stuff in a webpage (who would do that?), that means 7kbs, which is still lighter than the eCSStender. I’d advice a jquery (or any other library) version of it or an implementation in jquery code as default which would be greater.
And an advice, I put these redundant CSS3 and CSS hack stuff in a seperate CSS (or seperate from all other ids’,classes) so when browsers update themselves and become CSS3 and W3 compliant, you can easily get rid of them.
natewalton
Aaron, thanks for the explanations in comment 32. I can see that eCSStender could be overkill in some situations, while being very useful in others. It’s good to consider it on a case-by-case basis.
Aaron Gustafson
Regarding vendor prefixes, the following has been echoed many times:
That will be true at some point, but depending on how far back you may need to support certain browser versions, you may have those prefixes in your stylesheets for some time. Just sayin’.
suedejohnny
So to clean up our CSS we use JS instead of vendor-specific properties? I don’t get it. It’s a waste of time IMO.
Perkin5
I love the idea of ecsstender but I can’t get it to work in IE – specifically rounded corners or text-shadow. Works OK in webkit and mozilla. Should it work in IE or is that still under development?
Rolan Rozga
Mostly web sides users: approx 70% with IE <= 8.
Even IE8 isn’t using CSS3. I’m testing some of my domains every few days and thing what’s happened with IE9? Or shell we get a other Firefox or Chrome or Safari …
Annapolis Website Designer
What you’ve assembled is great. It does make for clean use of CSS3. However, I’m taking exception to the premise that you present it in—specifically losing the need to use conditional forks.
You are still forking, but you are using JS routines to sniff and detect browsers. A practice that you derided.
And what happens when JS is disabled? Yes, I know. I know. In this day and age, darn near every site on the web breaks horribly with JS disabled, but the fact is that people do still do it.
Have you considered doing what you do with JS, but doing it with a server-side language? Having it server-side would circumvent the client-side issue.
I’m not diminishing what you’ve done. I think it’s great. It certainly makes life easier, through use of a standard libraries that degrade gracefully. What I’m taking issue with is the context of “no more forking” that you present it in.
René Reinholdt
It won’t really be useful for us designers until we can guarantee that it will work on all browsers, our clients expect the site to look the same across all platforms and hence we cannot see this as a viable solution.
A shame because I would really love to use this, and it would really make our lives allot easier. :)
btw: you probably already know this but there are still issues with FF on your scripts homepage. :)
beemuse
I agree with comment #56… it’s a great idea, but to me the beauty of CSS3 is that we can do a great deal of what used to be done with Javascript instead with CSS3. I can’t bring myself to use Javascript to cleanup my slightly messy CSS3, knowing that if someone were to visit my page without Javascript (think poor mobile phone support, people switching it off for security, etc.), they would not be able to see the shadows, animations, etc. that they might (depending on their browser) be able to see simply with pure CSS.
I’d also rather not keep patching up old browsers with Javascript… the more we do this (as developers), the more we’re doing to keep those browsers around. If the web was entirely broken in old versions of IE, would anyone continue to use it? And if they did, would they really care about how sites looked, given that so many would have rendering issues?
The idea (mentioned in prior comments in this thread) of a CSS pre-processor is a nice one though, it’d be great if something like this could be executed in that fashion (a bit like Sprockets?)
mroncetwice
i’ve been super excited to try this, but im looking at the Spoon demo site and it’s not working correctly in anything i view it in:
-Chrome 6: animates and has rounded corners but no shadow
-Safari 4: rounded corners with shadows, but no animation
-FFox 3.6: no corners, no animation, no shadows
-IE8: no containing box at all, two small quote marks
generalExpert
Well this still doesn’t work in FF. I’m on 3.6.12 / Linux and it’s a no go. Works great in Chrome/Linux though. I’m wondering… with this being such a large file compared to just a few extra lines in our CSS… Is it worth it? I’ve always thought that one of the main points of coding semantically was to reduce bandwidth. So, doesn’t this increase [it] greatly compared to a few extra (ugly) lines of code in our CSS? Am I missing something. Seems like a great tool but just not too sure about the size of the file?
sushil.java@gmail.com
I like this idea a lot and found a similar attempt by Lea Verou. But i have similar concerns.
1. Performance.
2. We are watching evolution of support over browsers like linear-gradient in chrome 10 How is that taken care?