Created
September 25, 2024 11:04
-
-
Save mlebkowski/4317c4574cd237e7b57ef88791021079 to your computer and use it in GitHub Desktop.
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
$icon-size: 16px; | |
$icon-sizes: ( | |
sm: $icon-size / 1.5; | |
md: $icon-size; | |
lg: $icon-size * 1.5; | |
) |
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
@function get-map-value($map, $keys...) { | |
@each $key in $keys { | |
$isValidKey: map-has-key($map, $key); | |
@if ($isValidKey == false) { | |
@warn "There is no element with key: '#{$key}'."; | |
@return null; | |
} | |
$map: map-get($map, $key); | |
} | |
@return $map; | |
} |
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
.some-component { | |
$__icon { | |
--icon-size: get-map-value($icon-sizes, sm) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment