Skip to content
This repository has been archived by the owner on Jul 30, 2018. It is now read-only.

Remove the stacked theme order reversal to support widget extension with new theme #703

Merged
merged 1 commit into from
Oct 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/mixins/Themeable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ export function ThemeableMixin<E, T extends Constructor<WidgetBase<ThemeableProp
private _recalculateThemeClasses() {
const { properties: { injectedTheme = {}, theme = injectedTheme } } = this;
if (!this._registeredBaseThemes) {
this._registeredBaseThemes = [ ...this.getDecorator('baseThemeClasses') ].reverse();
this._registeredBaseThemes = [ ...this.getDecorator('baseThemeClasses') ];
this._checkForDuplicates();
}
const registeredBaseThemeKeys = this._registeredBaseThemes.map((registeredBaseThemeClasses) => {
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/mixins/Themeable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ class SubClassTestWidget extends TestWidget { }
@theme(baseThemeClasses2)
class StackedTestWidget extends ThemeableMixin(WidgetBase)<ThemeableProperties> { }

@theme(baseThemeClasses3)
@theme(baseThemeClasses1)
@theme(baseThemeClasses3)
class DuplicateThemeClassWidget extends ThemeableMixin(WidgetBase)<ThemeableProperties> { }

class NonDecoratorDuplicateThemeClassWidget extends ThemeableMixin(WidgetBase)<ThemeableProperties> {
constructor() {
super();
theme(baseThemeClasses1)(this);
theme(baseThemeClasses3)(this);
theme(baseThemeClasses1)(this);
}
}

Expand Down