Re: CSS Mixins proposal

On 22/03/2011 6:55 AM, Tab Atkins Jr. wrote:
[snip]
Mixins are used in, for example, SASS
> <http://sass-lang.com/tutorial.html#mixins>.
>
> (Why can't you just add a class to these elements and put the
> "reusable" CSS in a ruleset targetting that class?  While this
> strategy does the job, it requires you to alter your HTML and sprinkle
> otherwise-meaningless classes around your page.  If you want to change
> what elements receive the special CSS, you have to change your
> document, which is an anti-pattern that CSS and Selectors were
> supposed to solve.


The last time I looked, all recent implementations supported attribute 
and structural selectors and negation. I may have cause some ire in 
recommending reducing 'classes' and 'id' in HTML and adopting these very 
powerful selectors. I have basically advocated simple coding methods [1].

You recent proposals are suggesting changes to CSS core grammar that has 
been there since the introduction of CSS in the 1990s and these changes 
actually makes CSS more complicated for the average author. I also think 
introducing CSS that IE7 can trip over is very wrong. Additions to CSS 
should not cause IE7 (which came out only in 2006) to choke. I thought 
my reply to you about this issue [1] had some merits.


Look at this.

@trait bar($one, $two) {
   prop: $one;
   prop: $two;
}


I rejected your proposal regarding variables because they behaved like 
other @rules ending with and a semicolon. I look at the above syntax and 
I seeing declaration blocks in between curly braces {...}. I do not 
support your syntax since it move away from core grammar.


1. <http://css-class.com/test/zeta.htm>
2. <http://lists.w3.org/Archives/Public/www-style/2011Feb/0344.html>



-- 
Alan http://css-class.com/

Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo

Received on Tuesday, 22 March 2011 03:07:06 UTC