-
Notifications
You must be signed in to change notification settings - Fork 872
Jetpack loads unscoped CSS in the editor #28038
Copy link
Copy link
Closed as not planned
Labels
BugWhen a feature is broken and / or not performing as intendedWhen a feature is broken and / or not performing as intendedNeeds triageTicket needs to be triagedTicket needs to be triaged[Closed] DuplicateDuplicate of an existing issue.Duplicate of an existing issue.[Plugin] JetpackIssues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/[Pri] High
Metadata
Metadata
Assignees
Labels
BugWhen a feature is broken and / or not performing as intendedWhen a feature is broken and / or not performing as intendedNeeds triageTicket needs to be triagedTicket needs to be triaged[Closed] DuplicateDuplicate of an existing issue.Duplicate of an existing issue.[Plugin] JetpackIssues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/[Pri] High
Impacted plugin
Jetpack
Steps to Reproduce
When Jetpack plugin is active and connected, following CSS gets loaded at the editor:
Especially applying
box-sizing: border-box;so widerly from a plugin is problematic. We discovered (p1671618034894909-slack-CBTN58FTJ) that this was causing "reading time" panel in Gutenberg to break visually:Protecting the element better from such breakage in Gutenberg fixes the issue, but this could still be causing more trouble elsewhere.
The CSS originates from Jetpack base styles package, imported in blocks related code added in the PR 3 months ago:
jetpack/projects/plugins/jetpack/extensions/index.scss
Lines 1 to 3 in a958428
Typically styles in such packages are wrapped in mixins or functions to avoid outputting CSS on mere import;
if imported sass file outputs CSS on import, you might end up the same CSS multiple times in bundles, importing more than you intendendent, etc.
Overly global selectors are avoided as well and instead CSS should be applied to more specific wrapper elements.
See Gutenberg base styles as an example:
A clear and concise description of what you expected to happen.
I think there are multiple issues at play:
bodyand*).What actually happened
No response
Browser
No response
Other information
No response
Platform (Simple, Atomic, or both?)
No response
Reproducibility
Consistent
Severity
All
Available workarounds?
No but the platform is still usable
Workaround details
No response