Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error compiling bootstrap.scss - Issue with _root.scss

I am getting an error when compiling my bootstrap sass file. The error looks like this below. When I comment out lines 4 and 8 of _root.scss it works, but that is not an ideal solution. What's going on? - I am running the latest version of Sass 3.5.3

Error: Invalid CSS after "...lor}: #{$value}": expected "{", was ";"
        on line 4 of /Users/.../bootstrap-4.0.0/scss/_root.scss
  ...

1: :root {
2:   // Custom variable values only support SassScript inside `#{}`.
3:   @each $color, $value in $colors {
4:     --#{$color}: #{$value};
5:   }
6: 
7:   @each $color, $value in $theme-colors {
8:     --#{$color}: #{$value};
9:   }
like image 426
janeh Avatar asked Dec 11 '17 03:12

janeh


People also ask

Can you use Bootstrap and SCSS together?

scss , you'll import Bootstrap's source Sass files. You have two options: include all of Bootstrap, or pick the parts you need. We encourage the latter, though be aware there are some requirements and dependencies across our components. You also will need to include some JavaScript for our plugins.

What is Bootstrap SCSS?

Bootstrap is an awesome CSS framework that can help you create stylish and sleek websites. Some developers and teams find that code written in Bootstrap is easier to maintain than regular CSS, so they prefer Bootstrap to vanilla CSS.


1 Answers

It looks like a bug in SASS compiler itself. Here you have very similar issues:

  • https://github.com/twbs/bootstrap/issues/24549

  • https://github.com/sass/sass/issues/2383

Try this:

1: :root {
2:   // Custom variable values only support SassScript inside `#{}`.
3:   @each $color, $value in $colors {
4:     --color-#{$color}: #{$value};
5:   }
6: 
7:   @each $color, $value in $theme-colors {
8:     --color-#{$color}: #{$value};
9:   }
like image 165
S1awek Avatar answered Oct 08 '22 18:10

S1awek