Make WordPress Core

Opened 8 months ago

Closed 8 months ago

Last modified 8 months ago

#58598 closed enhancement (fixed)

Allow non-block themes to add theme support for border settings

Reported by: poena's profile poena Owned by: audrasjb's profile audrasjb
Milestone: 6.3 Priority: normal
Severity: normal Version:
Component: Themes Keywords: has-patch has-screenshots commit needs-docs has-dev-note
Focuses: Cc:

Description

Allow themes without theme.json to opt-in to block border tools via:
add_theme_support( 'border' );

Follow up to https://core.trac.wordpress.org/ticket/57460 and https://core.trac.wordpress.org/ticket/57649 with a more limited scope than 'appearance-tools'.

Corresponding Gutenberg PR: https://github.com/WordPress/gutenberg/pull/51777

Attachments (3)

58598.diff (938 bytes) - added by poena 8 months ago.
Updates theme support in wp-includes/class-wp-theme-json-resolver.php
Capture d’écran 2023-06-22 à 13.49.43.png (181.5 KB) - added by audrasjb 8 months ago.
Before patch: no border styling :((
Capture d’écran 2023-06-22 à 13.49.25.png (194.1 KB) - added by audrasjb 8 months ago.
After patch: border styling for the win \o/

Download all attachments as: .zip

Change History (8)

@poena
8 months ago

Updates theme support in wp-includes/class-wp-theme-json-resolver.php

#1 @poena
8 months ago

  • Keywords has-patch added

Testing instructions

Activate a classic theme.

Open the themes functions.php and locate a setup function or similar that uses add_action( 'after_setup_theme',.For example, if you are using Twenty Twenty-One, look for the function called twenty_twenty_one_setup()

Add add_theme_support( 'border' ); inside that function.

Open the block editor.
Add a block that supports borders, for example, a group.
Confirm that the border controls are available in the block settings sidebar.

Adjust the border width, style, and radius.
Select a custom border color using the color picker. Confirm that the border works in the editor and the front.

  • I am suggesting the color picker because themes need to add their own CSS to make the custom theme palette colors work.
  • Some themes already style the block borders; it is up to each theme developer to adjust CSS where needed if they want to opt-in to the controls.

@audrasjb
8 months ago

Before patch: no border styling :((

@audrasjb
8 months ago

After patch: border styling for the win \o/

#2 @audrasjb
8 months ago

  • Keywords has-screenshots commit added
  • Owner set to audrasjb
  • Status changed from new to accepted

Thanks for the ticket and patch, this is a great addition for classic themes!
Succesfuly tested on my side. Thanks for the detailed testing instructions.

#3 @audrasjb
8 months ago

  • Keywords needs-docs needs-dev-note added

#4 @audrasjb
8 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 55995:

Themes: Allow non-block themes to add theme support for border settings.

This changeset allows themes without theme.json to opt-in to block border tools via add_theme_support( 'border' );.

Follow-up to [55067], [55273].

Props poena, audrasjb.
Fixes #58598.

#5 @stevenlinx
8 months ago

  • Keywords has-dev-note added; needs-dev-note removed
Note: See TracTickets for help on using tickets.