【问题标题】:How does one @import bootstrap.css and @extend bootstrap class selectors? [duplicate]一个@import bootstrap.css 和@extend 引导类选择器如何? [复制]
【发布时间】:2016-01-08 19:00:24
【问题描述】:

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

这就是我认为可以让我使用@import bootstrap.css 和@extend 引导类选择器的方法。 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.

【问题讨论】:

    标签: css sass


    【解决方案1】:

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

    【讨论】:

    • 谢谢,我回到了 Bootstrap,我正在阅读有关 scss 和 Bootstrap 的更多信息,基于您在此处的领导。谢谢。
    猜你喜欢
    • 2014-07-12
    • 1970-01-01
    • 2013-07-10
    • 2014-09-22
    • 1970-01-01
    • 2017-08-14
    • 2019-03-23
    • 2016-12-13
    • 1970-01-01
    相关资源
    最近更新 更多