【问题标题】:Sass Cache ruining SCSS ValuesSass 缓存破坏 SCSS 值
【发布时间】:2016-02-16 01:56:55
【问题描述】:

在将 SASS 版本中的 Bootstrap 集成到我的项目中时,我遇到了一个奇怪的错误,其中一些 CSS 规则似乎不适用甚至是错误的。 我花了几个小时才弄清楚它实际上是由创建 .scss-cache 的 SCSS 编译器引起的。如果我让编译器新创建 CSS 文件(在删除缓存文件夹之后)一切正常,但是一旦我进行 SCSS 更改,它显然会以奇怪的扁平值从缓存中加载信息,有时甚至完全改变了十六进制颜色和字体大小。

我认为 SASS 安装中的精度是问题,并像这样更改了 number.rb:

def self.precision
  @precision ||= 10
end

这并没有改变问题。我可以更改 SASS 使其不创建任何缓存,但必须有更好的方法来做到这一点。 我真的不明白为什么在css文件中会出现这种奇怪的现象。

以下是其中的一些:

-/* line 353, C:/Users/Weidler/CloudStation/git/GitHub/thegreatdictation/code/scss/../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_forms.scss */
+/* line 353, ../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_forms.scss */
 .form-group-lg .form-control {
-  height: 36px;
+  height: 46px;
   padding: 10px 16px;
-  font-size: 14px;
-  line-height: 1;
+  font-size: 18px;
+  line-height: 1.33333;
   border-radius: 6px;
 }
-/* line 360, C:/Users/Weidler/CloudStation/git/GitHub/thegreatdictation/code/scss/../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_forms.scss */
+/* line 360, ../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_forms.scss */
 .form-group-lg select.form-control {
-  height: 36px;
-  line-height: 36px;
-}
-/* line 365, C:/Users/Weidler/CloudStation/git/GitHub/thegreatdictation/code/scss/../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_forms.scss */
+  height: 46px;
+  line-height: 46px;
+}
+/* line 365, ../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_forms.scss */
 .form-group-lg textarea.form-control,
 .form-group-lg select[multiple].form-control {
   height: auto;
 }
-/* line 368, C:/Users/Weidler/CloudStation/git/GitHub/thegreatdictation/code/scss/../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_forms.scss */
+/* line 368, ../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_forms.scss */
 .form-group-lg .form-control-static {
-  height: 36px;
-  min-height: 28px;
+  height: 46px;
+  min-height: 38px;
   padding: 11px 16px;
-  font-size: 14px;
-  line-height: 1;
-}
-
-/* line 382, C:/Users/Weidler/CloudStation/git/GitHub/thegreatdictation/code/scss/../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_forms.scss */
+  font-size: 18px;
+  line-height: 1.33333;
+}
+
+/* line 382, ../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_forms.scss */
 .has-feedback {
   position: relative;
 }

+ 表示它在工作文件中
- 意味着它在不工作的文件中
在这两个文件中都没有任何意义

【问题讨论】:

  • 为什么在有 Sass 精度标志的情况下修改 number.rb?
  • 因为我不知道 ;)

标签: twitter-bootstrap sass


【解决方案1】:

好的,我实际上并没有找到让我 100% 满意的解决方案,但我得到了它为我工作。问题似乎是这样的事实,即我用来实时编译 sass/scss 代码的应用程序 Scout 使用的是旧版本的 sass,因此您无法修改精度或其他任何内容。

虽然更改为 Koala(另一个应用程序,它甚至可以让您选择 sass 版本/编译器),但一切正常。

所以这似乎是一个侦察问题,遗憾的是软件也不再更新。无论如何,Tbh Koala 似乎要复杂得多。

【讨论】:

    猜你喜欢
    • 2012-03-09
    • 2010-11-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-26
    • 1970-01-01
    • 1970-01-01
    • 2020-05-19
    • 1970-01-01
    相关资源
    最近更新 更多