bem / bem/bem-components

Custom mods in components

Open
#1,687 10 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
330
Forks
88
PR merge metrics
No merged PRs in 30d

Description

Сейчас есть такая проблема, что модификаторы и атрибуты прокидываются только те, что описаны в шаблоне. Например [тут](https://github.com/bem/bem-components/blob/v2/common.blocks/radio-group/radio-group.bemhtml#L20), [тут](https://github.com/bem/bem-components/blob/v2/common.blocks/checkbox/checkbox.bemhtml#L15) или тоже самое с атрибтами [тут](https://github.com/bem/bem-components/blob/v2/common.blocks/input/__control/input__control.bemhtml#L6). Это приводит к огромным проблемам при расширении компонент сверху. Чтобы добавить хотя бы один модификатор или атрибут приходится полностью копировать шаблон компонента, что приводит к необходимости следить за тем, что с этим шаблоном в компонентах, дабы не сломалось чего. Так задумано и ничего не поделать или можно подумать над тем как бы разрешить прокидывание модификаторов?

Contributor guide

Open the contributing guide

Research direction

Start by comparing the BEMHTML templates linked in radio-group/radio-group.bemhtml, checkbox/checkbox.bemhtml, and input/__control/input__control.bemhtml. Trace how modifiers and attributes are selected and passed through, then review the component extension behavior. Done means the supported approach for forwarding custom modifiers or attributes is documented or implemented without copying the entire component template.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.