Created
December 11, 2013 13:53
-
-
Save indieisaconcept/7910768 to your computer and use it in GitHub Desktop.
Example of how not namespacing your variables can cause problems
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p>This is an example of a how you need to be careful with variable naming and use.</p> | |
<div class="box">BOX</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// 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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p { | |
font-size: 18px; | |
} | |
.box { | |
background: red; | |
color: white; | |
font-size: 18px; | |
width: 100px; | |
height: 100px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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