- From: Alexander Shpack <shadowkin@gmail.com>
- Date: Wed, 20 Jul 2011 10:11:38 +0300
- To: "Jens O. Meiert" <jens@meiert.com>
- Cc: www-style@w3.org
> 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 07:12:04 UTC