F
F
freeman02042017-03-23 20:28:32
css
freeman0204, 2017-03-23 20:28:32

What is the best way to modify a block in html(pug)/css(scss)?

There is a block with text and pictures for example. And you need to create the same one only with a different text color, a different image width and indents. What is the best way to do this so that the code is clean and understandable. No bam.
I have an option like this .c1.c2 - add elements with two classes c1 and c2 at the same time to the copy of the block (parent) one more class and in the modified styles already write 2 classes side by side and change the styles.
What do you suggest? The main thing is that the code is readable and clean.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Belyakov, 2017-03-23
@freeman0204

Try creating a base class. It will be set to all blocks, common properties will be stored there. Then create subclasses that will complement the base one and, if necessary, override the priority if there is layering. Although with proper logic this should not be. This is using pure html/css.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question