Opened 5 years ago
Last modified 3 years ago
#49930 new enhancement
Replace wp-admin color schemes with CSS custom properties
Reported by: | kburgoine | Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | |
Component: | Administration | Keywords: | |
Focuses: | ui, accessibility, css | Cc: |
Description
There has been some discussion in the #core-css channel on Slack around changing the colours used for the colour schemes to use CSS Custom Properties. There are a number of complexities and issues that need to be considered before this could happen. This ticket is to capture those conversations here.
CSS custom properties have a lot of benefits including future-proofing for when media queries focussing on accessibility features are more heavily used. For example: @media (prefers-color-scheme: dark) {}
However, the biggest drawback with using CSS Custom Properties is the lack of support in older browsers: https://caniuse.com/#feat=css-variables shows no support for IE 6 - 11 and therefore a strategy for this would also have to be considered.
Some tickets/resources that already exist that could affect this discussion are:
- https://core.trac.wordpress.org/ticket/26691 Admin Color Schemes: generic classes for colors
- https://github.com/ryelle/admin-color-schemes / https://wordpress.org/plugins/admin-color-schemes/ Admin colour schemes plugin
- https://wordpress.org/plugins/dark-mode/ Dark mode feature plugin
(This is not an exhaustive list, only what has been mentioned in Slack already)
Also see this discussion in Slack: https://wordpress.slack.com/archives/CQ7V4966Q/p1586792806203800
and https://wordpress.slack.com/archives/CQ7V4966Q/p1586793176207300
Change History (44)
This ticket was mentioned in Slack in #core-css by kirstyburgoine. View the logs.
5 years ago
This ticket was mentioned in Slack in #accessibility by afercia. View the logs.
5 years ago
#4
in reply to:
↑ 2
@
5 years ago
Replying to afercia:
I'd like to remind there are plugins (and maybe themes) that use or extend the existing scss variables. I'm not sure the existing scss-based color schemes can be "replaced" as that would likely break any third-party code that is using them.
Admittedly, using 'replace' in the ticket title might be a bit misleading here. In order to support IE11 there would need to be fallback colours for browsers that don't read the CSS Custom Properties. Depending on the strategy decided, I would imagine that existing scss variables would still be used for that purpose and would then provide the compatibility needed for existing themes and plugins.
However, that could raise the potential problem of the Custom Property overwriting an existing scss variable if, how it has been scoped means that it is actually a different colour to the value stored in the scss variable. The dynamic nature of custom properties makes it so that it's not as easy as having a direct replacement.
This ticket was mentioned in Slack in #core-css by notlaura. View the logs.
5 years ago
This ticket was mentioned in Slack in #accessibility by afercia. View the logs.
5 years ago
This ticket was mentioned in Slack in #accessibility by afercia. View the logs.
5 years ago
This ticket was mentioned in Slack in #core-css by notlaura. View the logs.
4 years ago
This ticket was mentioned in Slack in #core-css by notlaura. View the logs.
4 years ago
This ticket was mentioned in Slack in #accessibility by alexstine. View the logs.
4 years ago
This ticket was mentioned in Slack in #core-css by notlaura. View the logs.
4 years ago
#12
@
4 years ago
We don't need to support IE11 now! 🥳
Current status of this is to:
- Start writing naming documentation in a Google doc
- Review / experiment / iterate in @ryelle’s PR
- Update doc draft as standards emerge
This ticket was mentioned in Slack in #core-css by notlaura. View the logs.
3 years ago
This ticket was mentioned in Slack in #core-css by danfarrow. View the logs.
3 years ago
This ticket was mentioned in Slack in #core-css by colorful-tones. View the logs.
3 years ago
This ticket was mentioned in Slack in #core-css by colorful-tones. View the logs.
3 years ago
This ticket was mentioned in Slack in #core-css by ryelle. View the logs.
3 years ago
This ticket was mentioned in Slack in #core-css by notlaura. View the logs.
3 years ago
This ticket was mentioned in Slack in #core-css by notlaura. View the logs.
3 years ago
#21
@
3 years ago
Update:
This post provides a good overview of progress so far: https://make.wordpress.org/core/2021/05/10/css-custom-properties-project-update/
We have been working on documentation and information for contributors here: https://docs.google.com/document/d/1Z0Wo1W0ZQwFJYPcJ8GlsubA9uKhcFdT8ifYnso82z9I/edit#
For contributions, each person "claims" a file to work through. That list so far is:
admin-bar.css - @ryelle
admin-menu.css - @ryelle
buttons.css - @ryelle
common.css - @ryelle
forms.css - @danfarrow
dashboard.css - @notlaura
site-health.css - @dryanpress
login.css - @dryanpress
This ticket was mentioned in Slack in #core-css by notlaura. View the logs.
3 years ago
This ticket was mentioned in Slack in #core-css by dryanpress. View the logs.
3 years ago
This ticket was mentioned in Slack in #core-css by dryanpress. View the logs.
3 years ago
This ticket was mentioned in Slack in #core-css by robertg. View the logs.
3 years ago
This ticket was mentioned in Slack in #core-css by dryanpress. View the logs.
3 years ago
This ticket was mentioned in Slack in #core-css by danfarrow. View the logs.
3 years ago
This ticket was mentioned in Slack in #core-css by danfarrow. View the logs.
3 years ago
This ticket was mentioned in Slack in #core-css by wazeter. View the logs.
3 years ago
This ticket was mentioned in Slack in #core-css by dryanpress. View the logs.
3 years ago
This ticket was mentioned in Slack in #core-css by danfarrow. View the logs.
3 years ago
This ticket was mentioned in Slack in #core-css by dryanpress. View the logs.
3 years ago
This ticket was mentioned in Slack in #core-css by wazeter. View the logs.
3 years ago
This ticket was mentioned in Slack in #core-css by wazeter. View the logs.
3 years ago
This ticket was mentioned in Slack in #core-css by wazeter. View the logs.
3 years ago
This ticket was mentioned in Slack in #design by joyously. View the logs.
3 years ago
This ticket was mentioned in Slack in #core-css by notlaura. View the logs.
3 years ago
This ticket was mentioned in Slack in #core-css by notlaura. View the logs.
3 years ago
This ticket was mentioned in Slack in #core-css by notlaura. View the logs.
3 years ago
#40
@
3 years ago
We've been keeping track of the project status in this Google doc.
As of December 9, 2021, our next steps and remaining tasks are:
- Review and merge pull requests on Kelly's wordpress-develop fork.
- Once unified on a single branch, we need to look for duplication and opportunities to normalize and consolidate. A natural by-product of one author per-file is we didn't collaborate on naming and sharing properties.
- We need to make some decisions around handling rgba() and box-shadow values.
- We need to address PHP and JS files that need to be reviewed and appropriately upgrade to Custom Properties if need be.
- We need to consider the best way for existing Core Admin Color Schemes to leverage this API.
- We need concise documentation to explain what's been done, how to leverage it and methodology/guidance for other contributors to maintain and expand on this API.
- We need to add the --experimental prefix prior to merge.
- We need to set goals and ongoing tasks (if any) to address while the --experimental API is in the wild. We also need to set project and community expectations for how the experimental API should be leveraged, when we recommend not using it and how migration to a stable set of properties will happen. Should we have a fallback where we map experimental properties to stable ones? If so, should that be opt-in or temporarily opt-out with the goal to sunset?
- Are there any properties that should permanently remain experimental, “legacy,” or “internal”? Where we wanted to address them today, but the intention is to deprecate over time as we move towards a normalized palette? Keeping a non-official prefix on them could signal that intention, discourage adoption and reduce risk of that deprecation being a surprise.
- How can we provide examples (like the suggestion of new Admin Color schemes to demonstrate) and documentation to set this project up for success and communicate timeline?
This ticket was mentioned in Slack in #core-css by notlaura. View the logs.
3 years ago
This ticket was mentioned in Slack in #core-css by notlaura. View the logs.
3 years ago
#44
@
3 years ago
@sabernhardt suggested that we maybe merge #55898 into this ticket as well. It would then mostly be about letting developers target CSS variables for colors used for notices e.g. success, warning, error, and, info.
If you have agreed on how to name the variables, it might also be developed separately but would be kept consistent in the approach on this ticket. As #55898 is much smaller and has a different aim than this ticket IMHO.
How can I help?
I'd like to remind there are plugins (and maybe themes) that use or extend the existing scss variables. I'm not sure the existing scss-based color schemes can be "replaced" as that would likely break any third-party code that is using them.
I'd tend to think a more viable approach would be:
Adding the
accessibility
focus as the accessibility team is interested in shipping new color schemes for specific accessibility needs, e.g.: low contrast, high contrast, possibly more.