-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic clean-theme support and update
card
, frame
patterns
Add a theming mixin to allow other mixins to define rules that should apply for a given theme. Add some affordances to the `card` and `frame` molecule patterns for the `clean` theme and update pattern-library examples.
- Loading branch information
1 parent
27f98fa
commit cd24a16
Showing
4 changed files
with
87 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* This mixin allows other mixins to declare rules that should only apply | ||
* when a particular theme is active. The only known theme at present is | ||
* the "clean" theme. | ||
* | ||
* The client application provides relatively minimalistic support for a | ||
* "clean" theme by applying a `theme-clean` class to the application container | ||
* element. | ||
* | ||
* For example, let's say that the clean-theme variant of a pattern called | ||
* `banana` should not have any borders applied. Its mixin can be written: | ||
* | ||
* @mixin banana { | ||
* border: 1px solid pink; | ||
* @include theme('clean') { | ||
* border: none; | ||
* } | ||
* } | ||
* | ||
* .hyp-banana { | ||
* @include banana; | ||
* } | ||
* | ||
* This would result in CSS: | ||
* | ||
* .hyp-banana { | ||
* border: 1px solid pink; | ||
* } | ||
* | ||
* .theme-clean .hyp-banana { | ||
* border: none; | ||
* } | ||
* | ||
* Note: As implemented here, theming increases specificity. Rules defined in | ||
* theming cannot be overridden with utility classes as currently structured. | ||
*/ | ||
@mixin theme($theme-name) { | ||
.theme-#{$theme-name} & { | ||
@content; | ||
} | ||
} |
This file contains 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 characters