Error for invalid css when trying to compile sass

后端 未结 2 2023
野的像风
野的像风 2021-01-14 10:23

I am new to sass, after having downloaded bulma, installed gem, and sass, I tried to compile a default sass file with sass style.scss style.css, here is my dire

相关标签:
2条回答
  • 2021-01-14 11:00

    Try terminating the line by a semi-colon (;)

    For example -

    $font-stack:    Helvetica, sans-serif;
    $primary-color: #333;
    
    0 讨论(0)
  • 2021-01-14 11:17

    You're compiling a real Sass file, with the Sass indented syntax (no braces, no semi-colon, indentation alone is sufficient).
    But the extension of your file is *.scss, meant for CSS-like syntax (there's a c, see ^^)

    Either rename your file to styles.sass with an a or write your styles as you'd write CSS (but with nested rules, variables, etc provided by this preprocessor :) )

    Sass the compiler compiles both Sass indented syntax and Scss one, which is not straightforward...

    EDIT: try to compile a plain CSS file (no variable, no mixin, no nesting just CSS) renamed to .scss. CSS is valid LESS and Scss so if it doesn't compile, the problem isn't with your file.
    You can also try to compile the content of your file in http://www.sassmeister.com and play with the options.

    0 讨论(0)
提交回复
热议问题