Last active
May 4, 2019 12:26
-
-
Save nathanacurtis/e76777cf8a6e52b6c46888e40ddb2975 to your computer and use it in GitHub Desktop.
Text Color Across Background Colors Mixin
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 text-color($type: 'primary') { | |
// Load background colors | |
$background-colors: tokens('background-color'); | |
// Apply default text color | |
color: tokens('text-color', $type, 'on-white'); | |
// Apply text color per background color | |
@each $background, $background-color in $background-colors { | |
.container--#{$background} & { | |
color: tokens('text-color', $type, 'on-#{$background}'); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment