Skip to content

Instantly share code, notes, and snippets.

@collingo
Last active December 26, 2015 07:39
Show Gist options
  • Save collingo/7116236 to your computer and use it in GitHub Desktop.
Save collingo/7116236 to your computer and use it in GitHub Desktop.
Example mapping of preprocessed CSS to semantic HTML
nav#primary {
ul {
li {
a {
&:hover {
}
}
// context
&.home {
a {
}
}
&.news {
a {
}
}
&.contact {
a {
}
}
// states
&.selected {
// example code reuse using Sass @extend
@extend .highlight;
}
}
}
}
<nav id="primary">
<ul>
<li class="home selected">
<a href="#">Home</a>
</li>
<li class="news">
<a href="#">News</a>
</li>
<li class="contact">
<a href="#">Contact</a>
</li>
</ul>
</nav>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment