Created
June 25, 2020 17:46
-
-
Save zastrow/35955ff0870d9d7f0c586a1d6f449367 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
// ---- | |
// Sass (vundefined) | |
// Compass (vundefined) | |
// dart-sass (v1.18.0) | |
// ---- | |
$color1: deeppink; | |
$color2: dodgerblue; | |
$color3: lime; | |
$colors: ( | |
'primary': $color1, | |
'secondary': $color2, | |
'tertiary': $color3 | |
); | |
@function color($name, $alpha:null) { | |
$color: map-get($colors, $name); | |
@if $alpha { | |
@return rgba($color, 0.6); | |
} | |
@else { | |
@return $color; | |
} | |
} | |
.normal { | |
color: color(primary); | |
} | |
.transparent { | |
color: color(primary, alpha); | |
} | |
.util-color { | |
@each $key, $value in $colors { | |
&-#{$key} { | |
color: color($key); | |
} | |
&-#{$key}-transparent { | |
color: color($key, true); | |
} | |
} | |
} |
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
.normal { | |
color: deeppink; | |
} | |
.transparent { | |
color: rgba(255, 20, 147, 0.6); | |
} | |
.util-color-primary { | |
color: deeppink; | |
} | |
.util-color-primary-transparent { | |
color: rgba(255, 20, 147, 0.6); | |
} | |
.util-color-secondary { | |
color: dodgerblue; | |
} | |
.util-color-secondary-transparent { | |
color: rgba(30, 144, 255, 0.6); | |
} | |
.util-color-tertiary { | |
color: lime; | |
} | |
.util-color-tertiary-transparent { | |
color: rgba(0, 255, 0, 0.6); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment