Creating a scss variable in config.rb for scss files

How to define the SCSS variable in the Config.rb file for the SCSS file [COMPASS project]

My use case

In the Config.rb file, something like

a = true

In style.scss, I like to use a type variable

@if a == true{
     background: #fff;
} 
@else {
   background: #000;
}

One solution is http://worldhousefinder.com/?p=124141

But that did not work for me.

+1
source share
2 answers

/ . , . config.rb, , , , , sass.

.active .inactive (). css , .. , .

? , , , ? - :

<body class='<%= "development" if Rails.env == 'development' %>'>

<body <%= "style='background-color: red;'" if Rails.env == 'development' %>

ruby ​​ CSS javascript, , , , , . , , .

p.s. - .. javascript

+1

, variables mixins?

SASS, , CSS. ( Haml), - .

( , ):

, . , Sass::Plugin.force_update_stylesheets.

0

Source: https://habr.com/ru/post/1755793/


All Articles