Created
October 31, 2018 11:10
-
-
Save krman009/30a70d9eea61eee887b0672bb01d2d31 to your computer and use it in GitHub Desktop.
Sass map and list
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
$color-theme: ( | |
primary: #ffcc09, | |
secondary: #0022be, | |
accent: #345844 | |
); | |
@function get-color($color) { | |
@return map-get($color-theme, $color); | |
} | |
.div_first { | |
color: get-color(primary); | |
} | |
.div_second { | |
color: get-color(secondary); | |
} | |
.div_third { | |
color: get-color(accent); | |
} | |
$color-list: (#ffcc09, #0022be, #345844); | |
.div_fourth { | |
color: nth($color-list, 1) // lists start with 1 so value will be #ffcc09 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment