From 990c4bb7bd225671d6cb8792763407da5c604a34 Mon Sep 17 00:00:00 2001 From: "Michael P. Pfeiffer" Date: Fri, 30 Jun 2017 14:11:37 +0300 Subject: [PATCH] Add mixin for theming multiple properties at once --- .../stylesheets/shared/mixins/_custom-properties.scss | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/assets/stylesheets/shared/mixins/_custom-properties.scss b/assets/stylesheets/shared/mixins/_custom-properties.scss index 3de1d6789ca125..e431ce94129b58 100644 --- a/assets/stylesheets/shared/mixins/_custom-properties.scss +++ b/assets/stylesheets/shared/mixins/_custom-properties.scss @@ -7,6 +7,9 @@ // @include custom-property( color, --text-color, $text-color ); // @include custom-property-from-map( color, --text-color, $text-color ); // @include theme( color, --text-color ); +// @include theme-multiple( +// ('color': --text-color, 'background': --bg-color, 'border-color': --border-color); +// ) // ========================================================================== @mixin custom-property( $property, $custom-property, $fallback ) { @@ -19,7 +22,13 @@ #{ $property }: var( $custom-property, map-deep-get( $map, $keys... ) ); } -// custom mixin for theming with custom properties based on $color-schemes map (see _themes.scss) +// custom mixins for theming with custom properties based on $color-schemes map (see _themes.scss) @mixin theme( $property, $custom-property ) { @include custom-property-from-map( $property, $custom-property, $color-schemes, 'default', $custom-property ); } + +@mixin theme-multiple ($theme-properties) { + @each $property, $custom-property in $theme-properties { + @include theme( $property, $custom-property ); + } +}