Skip to content

Instantly share code, notes, and snippets.

@peterudo
Created November 23, 2011 08:51
Show Gist options
  • Save peterudo/1388219 to your computer and use it in GitHub Desktop.
Save peterudo/1388219 to your computer and use it in GitHub Desktop.
Sass
@charset "UTF-8";
small:before {
content: "— "; }
.page-content {
margin: 44 px 0 0 0; }
$toolbar-height: 44;
small:before {
content: "— ";
}
.page-content {
margin: #{$toolbar-height}px 0 0 0;
}
@adamstac
Copy link

Try this instead: margin: $toolbar-height + px 0 0 0;

Or, add px to the var like so $toolbar-height: 44px; and that will become margin: $toolbar-height 0 0 0;

Notice that you don't need to interpolate, not in this case.

@peterudo
Copy link
Author

Thanks for the feedback, both of those work perfectly. I was planning to switch to using px in the variable, but thought it was a good idea to point out a potential bug in the compiler before moving on in silence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment