- From: Alexander Shpack <shadowkin@gmail.com>
- Date: Wed, 20 Jul 2011 01:03:48 +0300
- To: "Tab Atkins Jr." <jackalmage@gmail.com>
- Cc: "Jens O. Meiert" <jens@meiert.com>, www-style@w3.org
>
> I think that selector variables are a possible solution to the larger
> problem of making it easier to reuse blocks of CSS.
I disagree. Russian search engine Yandex using one interesting
technique: BEM (Block, Element, Modifier)
Personally, we use in our projects something similar. This is very
simple technique.
<ul class="b-menu b-menu_size_small">
<li class="b-menu__item b-menu__item_state_current">Index</li>
<li class="b-menu__item"><a href="news.html">News</a></li>
<li class="b-menu__item"><a href="about.html">About</a></li>
</ul>
b-menu is general class for semantic definition of block
b-menu_size_small is modifier, that make text of this block smaller
b-menu__item is element of b-menu
Every style rule is simple and dumb.
This is very useful technique, approved they effectiveness on really
large web-projects. Reusing of CSS blocks is high, and it possible
without any CSS variables.
--
s0rr0w
Received on Tuesday, 19 July 2011 22:04:25 UTC