Skip to content

Instantly share code, notes, and snippets.

@teddyzetterlund
Last active December 10, 2015 22:18
Show Gist options
  • Save teddyzetterlund/4501139 to your computer and use it in GitHub Desktop.
Save teddyzetterlund/4501139 to your computer and use it in GitHub Desktop.
Sass output of nested placeholders

Sass output from nested placeholders

Simple example of nested placeholders in Sass and the unfortunate CSS output it generates.

<style>
.nav-site {
@extend %menu-horizontal-blocks;
}
</style>
<ul class="nav-site">
<li><a href="#">Home</a></li>
<li><a href="#">Contact</a></li>
</ul>
%menu {
list-style: none;
padding: 0;
}
%menu-horizontal {
@extend %menu;
li {
display: inline;
}
}
%menu-horizontal-blocks {
@extend %menu-horizontal;
overflow: hidden;
a {
float: left;
}
}
.nav-site {
list-style: none;
padding: 0;
}
.nav-site li {
display: inline;
}
.nav-site {
overflow: hidden;
}
.nav-site a {
float: left;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment