Skip to content

Instantly share code, notes, and snippets.

@laphilosophia
Last active October 26, 2017 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laphilosophia/093b5add853a75bf69b8b90d51a2e876 to your computer and use it in GitHub Desktop.
Save laphilosophia/093b5add853a75bf69b8b90d51a2e876 to your computer and use it in GitHub Desktop.
Sass each sample
@mixin size($width, $height: $width) {
width: $width;
height: $height;
}
@mixin display($display, $align: false) {
display: $display;
@if $align {
vertical-align: $align;
}
}
$icons: (
home: 'home-icon',
bio: 'bio-icon',
gallery: 'gallery-icon',
works: 'works-icon',
contact: 'contact-icon',
hire: 'hire-icon'
);
@each $id, $url in $icons {
.icon-#{$id} {
@include size(36px);
@include display(inline-block, bottom);
&::after {
@include size(100%);
background: {
image: url(../images/#{$url}.svg);
repeat: no-repeat;
position: center;
size: contain;
};
content: "";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment