-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add basic clean-theme support and update card
, frame
patterns
#89
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,43 @@ | ||
/** | ||
* 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 and it only applies | ||
* to the client (Sidebar, Notebook) application. | ||
* | ||
* 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
@use '../atoms'; | ||
@use '../layout'; | ||
@use '../themes'; | ||
|
||
$-border-radius: var.$border-radius; | ||
$-color-background: var.$color-background; | ||
|
@@ -14,11 +15,17 @@ $-color-background: var.$color-background; | |
/** | ||
* Give an element a border, background color and internal vertical spacing | ||
*/ | ||
@mixin frame($with-hover: false) { | ||
|
||
@mixin frame { | ||
@include layout.block; | ||
@include atoms.border; | ||
border-radius: $-border-radius; | ||
background-color: $-color-background; | ||
|
||
@include themes.theme('clean') { | ||
// A frame should not have any borders in the clean theme. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both this comment and the one further down in this module are "x is 5"-type comments, but the point I'm trying to make is that we should document theme deviations and their intent. |
||
border: none; | ||
} | ||
} | ||
|
||
/** | ||
|
@@ -36,9 +43,13 @@ $-color-background: var.$color-background; | |
@include atoms.shadow($active: true); | ||
} | ||
} | ||
|
||
width: 100%; | ||
|
||
// TODO: Add clean-theme affordances | ||
@include themes.theme('clean') { | ||
// A card should have no shadows at all in the clean theme. | ||
box-shadow: none; | ||
} | ||
} | ||
|
||
/** | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Derp. This argument was unused.