Skip to content

Commit

Permalink
Add mixin for theming multiple properties at once
Browse files Browse the repository at this point in the history
  • Loading branch information
frontdevde committed Jul 11, 2017
1 parent a82c782 commit 990c4bb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion assets/stylesheets/shared/mixins/_custom-properties.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand All @@ -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 );
}
}

0 comments on commit 990c4bb

Please sign in to comment.