Biorąc pod uwagę następujące BEM struktura drzewa, gdzie istnieje pięć zagnieżdżone poziomy:Jak prawidłowo ustawić zakres elementu za pomocą BEM?
collection-main__features-top__story__byline__author
według Bema konwencji nazewnictwa, gdzie element jest częścią bloku i nie ma znaczenia poza blokiem należy, co jest właściwy sposób na nazwę klasy author
?
Ponieważ w author
jest semantycznie związane z byline
i kontekstu story
, ale bez znaczenia pod features-top
i collection-main
bloków, jaka jest najlepsza nazwa BEM?
collection-main__author
features-top__author
story__author (best?)
story__byline__author
byline__author
Co się stanie, jeżeli nowy blok zostanie wprowadzony features
?
collection-main__features-top__story__byline__author (target)
collection-main__features-bottom__story__byline__author
features-top__story__author
story--features-top__author (best?)
Wreszcie, co się stanie, jeśli inny collection
blok zostanie dodana i chcemy projektować drugi element autor w liście?
collection-main__features-top__story__byline__author
collection-main__features-bottom__story__byline__author (target)
collection-sub__features-top__story__byline__author
collection-sub__features-bottom__story__byline__author
Czy zrobilibyśmy coś takiego?
story--collection-main--features-bottom__author
Musi być lepsza opcja.
Pokaż swoje dane wyjściowe. Czy to jest jak '{collection-main: [{" feature-item ": {story: {author: '}}}}]}? –