Skip to content

Instantly share code, notes, and snippets.

@tsankashvili
Last active February 24, 2019 21:34
Show Gist options
  • Save tsankashvili/e0231820a39590222d7efb049e911fb5 to your computer and use it in GitHub Desktop.
Save tsankashvili/e0231820a39590222d7efb049e911fb5 to your computer and use it in GitHub Desktop.
Sass Nesting & Combinators
// ----
// 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;
// }
// }
// }
.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;
}
@tsankashvili
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment