Add Theme variants#684
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 22d905c:
|
| root: string; | ||
| } | ||
|
|
||
| export interface ThemeVariant { |
There was a problem hiding this comment.
Would this be better as ThemeWithVariant and then the interface below ThemeWithVariants?
| } | ||
|
|
||
| export interface ThemeVariant { | ||
| theme: Theme | ThemeVariantConfig; |
There was a problem hiding this comment.
Do you think theme should now be called css? Would make it less weird when accessing them, so would be theme.css over theme.theme
| return theme.hasOwnProperty('variant'); | ||
| } | ||
|
|
||
| function isThemeVariantConfig(theme: Theme | ThemeVariantConfig): theme is ThemeVariantConfig { |
There was a problem hiding this comment.
perhaps isThemeWithVariants? or hasVariants
| currentTheme.set(css); | ||
| variant() { | ||
| let theme; | ||
| const { theme: themeProp } = properties(); |
There was a problem hiding this comment.
The theme property should be either the explicitly passed theme or the injected theme already, so can just use the property?
Type: bug / feature
The following has been addressed in the PR:
prettieras per the readme code style guidelinesDescription:
Adds ability to pass both a theme and a variant to widgets via theme middleware / mixin
Related to: #683