Skip to content

feat(classname): add BlockClassNameFormatter and ElementClassNameForm…#637

Open
rrabmig wants to merge 2 commits into
bem:masterfrom
rrabmig:issue-636
Open

feat(classname): add BlockClassNameFormatter and ElementClassNameForm…#637
rrabmig wants to merge 2 commits into
bem:masterfrom
rrabmig:issue-636

Conversation

@rrabmig

@rrabmig rrabmig commented Jun 20, 2026

Copy link
Copy Markdown

Introduce two separate formatter types:

  • BlockClassNameFormatter returned by cn('block'), allows passing element name
  • ElementClassNameFormatter returned by cn('block', 'elem'), only accepts mods and mix

ClassNameInitilizer is now an overloaded interface that returns the correct type
based on the number of arguments.

closes #636

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@bem-react/classname: Unclear typing for element-bound class name formatters

1 participant