D
D
d3_dx2019-02-24 10:58:32
Sass
d3_dx, 2019-02-24 10:58:32

How to write the same properties for two pseudo-elements (SASS)?

For example, you need to set the same properties for the .box element and its two before and after pseudo-elements. How to write this concisely in SASS?
In css it would look something like this

.box,
.box::before,
.box::after {
  width:  100px;
  height: 100px;
  и т.д
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Flying, 2019-02-24
@d3_dx

.box {
    &::before, &::after {
        width: 100px;
        height: 100px;
    }
}

A
Arseny, 2019-02-24
Matytsyn @ArsenyMatytsyn

SASS is nothing more than a CSS extension. Everything works the same in it, but there are cool features, such as ghost classes. It has little to do with the request “briefly write down”, but “prescribe the same properties” is good for you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question