Skip to content

Add Theme variants#684

Merged
tomdye merged 10 commits into
dojo:masterfrom
tomdye:theme-variants
Mar 24, 2020
Merged

Add Theme variants#684
tomdye merged 10 commits into
dojo:masterfrom
tomdye:theme-variants

Conversation

@tomdye
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
Member

@agubler agubler left a comment

Choose a reason for hiding this comment

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

A few thoughts

Comment thread src/core/interfaces.d.ts Outdated
root: string;
}

export interface ThemeVariant {
Copy link
Copy Markdown
Member

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?

Comment thread src/core/interfaces.d.ts Outdated
}

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

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

Comment thread src/core/middleware/theme.ts Outdated
return theme.hasOwnProperty('variant');
}

function isThemeVariantConfig(theme: Theme | ThemeVariantConfig): theme is ThemeVariantConfig {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

perhaps isThemeWithVariants? or hasVariants

Comment thread src/core/middleware/theme.ts Outdated
currentTheme.set(css);
variant() {
let theme;
const { theme: themeProp } = properties();
Copy link
Copy Markdown
Member

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
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.

2 participants