-
Notifications
You must be signed in to change notification settings - Fork 16
/
_mixins.scss
28 lines (26 loc) · 941 Bytes
/
_mixins.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
@import "../constants/_colorPalette.scss";
/**
* theme-aware - Change color of a css property based on the currently active theme
*
* @param {key} CSS property
* @param {color} Color name defined in the themes under _color-palette.scss
*
* @example - @include theme-aware('background', 'color-background');
* @returns - background: #FFF;
*/
@mixin theme-aware($key, $color) {
@each $theme-name, $theme-color in $themes {
:global(.theme-#{$theme-name}) & {
#{$key}: map-get(map-get($themes, $theme-name), $color);
}
}
}
@mixin theme-aware-shadow($values, $color) {
@each $theme-name, $theme-color in $themes {
:global(.theme-#{$theme-name}) & {
-webkit-box-shadow: $values map-get(map-get($themes, $theme-name), $color);
-moz-box-shadow: $values map-get(map-get($themes, $theme-name), $color);
box-shadow: $values map-get(map-get($themes, $theme-name), $color);
}
}
}