Last active
December 21, 2018 06:26
-
-
Save russweas/774e01743ca63aa73b45 to your computer and use it in GitHub Desktop.
Stylus BEM mixins
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
// Mixins.styl | |
has($name) | |
/&__{$name} | |
{block} | |
variant($name) | |
/&--{$name} | |
{block} | |
// Alert.styl | |
.Alert | |
background: lighten(gray, 80%) | |
padding: 15px | |
+has(close-button) | |
right: 10px | |
position: absolute | |
cursor: pointer | |
+variant(Success) | |
util-color(green) | |
// index.html | |
<div class="Alert Alert--Success"> | |
<p>Lorem ipsum...</p> | |
<span class="Alert__close-button" @click="close"> | |
x | |
</span> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment