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

Admin Color Scheme styles leaking into the Site Editor #86778

Closed
alaczek opened this issue Jan 24, 2024 · 6 comments
Closed

Admin Color Scheme styles leaking into the Site Editor #86778

alaczek opened this issue Jan 24, 2024 · 6 comments
Assignees
Labels
Accessibility (a11y) [Feature] Full Site Editor The site editor. [Feature Group] Editor Experience Features related to Gutenberg integration on WordPress.com. [Feature] Post/Page Editor The editor for editing posts and pages. [Feature] User & Account Settings (/me) Settings and tools for managing your WordPress.com user account. [Platform] Simple [Pri] High [Status] Priority Review Triggered Quality squad has been notified of this issue in #dotcom-triage-alerts Triaged To be used when issues have been triaged. [Type] Bug

Comments

@alaczek
Copy link
Contributor

alaczek commented Jan 24, 2024

Quick summary

In the site editor, selecting the paragraph or text block turns it pink, which depending on the global styles can make the text unreadable due to low contrast. This seems to only happen on WordPress.com simple sites.

Steps to reproduce

  1. On a simple site with a block theme active, go to Appearance > Editor.
  2. Click on Templates and select any of the templates to edit.
  3. Select or create a text block (paragraph, heading, navigation, site title, etc.). Notice that it the text turns pink when the block is selected.
  4. In the global styles settings change the site background color to #DA1035. Notice the text is unreadable now when a paragraph/heading block is selected.
image

What you expected to happen

I expected for the text not to change the color at all when a text-based block is selected. This aligns with core behavior, and avoids the issue of text potentially clashing with global styles and being unreadable while editing.

What actually happened

Selecting a text-based block made it pink.

Impact

Most (> 50%)

Available workarounds?

No but the platform is still usable

Platform (Simple and/or Atomic)

Simple

Logs or notes

This seems to only happen on WordPress.com simple sites.
I was not able to replicate on a local install with WP 6.4.2 and Gutenberg 17.5.1 or on an Atomic site with Gutenberg 17.5.1

@alaczek alaczek added [Type] Bug Needs triage Ticket needs to be triaged labels Jan 24, 2024
@github-actions github-actions bot added [Status] Priority Review Triggered Quality squad has been notified of this issue in #dotcom-triage-alerts [Platform] Simple [Pri] High labels Jan 24, 2024
@liviopv
Copy link

liviopv commented Jan 24, 2024

📌 REPRODUCTION RESULTS

  • Tested on Simple – Uncertain

📌 FINDINGS/SCREENSHOTS/VIDEO
When I select text on a Simple Site in the site editor using TT4, a bluish background is applied to the selected text, in a hue that I believe is derived from the #3858e9 applied to the admin color I defined in /me/account. It's a little different than core, but it doesn't seem to cause any accessibility issue

Local Site X Simple Site comparison
CleanShot 2024-01-24 at 16 07 25@2x

📌 ACTIONS

  • Requested author feedback

📌 Message to Author
@alaczek I feel like I'm missing something here, as I'm not able to reproduce - or perhaps I didn't test the correct thing. Is it theme-specific? Or perhaps only reproducible when selecting a specific dashboard color scheme on https://wordpress.com/me/account?

@alaczek
Copy link
Contributor Author

alaczek commented Jan 24, 2024

I was able to reproduce this with a few themes (TT4, Bedrock, Smithland). You're right that it feels like it's related to the admin color scheme (Interface Settings in user profile). I switched from Bright to Default, and the issue persists. It's not about the bluish highlight though - it's about the text turning pink - I made a quick video:

Screen.Recording.2024-01-25.at.10.39.28.mov

@alaczek
Copy link
Contributor Author

alaczek commented Jan 24, 2024

It's definitely related to the interface color scheme in user profile - the text turns orange when selected if I pick the Sunset color scheme and teal when I picked Ocean color scheme. And in the Default and Bright the selected text is pink, because these two have the same accent color.
image

Possibly it's this piece of CSS leaking into the editor:
image

@liviopv liviopv added [Feature] Post/Page Editor The editor for editing posts and pages. [Feature] User & Account Settings (/me) Settings and tools for managing your WordPress.com user account. Triaged To be used when issues have been triaged. [Feature] Full Site Editor The site editor. [Feature Group] Editor Experience Features related to Gutenberg integration on WordPress.com. and removed Needs triage Ticket needs to be triaged labels Jan 25, 2024
@liviopv
Copy link

liviopv commented Jan 25, 2024

I was able to reproduce when switching to the Ocean color scheme - select text inside the editor changes color, which can cause an accessibility issue depending on the background:

CleanShot 2024-01-25 at 11 20 31@2x

@liviopv liviopv changed the title Site Editor: Selected text turns pink Admin Color Scheme styles leaking into the Site Editor Jan 25, 2024
@miksansegundo
Copy link
Contributor

We fixed a similar CSS issue related to the admin styles leaking into the editor canvas by disabling the concatenation of that asset.

The other issue was caused by the reset.css affecting the margin styles of the Heading block. See D134512-code for Gutenberg: Fix for the Heading block styles on h2 and h3 avoiding the concatenation of the editor reset.css.

@miksansegundo
Copy link
Contributor

I cannot reproduce it on TT4, or Bedrock, using Classic bright and dark admin color schemes.

@alaczek, please let us know if you can reproduce this or any other issues related to wp-admin styles leaking into the editor canvas because we know how to fix them.

Screenshot 2567-05-20 at 11 36 07 Screenshot 2567-05-20 at 11 38 50 Screenshot 2567-05-20 at 11 36 43

@miksansegundo miksansegundo self-assigned this May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accessibility (a11y) [Feature] Full Site Editor The site editor. [Feature Group] Editor Experience Features related to Gutenberg integration on WordPress.com. [Feature] Post/Page Editor The editor for editing posts and pages. [Feature] User & Account Settings (/me) Settings and tools for managing your WordPress.com user account. [Platform] Simple [Pri] High [Status] Priority Review Triggered Quality squad has been notified of this issue in #dotcom-triage-alerts Triaged To be used when issues have been triaged. [Type] Bug
Development

No branches or pull requests

4 participants