Last active
October 26, 2017 14:53
-
-
Save laphilosophia/093b5add853a75bf69b8b90d51a2e876 to your computer and use it in GitHub Desktop.
Sass each sample
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
@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