Skip to content

Conversation

@ilhan007
Copy link
Contributor

@ilhan007 ilhan007 commented Mar 16, 2023

There are use-cases when the framework boots, but the theme has not been registered and applied.
And, currently the framework won't apply a theme after boot finishes.
With this PR the framework will apply theme properties always when theme registration occurs.

  • when the theme properties are registered before boot, an event will be fired, notifying for the theme registration, but as the boot did not finish, the event will be disregarded and the theme will be applied as usual.
  • when the theme properties are being registered after boot, an event will be fired, notifying for the theme registration and the registered styles will be applied.

Fixes: #6666

if (!booted) {
return;
}
applyTheme(getTheme());
Copy link
Contributor

Choose a reason for hiding this comment

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

may be we should check if the theme registered is the one that will be applied getTheme. there is no need to call applyTheme if the registered theme won't be applied.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, check is added with the commit chore: address review comments

@ilhan007 ilhan007 requested a review from pskelin March 17, 2023 11:53
@ilhan007 ilhan007 merged commit 9b6c414 into main Mar 17, 2023
@ilhan007 ilhan007 deleted the fix-themeload branch March 17, 2023 13:38
NHristov-sap pushed a commit that referenced this pull request May 4, 2023
There are use-cases when the framework boots, but the theme has not been registered and applied.
And, currently the framework won't apply a theme after boot finishes.
With this PR the framework will apply theme properties always when theme registration occurs.
when the theme properties are registered before boot, an event will be fired, notifying for the theme registration, but as the boot did not finish, the event will be disregarded and the theme will be applied as usual.
when the theme properties are being registered after boot, an event will be fired, notifying for the theme registration and the registered styles will be applied.

Fixes: #6666
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Breadcrumbs: theming stylesheet not properly injected in NextJS

3 participants