Skip to content
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 Theme variants #684

Merged
merged 10 commits into from Mar 24, 2020
Merged

Add Theme variants #684

merged 10 commits into from Mar 24, 2020

Conversation

tomdye
Copy link
Member

@tomdye tomdye commented Mar 11, 2020

Type: bug / feature

The following has been addressed in the PR:

Description:

Adds ability to pass both a theme and a variant to widgets via theme middleware / mixin

Related to: #683

@tomdye tomdye closed this Mar 11, 2020
@tomdye tomdye reopened this Mar 11, 2020
@tomdye tomdye changed the title Add Theme variants [WIP] Add Theme variants Mar 11, 2020
@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 11, 2020

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:

Sandbox Source
heuristic-river-x08i9 Configuration

Copy link
Member

@agubler agubler left a comment

A few thoughts

root: string;
}

export interface ThemeVariant {
Copy link
Member

@agubler agubler Mar 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this be better as ThemeWithVariant and then the interface below ThemeWithVariants?

}

export interface ThemeVariant {
theme: Theme | ThemeVariantConfig;
Copy link
Member

@agubler agubler Mar 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {
Copy link
Member

@agubler agubler Mar 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps isThemeWithVariants? or hasVariants

currentTheme.set(css);
variant() {
let theme;
const { theme: themeProp } = properties();
Copy link
Member

@agubler agubler Mar 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The theme property should be either the explicitly passed theme or the injected theme already, so can just use the property?

@agubler agubler changed the title [WIP] Add Theme variants Add Theme variants Mar 23, 2020
@tomdye tomdye merged commit 3442c85 into dojo:master Mar 24, 2020
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants