2

I'm on Windows 7 making use of the Scout app for convenient SASS/Compass compilation without the hassle of configuring it all:

http://mhs.github.com/scout-app/

I've set it up to monitor my scss folder and to output main.css to my css folder, and it works. However I am having a very frustrating time at times on an issue that seems related to the order in which things are saved.

For example, I have a rule like this:

@include background-with-css2-fallback(image-url("bg_skin.png"),image-url("bg_noise.png"),linear-gradient(top, rgba(0,0,0,0), rgba(0,0,0,.4)),$color-header-background url(../img/bg_skin.png));

This creates a background consisting of two layered PNGs with a semi-trasparent gradient applied to it. On older browsers, a base color and single PNG is applied. In normal circumstances, this would create the follow CSS. Note that the above generates dozens of lines, I'm only showing the one relevant for now:

background: url('img/bg_skin.png?1339414190'), url('img/bg_noise.png?1339150807'), -moz-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.4)), #b9d233 url(../img/bg_skin.png);

All is well. In this same file, which is my main scss file, at the end I am importing a partial like this:

@media screen and (max-width: 940px) {  @import 'tablet'; }

When I make a change to that partial file (_tablet.scss), Scout will detect it and recompile everything. However, in doing so it suddenly results in a different rule concerning the background rule I mentioned earlier:

background: url('img/bg_skin.png?1339414190'), url('img/bg_noise.png?1339150807'), -moz-linear-gradient(top, rgba 0, 0, 0, 0), rgba(0, 0, 0, 0)), #b9d233 url(../img/bg_skin.png);

It is now creating a gradient from 0 to 0, rather than from 0 to 0.4! Out of the blue.

I have found that editing my main.scss file again and saving it, once again leads to the correct gradient rule, yet then it messes up similar rules in the parial. Resaving the partial file will fix the partial CSS but then it messes up the main rules again. It's a total deadlock situation.

What I want is for both my main SCSS and partial SCSS files to be compiled correctly. I can live with a situation in which I need to save these files in a certain order, but right now every order leads to the wrong result.

Is this a common problem or is it a setup problem? Any suggestions?

4

2 回答 2

3

您可以尝试使用除法而不是使用十进制数。例如:0.5 > 5/10。

为我工作,我在 MACOSX LION / Textmate / Scout / Firefox 15

于 2012-10-10T11:41:59.337 回答
3

经过一番挖掘,我找到了问题的原因:

https://github.com/mhs/scout-app/issues/44

问题确实在于 rgba 值未正确编译。具体来说,它只适用于最后保存的文件,这与我的问题一致。不幸的是,对于我的设置(Windows 上的 Scout),还没有解决方案,但显然开发团队正在研究它。

于 2012-06-24T18:28:23.983 回答