Last active
December 18, 2015 19:49
-
-
Save bensmithett/5835649 to your computer and use it in GitHub Desktop.
Working around a lack of element queries: http://filamentgroup.com/lab/element_query_workarounds/
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
<!-- this partial takes a boolean "respond" argument --> | |
<div class="<%= respond ? "widget--respond" : "widget" %>"> | |
... | |
</div> |
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
.widget | |
color: skinny | |
.widget--respond | |
@extend .widget | |
+at-breakpoint(32.5em) | |
color: fat | |
// Using Susy's at-breakpoint mixin for brevity. This outputs: | |
// | |
// .widget, .widget--respond { | |
// color: skinny; | |
// } | |
// | |
// @media (min-width: 32.5em) { | |
// .widget--respond { | |
// color: fat; | |
// } | |
// } |
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="content">...</div> | |
<aside> | |
<%= render "widget", :locals => { :respond => false } %> | |
</aside> |
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="content"> | |
<%= render "widget", :locals => { :respond => true } %> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment