SASS:使下划线文件名实际上创建css文件 [英] SASS : making underscore file names actually create css files

查看:529
本文介绍了SASS:使下划线文件名实际上创建css文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认情况下,SASS查看文件名,并确定是否使用css文件。我想知道是否有一种方法来防止这种情况发生。

By default SASS looks at the filename and determines whether to make a css file out of it. I'm wondering if there is a way to prevent this from happening.

我们正在建立一个大型网站,许多前端开发人员正在编辑CSS,但我们只有一个开发服务器。当然,一些你可以看到的事情发生在本地,但通常你只能看到在服务器上的真正呈现的方式。

We're building a large website and lots of front-end developers are editing the css, but we only have one dev server. Sure some things you can see happen locally, but often you can only see the real rendered way on the server.

因此,当我将编译好的css文件推送到服务器时,我的同事的css会被破坏,直到s /他提交,我做一个svn:update等,等等。

So, when I push my compiled css file to the server, my co-workers' css gets clobbered until s/he commits and I do an svn:update, etc, etc.

然而,如果我们在不同的SASS文件中工作,并且那些css文件被创建,我只需要推上表单。 css文件,而不是整个事情。

However, if we were working in different SASS file, and those css files were getting created, I would only have to push up, say, the forms.css file instead of the whole thing.

然后对于生产,我们把它回到SASS正常工作的方式。

Then for Production, we'd put it back to the way SASS normally works.

我可以这样做的唯一其他方法是做一个大规模重命名文件,这看起来很乱。

The only other way I can figure to do this is to do a mass rename of files, which seem very messy.

提前感谢。

推荐答案

整个问题是他们没有编译成文件。如果你想要一个sass文件变成一个css文件,删除下划线。

The entire point of partials is that they don't get compiled into files. If you want a sass file to be turned into a css file, remove the underscore.

你的真正的问题似乎是你把编译的CSS在你的版本控制。不要这样做。只提交Sass,并将其编译到CSS服务器端,并使用后接收钩子或其他东西。

Your real problem seems the be that you're putting compiled CSS in your version control. Don't do that. Only commit Sass, and compile it into CSS server-side with a post-receive hook or something.

这篇关于SASS:使下划线文件名实际上创建css文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆