-
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
Conversation
@include atoms.border; | ||
@include layout.vertical-rhythm; | ||
|
||
padding: $-space; | ||
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 comment
The 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.
@@ -15,13 +16,18 @@ $-space: var.$layout-space; | |||
/** | |||
* Give an element a border, background color and internal vertical spacing | |||
*/ | |||
@mixin frame($with-hover: false) { |
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.
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.
The "clean" theme mainly exists to satisfy the needs of a specific customer in the client. We may need to have it in the pattern library for that reason but we probably don't want to encourage its use elsewhere. Perhaps this is just something that can be noted in the docs. I wonder whether this mechanism could potentially support something more generally useful like a dark theme in future?
And don't I know it! And there's more, because to get the intended full effect of the clean theme, you also need to configure the client with several I'm going to think about this a little more. Maybe this customization belongs entirely in the client. There are kind of two problems involved here:
On a tactical level, I wonder if this package should aim to keep all non-component specificity at (0, 0, 1, 0) or lower (that translates to a single class selector), and leave higher specificity to applications that use it. That may be too extreme, but it's a thought... |
cd24a16
to
2c9a70d
Compare
After some soul-searching and reflection, I would like to opt to move forward with this approach to theming, in which this package applies some clean-theme styles. The “clean” theme is only relevant to the But there’s no way to implement the theming affordances for the client-only clean theme without leakage about that theming in some way:
In looking at those two, the first (this PR’s direction) seems less problematic to me at present, additionally because:
A side note about Modals: Although Modals are styled with the |
Codecov Report
@@ Coverage Diff @@
## main #89 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 8 8
Lines 121 121
Branches 36 36
=========================================
Hits 121 121 Continue to review full report at Codecov.
|
This is potentially a little brittle. We can probably accept the risk for the moment, but if we can find a way to more directly enforce the non-usage of the "clean" theme inside modals that might prevent accidental breakage in future. |
I'm working on replacing |
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.
2c9a70d
to
a421e98
Compare
This PR solves #85 by:
theme
mixin that other mixins can use to apply theme-specific stylescard
andframe
mixins to theme for theclean
themeI'm hoping that the changes themselves will obviate further explanation here (that's the goal here, anyway).
To finish #85, after #88 is resolved, we'll want to go back in and see how the modal components look in a clean theme. We may wish, e.g., to apply borders to modals even in the clean theme.(This is done)Fixes #85