search

Home  >  Q&A  >  body text

SCSS/SASS not working in micro frontend using React

Hi, I am new to MicroFront End in React JS. I'm trying to use MicroFront End in React JS to handle SCSS. I have 2 files.

1:_variable.scss 2: style.scss

Below is the code I want to use 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 the body of the application. But it doesn't work.

Any help would be great.

Thanks.

P粉106301763P粉106301763436 days ago629

reply all(1)I'll reply

  • P粉701491897

    P粉7014918972023-09-17 15:01:09

    If you look at this post , you will see that you don't need to use the url() method. Try changing your style.scss file to:

    @import '_variable';
    
    body {
        background: $base-color;
    }

    reply
    0
  • Cancelreply