C
C
CoolStory2020-09-16 17:53:53
css
CoolStory, 2020-09-16 17:53:53

How should modifiers of different font sizes be named according to BEM?

There is a block. There is an element inside this block. Inside this element, there is text with multiple font sizes. So, what should the modifiers of these sizes be called?

block__title-text--large, block__title-text--medium and block__title-text--small are oversized titles. For example, the following font sizes are used in the text: 90px, 80px, 60px, 30px, 10px. Which of them are large, medium and small? And what should we call the other sizes then, without writing something like --super-mega-ultra-large for 90px and --super-mega-large for 80px?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
Nikita Mikhailov, 2020-09-16
@Psixodelik

For example, the following font sizes are used in the text: 90px, 80px, 60px, 30px, 10px.

IMHO the design needs to be revisited. Doesn't seem like a normal situation.
block_title-text--small

This will be the charm. If the value changes, then you don't have to run around and rewrite classes.
All the same, I advise you to find anchor points, and then get modifiers a la small-x2, medium, medium-x2 and so on

K
Kirill Makarov, 2020-09-17
@kirbi1996

And what prevents, for example, to create separate classes in the text.scss file, or whatever you use there, and write text-sm text-md and so on

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question