问题描述
我最近从使用Less改为使用Compass.我使用Codekit,但是不使用内置的Compass编译器,因为在使用插件时会遇到问题.现在我的问题是,与Less相比,编译时间要长得多.我已经意识到这是由于它在每次编译时都会生成精灵.有没有办法关闭此功能? IE,仅当我具有特定的自定义设置时才进行编译.我看了自定义,没有办法设置一个自定义属性,该属性指示何时以及何时不编译新的sprite.换句话说,我想手动告诉编译器何时生成子画面.
I recently moved from using Less to using Compass. I use Codekit, but dont use the built in Compass compiler due to it having problems when using plugins. Now my issue is that the compilation is significantly longer compared to Less. I have realized that this is due to it generating sprites on each compile. Is there a way to turn this off? IE, only compile when I have a certain customization in place. I looked at the customization, and there is no way to set a customization property that tells when and when not to compile a new sprite. In other words I would like to tell the compiler manually when to generate the sprite.
还有其他人有解决办法吗?
Anyone else have a solution?
推荐答案
由于无法在任何地方找到解决方案,我决定要做的是创建一个单独的sprite.scss文件来导入和管理我的Sprite.当我有一个需要附加到sprite的新图像时,我将编译sprite.scss.现在,我有一个sprite.css文件.我将sprite.css文件的内容复制到部分_sprites.scss中,然后将其导入到main.scss文件中.现在,我可以在main.scss文件中使用extends等.我知道这听起来很麻烦,但是它将我的编译时间从30-60秒减少到不到2秒.
What I have decided to do, since I cannot find a solution anywhere, is to create a separate sprite.scss file that imports and manages my sprites. When I have a new image that needs to be attached to a sprite, I compile the sprite.scss. Now I have a sprite.css file. I copy the contents of the sprite.css file into a partial _sprites.scss and import that into my main.scss file. Now I can use extends etc within my main.scss file. I know that sounds extremely cumbersome, but it cuts down my compilation time from 30-60s secs to less than 2 secs.
其他人都有解决的办法,我都很高兴.
Anyone else have a solution I am all ears.
这篇关于拼写时Codekit Compass与更少的编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!