Hello I am new to MicroFront End in React JS. I am trying to work on SCSS with MicroFront End in React JS. I have 2 files.
1: _variable.scss
2:style.scss
below is my code which I want to work in my application.
//_variable.scss
$base-color: #c6538c;
:export{
baseColor:$base-color;
}
//style.scss
@import url('_variable.scss');
body{
background: $base-color;
}
I am assigning a background value to Body of the application. but it is not working.
Any help would be Great.
Thank you.
2
Answers
If you take a look at this thread
You see that you don’t need to use the
url()
method, Try changing yourstyle.scss
file toActually, you don’t need to explicitly export your variable. So, what you can do is:
and:
Also be careful with importing:
if "style.scss" is in the same directory with "variable.scss" then you should import like this:
@import "./variable.scss"