D
D
Dmitry Klimantovich2018-07-17 18:41:56
Sass
Dmitry Klimantovich, 2018-07-17 18:41:56

What is the best way to do inheritance for rare elements in Ruby Sass?

What is the best way to do inheritance for rare elements in Ruby Sass?
For example, for each .page__mainimgthere will be the same background properties (position, size, repaet), but the value of the url property will be different on the pages depending on the location in the block with the corresponding name.

.page {
  &__mainimg {
    @include background-image(center, cover, no-repeat);
    min-height: 500px;
  }
}
#main_page {
  .page__mainimg {
    background-image: url("/img/mainimg.jpg");
  }
}

How can this be written more compactly?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question