Last active
February 24, 2019 21:34
-
-
Save tsankashvili/e0231820a39590222d7efb049e911fb5 to your computer and use it in GitHub Desktop.
Sass Nesting & Combinators
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
| // ---- | |
| // libsass (v3.5.4) | |
| // ---- | |
| // Sass Nesting | |
| .container { | |
| display: flex; | |
| background-color: #eee; | |
| .sidebar,.main{ | |
| padding: 10px; | |
| } | |
| .sidebar{ | |
| width: 200px; | |
| background: #eee; | |
| } | |
| .main{ | |
| margin-right: 10px; | |
| background-color: #f0f0f0; | |
| border-left: 2px solid #333; | |
| } | |
| } | |
| // Sass Combinators | |
| // Descendant Selector | |
| // .header{ | |
| // .nav{ | |
| // .social-links{ | |
| // color: yellow; | |
| // } | |
| // } | |
| // } | |
| // Child Selector | |
| // .header{ | |
| // .nav{ | |
| // > .social-links{ | |
| // color: pink; | |
| // } | |
| // } | |
| // } | |
| // Adjacent Sibling Selector | |
| // .header{ | |
| // .nav{ | |
| // > .social-links{ | |
| // color: pink; | |
| // } | |
| // } | |
| // } | |
| // General Sibling Selector | |
| // .header{ | |
| // .nav{ | |
| // ~ .social-links{ | |
| // 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
| .container { | |
| display: flex; | |
| background-color: #eee; | |
| } | |
| .container .sidebar, .container .main { | |
| padding: 10px; | |
| } | |
| .container .sidebar { | |
| width: 200px; | |
| background: #eee; | |
| } | |
| .container .main { | |
| margin-right: 10px; | |
| background-color: #f0f0f0; | |
| border-left: 2px solid #333; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://www.sassmeister.com/gist/e0231820a39590222d7efb049e911fb5