【问题标题】:What do I need to import from Twitter's bootstrap to extend the .panel class?我需要从 Twitter 的引导程序导入什么来扩展 .panel 类?
【发布时间】:2014-07-17 22:37:12
【问题描述】:

鉴于以下 .scss 文件

@import 'vendor/bootstrap-sass/bootstrap';                                                                                                                               

.item1 {                                                                                                                                                                 
  @extend .row;                                                                                                                                                          
}                                                                                                                                                                        
.item2 {                                                                                                                                                                 
  @extend .panel;
}

为什么扩展 .row 工作但扩展 .panel 编译失败?

错误输出:

Syntax error: ".item2" failed to @extend ".panel".                                                                                                                       
          The selector ".panel" was not found.                                                                                                                       
          Use "@extend .panel !optional" if the extend should be able to fail.

【问题讨论】:

  • @cimmanon 查看已编辑的问题
  • 这个错误对我来说似乎不言自明:您尝试扩展的类不存在。
  • @cimmanon 这也是我的假设。更新了问题标题以更准确地表示问题...
  • @danwoods,您使用的是哪个版本的 Bootstrap?我认为panel 是在 3 中添加的。
  • @SlightlyCuban 这似乎解决了它。从github下载了最新版本,它工作!谢谢。如果您将此添加为答案,我会接受...

标签: css twitter-bootstrap sass


【解决方案1】:

.panel 存在于Boostrap 3.0 components 中,但不存在于Boostrap 2.3 中。检查您的版本并更新您的@extends!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多