Search code examples
cssgridsasscompass-sass

SASS Compass grid not working


I can't seem to get the core grid from compass to show up in my file. I'm correctly importing the reset from compass

"@import "compass/reset";

but when I add in

"@import "compass/layout/grid-background";

I get nothing. Do I need to add it to my containing div somehow?


Solution

  • grid-background doesn't contain any styles directly, it's just a set of variables, functions and mixins that you can apply to styles yourself to set up the grid.

    here's a nice example of how to use it: grid example

    Note that the styles for container, header, footer, etc are using mixins from grid-background, that's what you want to do.

    reference docs here: grid layout docs

    and if you find it helpful to look at the source, you can find it atyour equivalent of:

    ~/.rvm/gems/ruby-xxx/gems/compass-xxx/frameworks/compass/stylesheets/compass/layout/_grid-background.scss