Closed qfox closed 8 years ago
/cc @veged
@zxqfox
sure, it's real requirement and not something internal:
block('b1').elem('e1').content();
block('b1').mod('m1', 'v1').elem('e1').content();
block('b1').elem('e1').elemMod('m1', 'v1').content();
block('b1').mod('m1', 'v1').elem('e1').elemMod('m1', 'v1').content();
will all match different nodes.
You talking about XJST specific things. Let's rewrite it:
block('b1').elem('e1').content();
block('b1').mod('m1', 'v1').elem('e1').content();
block('b1').elem('e1').mod('m1', 'v1').content();
block('b1').mod('m1', 'v1').elem('e1').mod('m1', 'v1').content();
Still all the same (just mod
used instead of elemMod
inside elem
). It's a xjst trouble, not bemjson format itself.
@zxqfox
block('b1').mod('m1', 'v1').elem('e1').mod('m1', 'v1').content();
:(
@tadatuta Is it possible:
elemMod('v1', 'm1').mod('m1', 'v1').elem('e1').block('b1').content();
? Does somebody use it?
@zxqfox e.g.
elemMod('v1', 'm1')(
content()(),
mod('m1', 'v1').content()()
)
@tadatuta Satanic thing. What does it means?
set some content for b1__e1_v1_m1
when it's inside b1
without modifiers and something else for same element with the same modifier but in case it's inside b1_m1_v1
So it's semantically the same as:
block('b1')(
elem('e1).elemMod('v1', 'm1').content()(),
mod('m1', 'v1').elem('e1').elemMod('v1', 'm1').content()()
)
?
Don't see why we need separate elemMod
.
@tadatuta Oh, btw. It's a good example of usage ugly cascade in BEMHTML :smirk_cat:
@zxqfox it's absolutely the same example as
.my-block_state_active .my-block__elem
{
color: red;
}
@tadatuta Nope, actually. Your example is:
.block__elem_v1_m1 {
}
.block__elem_v1_m1 :inside?(.block_m1_v1) {
)
As @tadatuta said: It's made for consistency with template engines. I can say that I didn't see atm a real reason why these private template things exposed to end-user of
BEMJSON
format.I feel that a lot of tools now using this (at least
bem-xjst
). But is there real requirement to differentiatemods
withelemMods
?