Last active
August 29, 2015 14:20
-
-
Save tortillaj/3b2a01ee68ee41cec4e2 to your computer and use it in GitHub Desktop.
Sass Variables
This file contains hidden or 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
<div> | |
<h1>This text is red</h1> | |
<p>Yet paragraphs are blue. <a href="#">Links are blue too.</a></p> | |
</div> |
This file contains hidden or 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.4.13) | |
// Compass (v1.0.3) | |
// ---- | |
// set a global variable | |
$myColor: blue; | |
p { | |
color: $myColor; | |
} | |
h1 { | |
// now you can overwrite $myColor | |
// as a nested variable here | |
$myColor: orange; | |
color: $myColor; | |
} | |
a { | |
color: $myColor; | |
text-decoration: underline; | |
} |
This file contains hidden or 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 { | |
color: blue; | |
} | |
h1 { | |
color: orange; | |
} | |
a { | |
color: blue; | |
text-decoration: underline; | |
} |
This file contains hidden or 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
<div> | |
<h1>This text is red</h1> | |
<p>Yet paragraphs are blue. <a href="#">Links are blue too.</a></p> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment