Last active
January 31, 2020 14:40
-
-
Save akmil/d036474c6de60cf5141692ad471306ae to your computer and use it in GitHub Desktop.
Revisions
-
akmil revised this gist
Jan 31, 2020 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -44,12 +44,13 @@ $color-default: map-deep-get($themes-names, "primary", "color"); /* generate &.theme-primary{...} and &.theme-dark{...} */ @include wrappedTheme($themes-names); /*override*/ &.theme-#{$darkName} { border: 5px solid $color-default; color: $white; } /* can override/extend specific theme --modifier */ &.theme-#{$primaryName}--modifier { @include print(map-deep-get($themes-names, $primaryName)); /* will add all from: $themes-names[$primaryName] -
akmil revised this gist
Jan 31, 2020 . 1 changed file with 7 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -51,7 +51,13 @@ $color-default: map-deep-get($themes-names, "primary", "color"); /* can override specific theme --modifier */ &.theme-#{$primaryName}--modifier { @include print(map-deep-get($themes-names, $primaryName)); /* will add all from: $themes-names[$primaryName] /--- background: $white, color: $dark-grey, font-size: 18px, */ font-size: 22px; } -
akmil revised this gist
Jan 31, 2020 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -48,6 +48,12 @@ $color-default: map-deep-get($themes-names, "primary", "color"); border: 5px solid $color-default; color: $white; } /* can override specific theme --modifier */ &.theme-#{$primaryName}--modifier { @include print(map-deep-get($themes-names, $primaryName)); font-size: 22px; } color: $color-default; -
akmil renamed this gist
Jan 31, 2020 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
akmil created this gist
Jan 31, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,54 @@ $themes-names: ( primary: ( background: $white, color: $dark-grey, font-size: 18px, ), dark: ( background: $dark, font-size: 10px, ) ); $primaryName: "primary"; $darkName: "dark"; @function map-deep-get($map, $keys...) { @each $key in $keys { $map: map-get($map, $key); } @return $map; } @mixin print($declarations) { @each $property, $value in $declarations { #{$property}: $value } } @mixin wrappedTheme($declarations) { @each $theme, $value in $declarations { $selector: "&.theme-#{$theme}"; #{$selector} { @include print(map-deep-get($themes-names, $theme)); } } } $color-default: map-deep-get($themes-names, "primary", "color"); .button-themed { @extend %button; /* generate &.theme-primary{...} and &.theme-dark{...} */ @include wrappedTheme($themes-names); &.theme-#{$darkName} { border: 5px solid $color-default; color: $white; } color: $color-default; }