Compass - CSS files caching - compass-sass

Compass appends a unique ID to my sprites everytime a new image appears in the Compass images folder. Is the same behavior available with the CSS files ? So my CSS file is named mystyle-12343321.css instead of mystyle.css
Thanks !

As detailed by Scott Davis (Compass core team dev), in this Compass Github Issue (opened by myself) :
It's not a cache buster in the sense of the web it's a uniqueness hash. It's how compass tracks changes to the sprite file so that we know if it needs to be recompiled
So the answer is no, as Compass does not support cache busting.

Related

Sass does not compile compile right with more than one project accessing a foundation folder

I'm using CodeKit 2.1.8
I was using Foundation 5.4.6 but got in to some problems and updated to 4.5.7 now I still have some problems but different ones.
I was using Sass version 3.4.7 but downgraded to 3.2.19 after reading this could help. This did not help so I updates back to 3.4.7.
Right now my problem is as follows:
I have foundation installed through CodeKit. I did not alter die bower component files, everything is as is.
I have two projects accessing the bower component folder. My folder structure is as follows:
zurb-foundation
bower_components
dsl
css
img
js
scss
index.html
header
css
img
js
scss
index.html
.bowerrc
bower.json
config.codekit
package.json
The Sass files in both the dsl and header folder are completely identical. But they compile different.
Right now the dsl app.css file has about 15000 rows where the header app.css file has about 5000 rows.
I compared them and there are a lot of differences. All of the styles and components get loaded but it looks like the styles get multiple times in the dsl/app.css. Another difference is that the header folder has no sass-cache folder but the dsl folder has got a folder called sass-cache.
So there are some compilation differences does anyone has encountered this before?
Thank you
I also posted this question in the Foundation forum. Rafi Benkual provided me with this answer:
Have you tried Libsass? Here is the recommendation from Codekit:
Sass Update
"Keep using Libsass to compile Sass files in a Zurb Foundation project because the latest Ruby Sass compiler (3.4.5) is not yet supported by Foundation. This should clear up in the next few weeks. See the link in the 2.1.7 release notes, below, for more information."
In CodeKit 2 you can find "Use the libsass compiler" checkbox under "Other options:" on the .scss file's settings panel (on right).
This worked for me.

Meteor.js & SCSS/Compass

Anyone doing development with meteor and SCSS. How do you get started, there are no packages for meteorite that i could find that compile .scss files into a specific folder?
Have you tried just compiling the sass/scss into css locally during development? Meteor shouldn't complain if you have your config.rb inside of the client folder along with a sass folder and compiled css folder. It should just automatically read the css per norm. Running $ compass watch inside of this client folder where the config.rb resides is an easy way to automate this css compilation. Telescope is a great sample Meteor app that uses sass in this fashion.
--Alex
Just to get this posted as an answer (was posted as comment); bookcasey posted this sample project as well: https://github.com/gdumitrescu/scoreboard which provides some guidance on how to use sass/scss. Hope it helps.

Compass File Location Best Practice

Just starting out with SASS and Compass.
I've been using a Mac App called CodeKit to compile and manage my Sass and Compass.
If I wanted to use a set of Sass Partials on multiple projects and ideally store these in a central location (for example my dropbox) is this possible?
Codekit has a really nice feature called Frameworks that lets you do this but this doesn't work once you start to use Compass as Compass is a framework in its own right.
Thanks in advance for any help.
Richard
Create a Compass extension and import it into your config.rbs.

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.

How to automatically compile scss into css with assets pipeline in Rails 3.1?

The new rails 3.1 asset pipeline confused me a lot. In rails 3.0.x, with the sass gem, my global css file got updated when I edit .scss files. But in rails 3.1, that doesn't work anymore. It seems like I have to run a rake task to update my css files whenever I modify the .scss files. I feel like I misunderstand something about the new asset pipeline, but I don't know what it is. Can someone provide a solution or explanation to this problem? Thank you.
There are two possible causes of this. I am assuming that you are in development mode, and that all the gems are loaded.
1. Config
In development mode files are compiled on-demand and cached until any changes are made. You have to get the new 3.1 config options set in the right files or this might not work as expected.
Check out the Rails guides section on upgrading.
2. Extensions
The other is getting the extensions in the right order. For scss that would be file.css.scss. This tells Sprockets to parse the files as scss first, and that the have a css extension. If you had .erb on the end - file.css.scss.erb - then erb is processed first, then scss.
Upgrading apps is a bit tricky because so many things have changed. The asset pipeline guide has lots of useful information and advice.
Sass / SCSS has this built in already so you don't have to do ERB pre-processing.
image-url("image.png")
http://guides.rubyonrails.org/asset_pipeline.html#coding-links-to-assets
For me this problem resolved very easy.
I simple deleted all precompiled *.css files from assets/stylesheets and remain all *.scss files. Rails worked fine with *.scss directly, withoutn precompile.

Resources