Last active
January 13, 2016 15:39
-
-
Save lemonmade/162421c7018ad83926d6 to your computer and use it in GitHub Desktop.
Ideas for using attributes as styling hooks in Shopify's admin
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
<%= ui_banner(emphasized: true, status: 'success') %> |
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
<!-- with regular BEM --> | |
<div class="ui-banner ui-banner--emphasized ui-banner--success"> | |
<div class="ui-banner__ribbon"></div> | |
<div class="ui-banner__content"></div> | |
</div> | |
<!-- with attributes --> | |
<div class="ui-banner" emphasized status="success"> | |
<div class="ui-banner__ribbon"></div> | |
<div class="ui-banner__content"></div> | |
</div> | |
<!-- with more attributes, plus some SUIT-ey style BEM for the component name --> | |
<div component="UIBanner" emphasized status="success"> | |
<div component="UIBanner-Ribbon"></div> | |
<div component="UIBanner-Content"></div> | |
</div> |
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
/* with regular BEM */ | |
.ui-banner {} | |
.ui-banner--emphasized {} | |
.ui-banner--success {} | |
.ui-banner__ribbon {} | |
/* with attributes */ | |
.ui-banner { | |
&[emphasized] {} | |
&[status="success"] {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment