S
S
Sergey Goryachev2016-04-13 15:29:39
css
Sergey Goryachev, 2016-04-13 15:29:39

To inherit or not to inherit properties in scss?

Using sass, the question arose, to inherit or not to inherit?

<div class="block">
   <div class="inner_block"></div>
</div>

Option 1:
.block {
   // свойства
   .inner_block {
      // свойства
   }
}

Or option 2:
.block {
   // свойства
}
.inner_block {
   // свойства
}

The question is about two blocks that are essentially unrelated to each other.
I don't mean the link inside the block.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Archakov Dennis, 2016-04-13
@webirus

For example, I inherit. Since it is not known whether you will have another such block, with the class

.inner_block
for other purposes. And in such cases, I inherit this class from the parent.

I
Igor Voronov, 2016-04-13
@ivoronov

Of course, I'm not hinting at anything, but ... "To use or not to use sass?".
And yes: perhaps we are talking about scss.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question