Keep @import at the end of CSS after SCSS compile

后端 未结 2 1913
不思量自难忘°
不思量自难忘° 2021-01-19 09:58

We need to put @import at the end of my CSS file. For example:

SCSS:

@import \"reset.css\";
Body {
   font: 0.8em arial         


        
2条回答
  •  逝去的感伤
    2021-01-19 11:00

    You can't. Sass is smart enough to know that @import declarations must be at the beginning of the file so it rewrites it for you to be valid.

    The @import CSS at-rule allows to import style rules from other style sheets. These rules must precede all other types of rules, except @charset rules; as it is not a nested statement, it cannot be used inside conditional group at-rules.

    https://developer.mozilla.org/en-US/docs/Web/CSS/@import

    If this is not acceptable, you'll need to use multiple link declarations (which are arguably better anyway for the user).

提交回复
热议问题