rails / sass-rails

Ruby on Rails stylesheet engine for Sass

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@import behaves in different ways in Rails 4.2 and Rails 5.0

oslyak opened this issue · comments

I have project on Rails 4.2 with sass-rails 5.0.4 and there everything works fine.
Now created new project on Rails 5.0 with sass-rails 5.0.5 and copied all SASS(scss) file from old project to new one.

In both project uses sass 3.4.22

I have general.scss

@import 'css3-mixin';
@import 'color';
@import 'class';
@import 'style';

In Rails 5 got error in style.scss:

Undefined variable: "$grey"

So, style.scss does not see variables from _color.scss if it imported in general.scss
It works only when write import right in style.scss
But except style.scss I have many other files, which uses colors and mixins.
In Rails 5 it works, only when I added import in everyone *.scss files which use colors and mixins.

So, whats happened with global namespace for variables and mixins?

how did you fix this @oslyak ?

Excuse me, How did you fixed it? @oslyak

commented

Anyone knows how this was fixed? I am getting this as well and using the following versions -

Rails 5.2.0
sass-rails 5.0.7