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: enqueue styles later so theme css can load first #34147

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

@creativecoder
Copy link
Contributor

@creativecoder creativecoder commented Aug 18, 2021

Description

Deenqueues and deregisters the 'global-styles' asset enqueued by Core, and reenqueues it on a later priority.

This allows theme css enqueued on the default priority to load first, so that a user's Global Style settings take precedence over theme css (particularly in the case of equal css selector weight).

Fixes #34141

Example of conflicts with themes: Automattic/themes#4435

How has this been tested?

Ensure that Global styles is loaded after the theme css on the page.

Screenshots

Screen Shot 2021-08-18 at 14 09 34

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).
Copy link
Contributor

@jeyip jeyip left a comment

Testing

Requirements

  • With the blockbase theme, the global-styles-inline-css stylesheet is loaded after theme stylesheets
  • With the mayland blocks theme, the global-styles-inline-css stylesheet is loaded after theme stylesheets

Browsers

  • Edge
  • Firefox
  • Safari
  • Chrome

This makes sense to me 👍 Waiting for folks with more global styles experience to chime in before +1

Copy link
Member

@nosolosw nosolosw left a comment

The current behavior is how it's expected to work, so going to ask for more info on the issue before we go further with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants