Sprite generation Compass/SASS - sass

I'm using Compass Sprite helpers in a project which works great. However the generation of the sprite adds quite a few seconds to the project compile time and most of the time I do not need it regenerated.
Is there a way to turn off the sprite generation and get compass to use the last generated file?
I'm using CodeKit and I'll be easily confused by much talk of command line / Ruby!

I've just tried it, and for me Compass does not recompile my sprites unless i modify the contents of the sprites folder:
$ compass compile
unchanged images/sexy-sce786a2ec5.png
overwrite stylesheets/screen.css
Try compiling your project with the compass command line tool instead of CodeKit. If it works out, please check that CodeKit uses Compass to compile your project and not vanilla SASS.

It looks like a CodeKit issue which is getting fixed:
https://github.com/bdkjones/CodeKit/issues/297
Until then I am using a workaround detailed here.

It looks as if compass compile with no other arguments (as per Andrey 'lolmaus's answer) does not cause this, but if there are any arguments at all it sets the :force option to true, and one of the consequences of that is that sprites are forcibly recreated.
That seems like crazy behaviour?
For the moment I've edited lib/compass/commands/update_project.rb (specifically, in my case, ~/.rvm/gems/ruby-1.9.3-p429/gems/compass-0.12.4/lib/compass/commands/update_project.rb) and commented out the parser.options[:force] = true line in the parse_arguments! function at the end of that file.
(note the unless arguments.empty? condition)
That seems to have disabled sprite generation entirely (i.e. even when you need it), but I can enable it manually with compass compile --force ...
That's certainly good enough for me.

Related

PhpStorm - Disable generation of '.sass-cache' on compilation (file-watcher)

So, the compilation of (_)file.scss files to *.css files works great. Just one thing: For each file the watcher encounters, it creates a cache file. It does this right next to the file being compiled, e.g.:
_partial.scss
style.scss
Generates:
/.sass-cache/C0mpl1cat3dh4sh/_partial.scss
/.sass-cache/C0mpl1cat3dh4sh/style.scss
style.css
Of course I could simple delete the files when they're generated. Could add them to .gitignore. But these are work-arounds.
How to disable the generation of these cache files?
In the options I could not find an option to do this when searching "cache", "file watcher" or "watch".
Extra info:
Running 2018.3.3, built 9th January 2019
Have not seen this before, though haven't mucked around with scss in a while (2 - 3 months), so not sure if it's a recent addition to PhpStorm
Launch a terminal and find out the command-line switches offered by your SASS implementation, typically with:
sass --help
You appear to be using old Ruby SASS. If I recall correctly, the switch was:
--no-cache
Add it to the Arguments input box and you should be done.
As already mentioned, Ruby SASS is no longer being developed so it can be a good moment to switch to Dart SASS, which does not have any cache to care about.
Ruby sass is deprecated already for a while, development is moved towards Dart implementation while LibSass is also actual implementation, but may step behind Dart implementation in some aspects. LibSass have plenty of integrations for various languages, please refer documentation by link above.
Both of these implementations are much faster then Ruby sass and doesn't produce any additional cache directories.

Why would there be a delay in SCSS compiling?

I'm using SASS/SCSS as a preprocessor to compile my .scss files on Windows 7, and recently I've noticed that there is a delay of about 15 or 20 seconds between when I save my files and when I get my "Changes detected..." in my command line. In the past I got it instantaneously but now I get that delay. Why would this be the case? Does it depend on the size of the .scss file? (The one I'm working with is ~550 lines).
It can be related to the version of the SASS that you are using. There are few reports of this issue. (though those are pretty old)
On the other hand people are also experiencing slower compile speeds as their projects get bigger due to it being based on ruby. So maybe you could check this article out http://benfrain.com/lightning-fast-sass-compiling-with-libsass-node-sass-and-grunt-sass/
I have been using it with codekit for a while and had no such problems so far (hope it stays that way :).
Since you are on Windows, a good alternative to codekit is prepros. Those are not free apps, so maybe you could just try using compass with sass - you can set it up in a minute and it just might solve your issue- its worth trying.
You could also try using grunt - check this out https://github.com/sindresorhus/grunt-sass

Why does the singularity markup simply disappear from my .scss file?

I'm 3 days new to singularity and for the past 2 days have had the issue where only my singularity ($grids and $gutters) markup disappears from my .scss file.
I know that the markup has compiled because the grids and gutters are present and functional even though no longer present in the .scss.
The most bizarre (possibly telling) part to the story is that commented singularity markup has never disappeared.
Anyone else experience this? Anyone have a solution?
osx 10.9.1/bbedit 10.5.7/compass (0.12.2)/sass (3.2.13)/singularitygs (1.1.2)
Neither among Sass, Compass and Singularity modifies your .scss sources.
It might be your source code editor, or some GUI Sass compiler, or a virus, or a glitch in the Matrix.
Get control over your computer.

Compass watch with sprites slow

I have a relatively big sass project with quite a few sprites. When I have compass watch running and make a change, the project takes a few seconds to compile because checking the sprites takes a long time. The sprites are NOT actually getting overridden or anything (unless of course I change the images) but just the process of checking each image takes a while. Is there a way to run compass watch while ignoring sprites just to speed things up? Then if I want to change sprites I can just manually compile.
I've been searching for a solution to this as well. A not great (but working solution) can be found here: Codekit Compass vs Less compilation when spriting
Basically I have a sprites file allSprites.sass which creates allSprites.css. I then put that into _sprites.scss and import that into my main.sass file.
If I could automate moving the allSprites.css into the _sprites.scss on change of the allSprites.sass file my life would be complete =)

Compass Sprite Filename

I am trying to control compass sprite filenames.
My deployment scripts require that images be included in the project file (.Net).
Since compass creates new files each time it renders the sprite (to break caching, I presume)., I have to explicitly get rid of the old reference and add the new.
Has anyone had experience with this?
I don't really want to use an after_build script, but if that's what I have to do I'll take all the suggestions you've got.
thanks.
If you assume to break the caching, you can look at my answer to the question How to turn off COMPASS SASS cache busting?, which automatically created a copy of sprites without hashing.

Resources