I agree swa, I looked over a few of my stylesheets and couldn't really write them easier or quicker, but they are one off, and usually as small as I can make them and still read them BUT I do not work in a team development environment so I'm not really up for too much templating apart from copy/paste snippets.
However I did find something which might help illustrate an example on behalf of the "for" side - SaSS actually tidied a
single line off one of my final CSS :o
Underlining that precompiling could have benefits when used
along with a knowledgeable dev person/team - So, if you actually know how to use grouped selectors and specificity, but
want the development sheets to remain grouped by their content area (which is my favourite way of organising a stylesheet anyway) for readability or you have to be because different teams work on different sections or sheets:
in a 'defaults' sheet you have :
p {color: #00f; background: #fff;}
p:hover {color: #000; background: #efefef;}
then in another sheet dealing with the main content area you have more specific styles..
#main {background: #efefef;}
#main p {color:#000; background: #efefef;}
A bit of a weird example perhaps, but I wanted to keep it as simple as possible (no variables/constants mixins or formula included) and not use links because of the other ways of getting specific with them
Now the obvious easy way to shorten, or remove the repetition (the DRY principle that programmers like ;)), for those of us who know how with CSS itself, and they are just two lines apart in this example ;) - is to group the selectors which have common property:value; pairs - like:
p {color: #00f; background: #fff;}
#main {background: #efefef;}
p:hover, #main p {color:#000; background: #efefef;}
BUT regardless of even if you know how - to do that you have to have to be in personal control of your stylesheet and also not care about keeping the stylesheet "pretty", all you've done is tidied it by one line, yes removing one repetition. In my case I would usually stick with repetition (and yes that's the line which Sass cleaned!) or I have to break my nicely specifically sectioned bits AND if they were actually in two different sheets which were in the control of different dev depts in an organisation, they might have no choice but to stick with the repetition as they may not have access to the default sheet to get them grouped.
With compilers and the extensions they offer, both me and the devs are going to be happy, I can "section" my one already fairly tidy sheet and now use as many comments as I like - the dev teams too can keep their repeated directive in the two different sheets while developing, again with however many reference notes and reasons they need to - because for both of us - the sheet or sheets can then be COMPILED into the grouped selector version, into one single, compressed sheet, without comments, for production
That's the positive side for developers and workflow, the original precompiled versions might not, probably won't be, very much shorter than what we know the final result will be - it doesn't matter, the end sheet will be perfect, ONE, small compressed CSS from as many sources as it takes - everyone wins
so that's where this is interesting and time/bandwidth/http request saving (eventually after the training/learning of best practices in the first place!). I will repeat that although I'm excited about this sort of technology I still agree with the article swa linked in post #2
- this functionality DOES NOT belong in CSS itself, it is a tool, a means to an end, the end being a perfectly formed CSS doing no more than CSS is capable of doing in the first place.. you have to know CSS in order to get the best out of a precompiler in the first place. hence I'm sure it will, does have it's place in applications - so if Google wants to introduce it in their browser for those reasons so be it
Variables (or "symbolic constants" for those that prefer their proper name ;)) in CSS itself would just be the start of a decline into muddying the different technolgies
----
btw to do the above example in Sass btw you would use @extend
p {color: #00f; background: #fff;}
p:hover {color: #000; background: #efefef;}
#main {background: #efefef;}
// you can put as many hidden notes as you like to refer to where the original is if you like
#main p {
@extend p:hover
}
it will come out looking like we know it should honest, actually it comes out like this..
p {color: #00f; background: #fff;}
p:hover, #main p {color:#000; background: #efefef;}
#main {background: #efefef;}
While I am interested in the technology, I'm not happy with some of the marketing or conference speeches I've seen regarding it, the mud-slinging or name calling is not helping your cause. This technology is exciting, it will be abused and will produce unnecessarily complicated ways of doing what is already possible until it or its users settle down to the realisation that it can't do any more than output CSS that will function exactly the way it functions at this time. precompiler functions, mixins, plugins, extensions etc only help you achieve a final CSS output - they do not increase its supported abilities.