Skip to content

Instantly share code, notes, and snippets.

@indieisaconcept
Created December 11, 2013 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save indieisaconcept/7910768 to your computer and use it in GitHub Desktop.
Save indieisaconcept/7910768 to your computer and use it in GitHub Desktop.
Example of how not namespacing your variables can cause problems
<p>This is an example of a how you need to be careful with variable naming and use.</p>
<div class="box">BOX</div>
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.10)
// ----
// config/_base.scss
$base-font-size: 18px;
// component/module.scss
$base-font-size: 50px !default;
// component/box.scss
$base-font-size: 10px !default;
p {
font-size: $base-font-size;
}
.box {
background: red;
color: white;
font-size: $base-font-size;
width: 100px;
height: 100px;
}
p {
font-size: 18px;
}
.box {
background: red;
color: white;
font-size: 18px;
width: 100px;
height: 100px;
}
<p>This is an example of a how you need to be careful with variable naming and use.</p>
<div class="box">BOX</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment