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

Global Styles: Switching styles takes a while on the frontend #43914

Closed
jasmussen opened this issue Sep 6, 2022 · 8 comments · Fixed by #45679
Closed

Global Styles: Switching styles takes a while on the frontend #43914

jasmussen opened this issue Sep 6, 2022 · 8 comments · Fixed by #45679
Assignees
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Bug An existing feature does not function as intended

Comments

@jasmussen
Copy link
Contributor

Switching to an alternate style variation, inside the editor, is instant. Click one of the tiles and the visual is shown immediately:

Screenshot 2022-09-06 at 15 57 52

If you then save the changes and preview the site frontend, however, the styles take a while to settle in. The following GIF shows changing a style, opening the frontend in a new tab, and then reloading the page over and over to see what takes:
styles

Note that the typography and a few of the style changes are immediately shown. But things like background colors take a while, up to several minutes. Clearing the cache doesn't make any difference.

Steps to reproduce:

  • Use a block theme, such as TT3 or TT2
  • Go to the site editor
  • Switch to a different style variation (Click global styles > Browse styles > Pick one). Save the changes.
  • Click view > View site. Note that the new styles aren't applied immediately. Wait up to several minutes to reload. Eventually the whole style is applied.

Tested in Chrome on Mac.

@jasmussen jasmussen added [Type] Bug An existing feature does not function as intended Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Sep 6, 2022
@jasmussen
Copy link
Contributor Author

Just to confirm, this is running latest trunk Gutenberg and TT3.

@Mamaduka
Copy link
Member

Mamaduka commented Sep 6, 2022

Probably a duplicate of #43395, or the cause might be the same.

@jasmussen
Copy link
Contributor Author

Excellent, thank you!

Closing in favor of #43395.

Repository owner moved this from Triage to Done in WordPress 6.1 Editor Tasks Sep 6, 2022
@jasmussen jasmussen reopened this Oct 4, 2022
Repository owner moved this from Done to Triage in WordPress 6.1 Editor Tasks Oct 4, 2022
@jasmussen
Copy link
Contributor Author

Reopening as this issue does appear to be separate from #43395 after all.

@Mamaduka
Copy link
Member

Mamaduka commented Nov 8, 2022

The improvements proposed by @spacedmonkey in #56910 will also fix this issue.

The missing cache invalidation for wp_get_global_stylesheet is the cause of this problem.

@Mamaduka
Copy link
Member

Mamaduka commented Nov 9, 2022

@jasmussen, I'm thinking of bumping this issue to WP 6.2.

The problem has been around since WP 6.0, and I think we both prefer to solve it with better cache invalidation proposed in #56910.

@jasmussen
Copy link
Contributor Author

No objections from my part. It's a good one to fix, but definitely let's do it right.

@Mamaduka Mamaduka moved this from Bumped to 6.1.1 to Bumped to 6.2 in WordPress 6.1 Editor Tasks Nov 9, 2022
@Mamaduka Mamaduka moved this from Todo to Bumped to 6.2 in WordPress 6.1.x Editor Tasks Nov 9, 2022
@mmtr mmtr self-assigned this Nov 9, 2022
@oandregal
Copy link
Member

@mmtr has a PR that fixes this at #45679

There's an issue with the test but we're looking at fixing that the next week (not in time for 6.1.1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Bug An existing feature does not function as intended
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants