我正在尝试将 Bootstrap 和 google 代码更漂亮地结合使用,但最终结果相当令人失望。在Gemfile
:
gem 'bootstrap-sass', '~> 2.2.1.1'
gem 'google-code-prettify-rails'
在application.css
:
*= require bootstrap
*= require google-code-prettify-rails/prettify
在application.js
:
//= require bootstrap$
//= require google-code-prettify-rails/prettify
//= require google-code-prettify-rails/lang-sql
我prettyPrint()
从 .coffee 脚本加载运行:
jQuery ->
prettyPrint()
一切正常,<code class="prettyprint lang-sql">...</code>
格式化。但唉,格式化它的 CSS 是 Bootsrap 的 CSS 和漂亮的打印主题 CSS 的混合体,它显示......丑陋。Element Inspect 显示来自 Bootstrap 应用的样式:
/* line 8, .../bootstrap-sass-2.2.1.1/vendor/assets/stylesheets/bootstrap/_code.scss */
code,
pre {
padding: 0 3px 2px;
font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
font-size: 12px;
color: #333333;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
/* line 17, .../bootstrap-sass-2.2.1.1/vendor/assets/stylesheets/bootstrap/_code.scss */
code {
padding: 2px 4px;
color: #d14;
background-color: #f7f7f9;
border: 1px solid #e1e1e8;
}
我的问题是
- 有没有办法防止资产管道包含 Bootstrap 自己的
_code.scss
? - 如果没有,我如何重置 Bootstrap 的应用样式?