Last active
August 29, 2015 14:16
-
-
Save daneden/4bc6eb47c29faa8b2d2a to your computer and use it in GitHub Desktop.
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
/* objects/_card.scss */ | |
.card { | |
padding: round($u-baseline / 2); | |
background-color: #fff; | |
border: 1px solid rgba(color(black), .1); | |
box-shadow: 0 1px 2px rgba(color(black), .1); | |
border-radius: 3px; | |
} | |
// Whoa ok but what about edge-to-edge content inside .card? You gonna have | |
// modifiers for all the different layout changes to this thing? | |
// | |
// Let's try something different | |
/* objects/_card.scss */ | |
.o-card { | |
background-color: #fff; | |
border: 1px solid rgba(color(black), .1); | |
box-shadow: 0 1px 2px rgba(color(black), .1); | |
border-radius: 3px; | |
// Plus maybe some modifiers... | |
// &.o-card--arrow { | |
// [...] | |
// } | |
} | |
/* helpers/_layout.scss */ | |
.l-isle { | |
padding: round($u-baseline / 2); | |
&--v { | |
padding: { | |
top: round($u-baseline / 2); | |
bottom: round($u-baseline / 2); | |
} | |
} | |
} | |
// Now that's how the pros roll | |
// :sparkles: |
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
<!-- chump --> | |
<div class="card"> | |
Whoa, a card with some content with layout and style all smushed together ew | |
</div> | |
<!-- champ --> | |
<div class="o-card l-isle"> | |
Whoa, a card with some content with LAYOUT TOTALLY INDEPENDENT FROM STYLE ZOMG | |
</div> | |
<div class="o-card"> | |
<img src="whatever.jpg" alt="some wicked photo that’s edge-to-edge in this card" /> | |
<div class="o-card__content l-isle"> | |
omg I didn’t even have to do anything crazy | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👏