Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example: Atomic Design for SCSS
@mixin atom-overlay-badges {
position: absolute;
margin: 0;
padding: vr(.2) vr(.3);
line-height: vr(1);
font-size: modular-scale(-4);
font-weight: bold;
color: #fff;
letter-spacing: vr(.05);
text-indent: vr(.05);
background: #ccc;
border-radius: vr(.1);
//override styles
@content;
}
@import 'atom-overlay-badges';
.component {
.badge {
@include atom-overlay-badges() {
top: vr(-.25);
right: vr(-.25);
background: #111;
}
}
}
@nukos
Copy link
Author

nukos commented Jul 6, 2016

mixinを利用してAtomを作ることにより、extend のようにソースを汚すことなく再利用することができる。

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment