Skip to content

Instantly share code, notes, and snippets.

@bryanjvolz
Created January 28, 2022 02:32
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 bryanjvolz/adc04553bab05b5a1b85da65452cec3e to your computer and use it in GitHub Desktop.
Save bryanjvolz/adc04553bab05b5a1b85da65452cec3e to your computer and use it in GitHub Desktop.
//Color Theme
$colors-theme: (
lighter_grey: #f4f4f4,
light_grey: #f6f6f6,
light_grey2: #f3f3f3,
mid_grey: #5c6061,
main_blue: #2e79bb,
main_blue2: #518ebe,
orange: #f99f42,
red: #de1b54,
dark_purple: #26235d,
mid_purple: #615f89,
green: #6cc049,
white: #fff,
black: #000
);
@function get-color($color){
$color: map-get($colors-theme, $color);
@return $color;
}
@function set-color-from-background($color) {
@if (lightness($color) > 50) {
@return get-color(black); // Lighter background, return dark color
} @else {
@return get-color(white); // Darker background, return light color
}
}
@function rem($pixels, $context: $font-size) {
@return #{$pixels/$context}rem;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment