Make global styles available to all themes #34334
Open
Conversation
They just differ on what data they have: 1. Without theme.json and no experimental-link-color support either: the stylesheet contains the core presets & styles. 2. Without theme.json but experimental-link-color support: the stylesheet contains the core and theme presets, plus the core styles if any. 3. With theme.json: the stylesheet contains the core and theme presets, plus the result of merging core & theme styles.
@youknowriad I'm seeing this piece of CSS in addition to the presets output for TwentyTwentyOne and TwentyTwenty. I presume this doesn't have to be enqueued unless there's a body {
--wp--style--block-gap: 24px;
}
.wp-site-blocks > * + * {
margin-top: var(--wp--style--block-gap);
margin-bottom: 0;
} |
ok, removed the block gap styles for TwentyTwentyOne and TwentyTwenty. |
The test cases work for me as described.
There may be a harmless edge case here:
|
@jffng That seems to happen in the transition from a theme with |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Fixes #34328
This PR makes global styles available to all themes.
How to test
Activate TT1-blocks: a theme with
theme.json
support. Visit the front end. Check the content ofglobal-styles-inline-css
is:Activate the TwentyTwentyOne theme: a theme without theme.json but with
experimental-link-color
support. Visit the front end. Check the content ofglobal-styles-inline-css
is:Activate the TwentyTwenty theme: a theme without theme.json and no
experimental-link-color
support. Visit the front end. Check the content ofglobal-styles-inline-css
is:Follow-ups
Remove the styles included here from the
block-library
package.