Last active
August 29, 2015 14:07
-
-
Save alecperkins/b32ebf51d76b064693b6 to your computer and use it in GitHub Desktop.
Demonstrating how placeholder classes and a naming scheme (with a helper mixin) can create cleanly semantic output. (Also shows how marvelous the Sass indented syntax is :P)
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
%Highlight { | |
color: black; | |
font-size: 14px; | |
&%-image--right { | |
._Image { | |
float: right; | |
} | |
} | |
&%-image--left { | |
._Image { | |
float: left; | |
} | |
} | |
&%-large { | |
font-size: 18px; | |
} | |
&%-dark { | |
background: black; | |
color: white; | |
} | |
} |
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
.ProductShowcase | |
+extend(Highlight, dark, image right) | |
.TeamMemberProfile | |
+extend(Highlight, image left) | |
&.-featured | |
+extend-variants(Highlight, large) |
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
.ProductShowcase { | |
@include extend(Highlight, dark, image right); | |
} | |
.TeamMemberProfile { | |
@include extend(Highlight, image left); | |
&.-featured { | |
@include extend-variants(Highlight, large); | |
} | |
} |
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
.ProductShowcase, .TeamMemberProfile { | |
color: black; | |
font-size: 14px; | |
} | |
.ProductShowcase ._Image { | |
float: right; | |
} | |
.TeamMemberProfile ._Image { | |
float: left; | |
} | |
.TeamMemberProfile.-featured { | |
font-size: 18px; | |
} | |
.ProductShowcase { | |
background: black; | |
color: white; | |
} |
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
<div class="ProductShowcase"> | |
<img class="_Image" src="..."> | |
<p class="_Description">...</p> | |
</div> | |
<div class="TeamMemberProfile -featured"> | |
<img class="_Image" src="..."> | |
<p class="_Description">...</p> | |
</div> | |
<div class="TeamMemberProfile"> | |
<img class="_Image" src="..."> | |
<p class="_Description">...</p> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment