Last active
August 29, 2015 14:20
-
-
Save tortillaj/3d47780c5d5954cca9af to your computer and use it in GitHub Desktop.
Nesting classes and Elements in Sass
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>Nesting classes and elements</h1> | |
<p>Elements and classes can be nested. Here we nested a paragraph tag. <a href="#">Links can be nested too.</a></p> | |
<p class="highlighted-text">Classes can be nested too!</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: #4d4d4d; | |
div { | |
p { | |
color: $myColor; | |
} | |
a { | |
color: $myColor; | |
text-decoration: underline; | |
} | |
.highlighted-text { | |
color: pink; | |
} | |
} |
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 p { | |
color: #4d4d4d; | |
} | |
div a { | |
color: #4d4d4d; | |
text-decoration: underline; | |
} | |
div .highlighted-text { | |
color: pink; | |
} |
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>Nesting classes and elements</h1> | |
<p>Elements and classes can be nested. Here we nested a paragraph tag. <a href="#">Links can be nested too.</a></p> | |
<p class="highlighted-text">Classes can be nested too!</p> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment