Created
September 6, 2019 00:41
-
-
Save younes-dro/f9ea9ac8504f80fe033b109c92cbde0f to your computer and use it in GitHub Desktop.
generate custom widget glyph icon using Sass : loop , mixin , map
This file contains hidden or 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 sidebar-title-icon($content){ | |
.widget-title{ | |
&::before{ | |
font-family: "Ionicons"; | |
content: $content; | |
display: inline-block; | |
margin: 0 10px 0 0; | |
} | |
} | |
} | |
$widgets : ( | |
"archive":"\f134", | |
"tag_cloud":"\f377", | |
"categories":"\f26c", | |
"search":"\f4a5", | |
"calendar":"\f3f4", | |
"recent_comments":"\f11e", | |
"text":"\f12e", | |
"nav_menu":"\f394", | |
"recent_entries":"\f37e", | |
"meta":"\f48d", | |
"pages":"\f381") ; | |
@each $widget , $glyph in $widgets{ | |
.widget_#{$widget}{ | |
@include sidebar-title-icon($glyph); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment