Skip to content

Instantly share code, notes, and snippets.

@mdo
Created February 11, 2021 17:04
Show Gist options
  • Save mdo/8e0efb7fc7c6d6d2d55df87afe4e30c2 to your computer and use it in GitHub Desktop.
Save mdo/8e0efb7fc7c6d6d2d55df87afe4e30c2 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
$white: #fff !default;
$gray-100: #f8f9fa !default;
$gray-200: #e9ecef !default;
$gray-300: #dee2e6 !default;
$gray-400: #ced4da !default;
$gray-500: #adb5bd !default;
$gray-600: #6c757d !default;
$gray-700: #495057 !default;
$gray-800: #343a40 !default;
$gray-900: #212529 !default;
$black: #000 !default;
$blue: #007bff !default;
$indigo: #6610f2 !default;
$purple: #6f42c1 !default;
$pink: #e83e8c !default;
$red: #dc3545 !default;
$orange: #fd7e14 !default;
$yellow: #ffc107 !default;
$green: #28a745 !default;
$teal: #20c997 !default;
$cyan: #17a2b8 !default;
$primary: $blue !default;
$secondary: $gray-600 !default;
$success: $green !default;
$info: $cyan !default;
$warning: $yellow !default;
$danger: $red !default;
$light: $gray-100 !default;
$dark: $gray-800 !default;
$theme-colors: () !default;
$theme-colors: map-merge(
(
"primary": $primary,
"secondary": $secondary,
"success": $success,
"info": $info,
"warning": $warning,
"danger": $danger,
"light": $light,
"dark": $dark
),
$theme-colors
);
@function theme-color($key: "primary") {
@return map-get($theme-colors, $key);
}
$theme-colors: map-remove($theme-colors, "primary");
$primary: red;
$theme-colors: map-merge(
(
"primary": $primary
),
$theme-colors
);
.test {
color: theme-color("primary");
background-color: $primary;
}
@each $color, $value in $theme-colors {
.#{$color} { color: $value; }
}
.test {
color: red;
background-color: red;
}
.primary {
color: red;
}
.secondary {
color: #6c757d;
}
.success {
color: #28a745;
}
.info {
color: #17a2b8;
}
.warning {
color: #ffc107;
}
.danger {
color: #dc3545;
}
.light {
color: #f8f9fa;
}
.dark {
color: #343a40;
}
{
"sass": {
"compiler": "dart-sass/1.26.11",
"extensions": {},
"syntax": "SCSS",
"outputStyle": "expanded"
},
"autoprefixer": false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment