Created
January 24, 2023 11:14
-
-
Save mhed89/fbf58cecf0c038a012e38727e5e33a8c to your computer and use it in GitHub Desktop.
scss mixin for icon element
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 svg-icon($name, $height: 24, $width: 24, $color: $color-primary) { | |
| -webkit-mask-size: contain; | |
| -webkit-mask-repeat: no-repeat; | |
| -webkit-mask-position: center; | |
| height: calc($height / $base-font-size) + rem; | |
| width: calc($width / $base-font-size) + rem; | |
| background-color: $color; | |
| mask-image: url(~@images/icons/#{$name}.svg); | |
| background-size: cover; | |
| mask-size: contain; | |
| mask-position: center; | |
| mask-repeat: no-repeat; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment