S
S
Stan_12016-03-18 09:58:53
Ruby on Rails
Stan_1, 2016-03-18 09:58:53

How to disable autoloading of _*.scss files?

Good morning!
Please tell me, in the Rails project, it turned out to be a convenient way for me to layout based on @include That is, such an option
base.scss
.class1 {
@include "c2";
}
_c2.scss
.class2 {
color: blakc;
}
My expectation is to form .class1 .class2 and it works. But! Rails autoloads the _c2.scss file, and the .class2 class begins to exist as the "root". How can I disable autoload for partishils? I didn't find anything useful on the Internet. :(
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
Clever_Coyote, 2016-03-18
@Clever_Coyote

It all sounds kind of crazy. The code that is described should not work at all. Mixins are connected with inclusions.
If the output should be .class1 .class2 :

// base.scss
.class1 {
  color: red;
} 

// layout.scss
.class1 {
   @extend .class1;

  .class2 {
     background: red;
  }
}

If @import was meant to be used, this should not be done, because class1 will contain everything that is declared in c2.scss

E
Evgeny Danilov, 2016-03-21
@jmelkor

If you disable the file, then your include will not work (because where does it get the data from?)
As you have already been told, use @mixin. The link you provided has examples.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question