Re: [css3] Suggestion: Selector variables or “synonyms”

The ">" selector cover this special need, as far as I underdstand your 
problem.

Regards,
François

-----Message d'origine----- 
From: Alexander Shpack
Sent: Wednesday, July 20, 2011 9:11 AM
To: Jens O. Meiert
Cc: www-style@w3.org
Subject: Re: [css3] Suggestion: Selector variables or “synonyms”

> Out of curiosity, this code is inefficient and unmaintainable. Why
> should it be used to conclude anything around CSS?

98% of any HTML code generates by server side scripts, isn't?
This code is much faster than nested selectors like this

UL.menu LI { /* style */ }

BEM doesn't have any troubles with nested styles. In large projects
(not homepages, web-business-cards, little websites), this technique
make web-development cheaper.

Imagine, that you need to create two boxes: toolbox and  context menu

<ul class="toolbox">
<li>Tool 1</li>
<li>Tool 2</li>
<li>Tool 3</li>
</ul>

<ul class="contextMenu">
<li>Menu item 1</li>
<li>Menu item 2</li>
</ul>

Usual CSS code

.toolbox li { /* */ }
.contextMenu li { /* */ }

But, one time you will need to integrate context menu into toolbox.

<ul class="toolbox">
<li>Tool 1
   <ul class="contextMenu">
     <li>Menu item 1</li>
     <li>Menu item 2</li>
   </ul>
</li>
<li>Tool 2</li>
<li>Tool 3</li>
</ul>

But, it's not all, lets inverse this task, and put toolbox inside
context menu. And both cases should work fine.
So, happy coding! You will write tonnes of overlapping code.

-- 
s0rr0w 

Received on Wednesday, 20 July 2011 15:50:22 UTC