S
S
survivor20052019-05-31 21:33:42
Sass
survivor2005, 2019-05-31 21:33:42

Which is better extend or second class in html?

Good afternoon, I would like to understand what is better to use. They seem to say that when laying out, you need to use 2 classes, one for general styles, which can then be reused, and the second for a specific element. And you can also use @extend, and then you don’t have to write a second class for some elements where you need to apply the existing class. So I don’t understand whether to sculpt several classes everywhere, or try to use extend. In the first case, the code in css is reduced, in the second, the readability of html is improved.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2019-05-31
@sim3x

one for common styles that can then be reused
no
For this, do extend
The second and third class should be added if they dynamically change something in the default display of the element
If the class does not change, then it needs one class with a name that reflects its purpose
Use csso to post-optimize css

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question