Make WordPress Core

Opened 11 months ago

Last modified 10 months ago

#57167 new enhancement

Twenty Twenty-Three: Replace base and contrast color names with ref values

Reported by: mikachan's profile mikachan Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: 2nd-opinion has-patch
Focuses: Cc:

Description

There have been previous discussions around the use of "base" and "contrast" as color names in the Twenty Twenty-Three color palette, here: https://github.com/WordPress/twentytwentythree/issues/36

I'd like to propose another idea that may help solve the naming issues, especially around these two colors. We could define these two colors in styles.color.background and styles.color.text instead of defining them separately in the color palette. We could then use ref values to reference them elsewhere in the theme.json files.

The colors can still be defined in the color palette, but perhaps under a descriptive name, e.g. "dark purple". This means that the names of these two colors in the color palette would not need to match their purpose (e.g. background, foreground, base, contrast).

I've created a PR to demonstrate the idea.

Change History (2)

This ticket was mentioned in PR #3657 on WordPress/wordpress-develop by @mikachan.


11 months ago
#1

  • Keywords has-patch added

This PR replaces the base and contrast color palette names in Twenty Twenty-Three with descriptive names (e.g. "dark purple"), and uses ref values for where we were previously using var(--wp--preset--color--contrast) or var(--wp--preset--color--base).

I haven't included colors in the color palettes that are already included as part of Core, such as #000000 and #FFFFFF.

Trac ticket: https://core.trac.wordpress.org/ticket/57167

#2 @pbking
10 months ago

I rather think the values of 'base' and 'contrast' are too well established at this point to consider changing them at this point.

I'm also not keen on mixing descriptive and semantic colors in the theme palette. One or the other could make sense but combining them seems extra confusing.

Eliminating the values completely would be ideal but something I think we should consider for future themes (leveraging references to styles.color.text, styles.color.background once that is something that we have CSS variables for)

Note: See TracTickets for help on using tickets.