Skip to content

Instantly share code, notes, and snippets.

@nukos
Created July 6, 2016 01:50
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save nukos/7e9cdc3662ccd8d42704fe2839162272 to your computer and use it in GitHub Desktop.
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