Opened 6 weeks ago
Last modified 2 days ago
#63553 new defect (bug)
Administration: Color Schemes are not properly applied on individual attachment within media views
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Media | Keywords: | has-patch has-screenshots needs-testing |
Focuses: | ui, css, administration | Cc: |
Description
In the Media Library dialog, where users select from listed attachments, individual attachments do not fully reflect the user's selected color scheme. This is often due to CSS specificity issues, that is, styles in media-views.css
have higher specificity and override the selected color scheme styles. Ideally, the specificity of styles within media-views.css
should match that of the color scheme styles to allow proper theming overrides.
In the snippets above, notice that the .wp-core-ui
is omitted from _admin.scss
, which leads to lower CSS specificity, and the color scheme styles do not get properly applied. Also, notice the extra theme-related styles (example: for the :focus
pseudo-selector) which are also omitted altogether from _admin.scss
.
This bug is quite noticeable for users using administration color schemes other than the default within the Gutenberg Editor.
To reproduce, perform the following steps:
- Set a different administration color scheme (preferably Midnight).
- Create a new post and insert a
core/file
block. - Click on
Media Library
and click on a particular attachment. - Notice that the attachment selection styles do not comply with the selected administration color scheme.
Attachments (4)
Change History (11)
This ticket was mentioned in PR #8943 on WordPress/wordpress-develop by @yogeshbhutkar.
6 weeks ago
#1
- Keywords has-patch added
### Description
This PR ensures that the selected admin color scheme is correctly applied to individual attachments in the Media Library. Previously, due to CSS specificity issues, custom color schemes were overridden, leading to inconsistent styling.
Trac ticket: https://core.trac.wordpress.org/ticket/63553
### Screenshots
Before | After |
---|---|
#3
follow-up:
↓ 4
@
5 weeks ago
Hi @yogeshbhutkar, In addition to this, I would also like to update the select dropdown and input text (or any other input text) to be use the same border color on focus that is being set as user preference.
This is because, when we change the user settings to use another color, the gutenberg components respects that color for example, on focus input border color is same as user preference (see the screenshot), but on the media select popup, if you focuses on search media or filter it via date, when focused, it uses the default color being set here - https://github.com/WordPress/wordpress-develop/blob/eeb8fbf81bfc3fe83efd9bc327ac5015211b76b7/src/wp-includes/css/media-views.css#L128-L139, instead it should use the color set as a user preference.
We need to change the specificity as you correctly updated for the media selection checkbox and border for that, we need to accomodate for the same.
Let me know if that should be the case and should we update that?
Edit: I do check the posts/page/media screen, it adds the correct border color on focus (that is user preference color), hence we should definately update the media popup box to use the user preference color, instead of default one.
Thank You,
#4
in reply to:
↑ 3
@
5 weeks ago
Replying to hbhalodia:
In addition to this, I would also like to update the select dropdown and input text (or any other input text) to be use the same border color on focus that is being set as user preference.
I agree with this change and the reasoning behind it. I've updated my PR accordingly to reflect this adjustment.
Notice the color scheme is applied everywhere except the individual attachment selection.