@import bootstrap.css和@extend引导类选择器如何?

时间:2015-10-11 05:17:53

标签: css sass

这是一个后端程序员。只是看着使用scss,它在前端有明显的好处。

这就是我认为会让我@import bootstrap.css和@extend bootstrap类选择器。 bootstrap.css,此scss与此.scss文件位于同一目录中

// styles.scss
@import "bootstrap.css";
#menu-top {
  @extend .navbar-fixed-top;
}

但是,我得到了这个

// generated styles.css
Error: "\#menu-top" failed to @extend ".navbar-fixed-top".
     The selector ".navbar-fixed-top" was not found.
     Use "@extend .navbar-fixed-top !optional" if the extend should be     
able to fail.
      on line 19 of links_style.scss
Use --trace for backtrace.

1 个答案:

答案 0 :(得分:1)

我可以看到您正在导入css引导程序版本。您必须导入scss版本才能从中导出任何样式。