简体   繁体   English

使用Compass的Foundation 5的SASS / CSS问题

[英]Issue with SASS/CSS for Foundation 5 using Compass

I'm having a problem with Foundation 5's recommended SASS installation. 我对Foundation 5推荐的SASS安装有问题。

http://foundation.zurb.com/docs/sass.html http://foundation.zurb.com/docs/sass.html

I followed the brief tutorial only a week or so ago and had no problems. 我仅在一周左右的时间里就遵循了简短的教程,并且没有任何问题。 Everything seemed to run OK and looked OK. 一切似乎运行正常,看起来还不错。

Over the course of the next few days I was making amendments to the project I am working on but only put the changes (CSS) into a custom.css file. 在接下来的几天中,我正在对我正在从事的项目进行修改,但只将更改(CSS)放入了custom.css文件中。 I was wanting to ensure my client was happy with my proposed design before getting into the guts of SASS. 在进入SASS之前,我想确保我的客户对我的设计感到满意。

This evening I came to make the changes to SASS. 今天晚上,我来对SASS进行更改。 I ran compass watch before I made any changes and I was immediately met with: 在进行任何更改之前,我先进行了compass watch然后立即遇到:

write stylesheets/app.css

This totally screwed up my index.html despite not having made any changes. 尽管没有进行任何更改,但这完全弄糟了我的index.html The app.css file is only a fraction of the original size (~750 lines vs. ~8,500) and as a result the page is pretty much loading as raw HTML with no useful CSS - there's not even a hint of any styling on body for example. app.css文件仅是原始大小的一小部分( app.css ),结果该页面已作为原始HTML加载,没有有用的CSS-甚至没有任何关于body样式的提示例如。

After deciding to re-install from scratch I'm still no better off and running into very much the same issue. 决定从头开始重新安装后,我仍然感觉更好,并遇到了几乎相同的问题。

According to Foundation: 根据基金会的说法:

app.scss Here you can determine what stylings will be in your project. app.scss在这里,您可以确定项目中的样式 By default all of Foundation is imported , but you can deactivate and select specific components you want to import or add your custom Sass here. 默认情况下,所有Foundation都已导入 ,但是您可以在此处停用并选择要导入的特定组件,或在其中添加自定义Sass。

When I first installed Foundation, it was all imported as the default styles loaded for my index.html . 当我第一次安装Foundation时,它都是作为为index.html加载的默认样式导入的。 It was acting how Zurb described it would. Zurb的描述是这样行事的。 Now it only seems to grab some default styles but not the whole thing and I can't for the life of me figure out why. 现在,它似乎只能获取一些默认样式,而不是整个样式,而且我无法一生找出原因。

Update: A friend cloned my repo and had no issues whatsoever. 更新:一位朋友克隆了我的存储库,没有任何问题。 I've done the same and ran into the same issue again - must be something to do with my environment. 我做了同样的事情,再次遇到了同样的问题-必须与我的环境有关。

Further update: compass watch is only compiling two of the Foundation files, _icon-bar.scss and _visibility.scss . 进一步更新: compass watch仅编译两个Foundation文件_icon-bar.scss_visibility.scss It seems to be pulling completely arbitrary lines even within those files, so something in them is not right either. 即使在这些文件中,这似乎也完全拉扯了任意行,因此其中的某些内容也不正确。 It does not pull anything from anywhere else. 它不会从其他任何地方拉东西。 There's a couple of pastebin links in the comments on the answer below. 以下答案的评论中有几个pastebin链接。

I would greatly appreciate any assistance with this. 我将不胜感激。

Thanks for taking the time to read. 感谢您抽出宝贵的时间阅读。

I'm just learning Foundation 5 with Sass but your issue and the CSS output is looking how mine was compiling out as well, with lot's of comments and no CSS being pulled into the HTML.. 我只是在学习使用Sass的Foundation 5,但是您的问题和CSS输出也在寻找我的编译方式,其中有很多注释,而CSS没有插入HTML。

This thread on the Foundation Forums really helped me. 基金会论坛上的这个话题对我很有帮助。 Seems like the latest Sass and Compass wasn't working properly?? 好像最新的Sass和Compass无法正常工作? Not sure the details but the suggestion from Szabesz to uninstall the latest Sass and Compass and install slightly older ones worked: 不确定细节,但Szabesz建议卸载最新的Sass和Compass并安装稍旧的建议是可行的:

to uninstall:
sudo gem uninstall compass 1.0.0
sudo gem uninstall sass 3.4.0

to reinstall old versions:
sudo gem install sass --version 3.2.9
sudo gem install compass --version 0.12.7

What's in app.scss what ever is listed in there will be output as css in app.css. app.scss中包含的内容将在app.css中输出为css。

@import "settings" @import "foundation" @import“设置” @import“基础”

Is the default. 是默认值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM