Skip to content

Remove experimental-link-color dependancy in global styles#2236

Closed
tommusrhodus wants to merge 1 commit intoWordPress:trunkfrom
tommusrhodus:ticket/54954-remove-link-color-dependancy
Closed

Remove experimental-link-color dependancy in global styles#2236
tommusrhodus wants to merge 1 commit intoWordPress:trunkfrom
tommusrhodus:ticket/54954-remove-link-color-dependancy

Conversation

@tommusrhodus
Copy link
Copy Markdown

Since 5.9 it appears that fonts and colours defined in theme.json will correctly override the default values of --wp--preset-- variables, however those defined via add_theme_support are not, and so the default values are still being used.

This is being triggered by whether or not a theme calls add_theme_support( 'experimental-link-color' )

A simple way to test what's going on here:

  1. Open a blank install with the Twenty-Twenty-One theme installed.
  2. Create a new page and add paragraph text with the font size set to large and set the background color to black
  3. Open functions.php and edit line 170 to change the large font size, and then edit line 203 to change the black color and save.

Result: Paragraph text correctly reflects changes made to font size and color.

  1. Open functions.php and delete line 333: add_theme_support( 'experimental-link-color' );

Result: Font size and color fallback to WP default values.

Expected behaviour: Font sizes and colors set via add_theme_support should continue to work as pre 5.9 without the need to add add_theme_support( 'experimental-link-color' ); or theme.json

This PR removes experimental-link-color dependancy in wp-includes/global-styles-and-settings.php for themes to be able to update --wp--preset variables without the need to setup theme.json or add theme support for an experimental feature.

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

Removes experimental-link-color dependancy in global styles for themes to be able to update --wp--preset variables.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant