WordPress.org

Make WordPress Core

Opened 3 months ago

Last modified 2 months ago

#49930 new enhancement

Replace wp-admin color schemes with CSS custom properties

Reported by: kburgoine Owned by:
Milestone: Awaiting Review 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:

(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 (7)

This ticket was mentioned in Slack in #core-css by kirstyburgoine. View the logs.


3 months ago

#2 follow-up: @afercia
3 months ago

  • Focuses accessibility added

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:

  • the existing scss-based stuff should be kept in place
  • consider to establish a deprecation policy with a clear roadmap
  • new color schemes should use new, better, patterns i.e. CSS Custom Properties, as proposed in this ticket

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.

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.


3 months ago

#4 in reply to: ↑ 2 @kburgoine
3 months 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.


2 months ago

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.


2 months ago

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.


2 months ago

Note: See TracTickets for help on using tickets.