Created
October 14, 2011 12:58
-
-
Save hshoff/1287032 to your computer and use it in GitHub Desktop.
Airbnb - Star Rating Markup Namespace by Harry Shoff
This file contains 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
<!-- stars.html.erb --> | |
<div class="stars empty"> | |
<div class="stars filled"></div> | |
</div> | |
<!-- | |
This way you can namespace your selectors. | |
The markup isn't as pretty, but you can | |
sleep soundly knowing other developers | |
won't override your styling properties. | |
This is easy to do with SASS by using | |
the "&" as a parent reference in nested | |
attributes. | |
example: | |
.stars { | |
// stars class styling | |
&.filled { | |
// stars and filled class styling | |
} | |
} | |
--> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment