Skip to content

Instantly share code, notes, and snippets.

@zastrow
Created June 25, 2020 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zastrow/1e488730d85440f2f6d1cf36d37e6a17 to your computer and use it in GitHub Desktop.
Save zastrow/1e488730d85440f2f6d1cf36d37e6a17 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// 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);
}
.normal {
color: deeppink;
}
.transparent {
color: rgba(255, 20, 147, 0.6);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment