Configure compass browser support (Compass 1.x syntax)

Excluding browsers is done by modifying the $graceful-usage-threshold variable. If Browser X only has 4.99% of the market share, you want to set it to 5. $debug-browser-support: true; $browser-minimum-versions: ( “ie”: “9” ); $graceful-usage-threshold: 4.46163; @import “compass”; .foo { @include opacity(.5); @include border-radius(10px); } Output: .foo { /* Content for ie 8 omitted. Minimum support … Read more

Sass import error in Rails 3 app – “File to import not found or unreadable: compass”

I was getting this error. I changed this line in my application.rb from: Bundler.require(:default, Rails.env) if defined?(Bundler) to: Bundler.require(*Rails.groups(:assets => %w(development test))) if defined?(Bundler) Also, make sure the files are names something.css.sass NOT something.sass And one other thing, I had an old compass.rb file in my config directory which isn’t needed in Rails 3.2. Deleting … Read more

Merging selectors from mixins

No. Sass has no way of merging selectors (this could be considered undesirable, as it would alter the ordering of the selectors). The only thing you can really do is something like this (or write 2 separate mixins): @mixin footer_flush_bottom { height: 100%; body { min-height: 100%; position: relative; @content; } } html { // … Read more

Sass @each with multiple variables

Just came across this, have the answer for you. In Sass, you can actually have a multidimensional list, so instead of constructing individual variables, you’d create one variable to hold them all, then loop over them: $zoo: puma black, sea-slug green, egret brown, salamander red; @each $animal in $zoo { .#{nth($animal, 1)}-icon { background-color: nth($animal, … Read more