Repository navigation
Open
Labels
Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Status] In ProgressTracking issues with work in progress
Description
Description
Unlinking the border sides of a block in Global Styles has two problems when the theme sets a border on that block in theme.json:
- Null values are saved. The editor writes
"color": null, "style": null, "width": nullinto the user's global styles and saves them. Tools that export global styles into a theme (such as Create Block Theme) then copy the nulls intotheme.json, which the theme.json schema rejects. - A shorthand width is copied into each side. If the theme's
widthuses the shorthand (for example"0 0 0 2px"), unlinking copies that whole string into each side.border-top-width: 0 0 0 2pxis not valid CSS, so the browser falls back to the default width, and the top, right and bottom borders appear (about 3px). Changing only the left border turns the block into a full box.
Step-by-step reproduction instructions
- Activate Twenty Twenty-Five. Its
theme.jsonhasstyles.blocks["core/quote"].border:{"style":"solid","width":"0 0 0 2px","color":"currentColor"}. - Go to Site Editor → Styles → Blocks → Quote → Borders.
- Click "Unlink sides".
- Set the left width to
4px. - Look at the Quote preview, then save.
Expected
- The saved global styles contain only the per-side values that were set, with no
nullkeys. - The other sides keep what the theme showed: no border on top, right and bottom.
Actual
The edited and saved global styles for core/quote:
{"border":{"color":null,"style":null,"width":null,"top":{"style":"solid","width":"0 0 0 2px","color":"currentColor"},"right":{"style":"solid","width":"0 0 0 2px","color":"currentColor"},"bottom":{"style":"solid","width":"0 0 0 2px","color":"currentColor"},"left":{"style":"solid","width":"4px","color":"currentColor"}}}The generated CSS:
:root :where(.wp-block-quote){border-top-color: currentColor;border-top-width: 0 0 0 2px;border-top-style: solid;border-right-color: currentColor;border-right-width: 0 0 0 2px;border-right-style: solid;border-bottom-color: currentColor;border-bottom-width: 0 0 0 2px;border-bottom-style: solid;border-left-color: currentColor;border-left-width: 4px;border-left-style: solid; ...}The Quote preview shows a border on all four sides.
On our team's themes repo, 55 themes have these null border keys in theme.json, most from exporting styles edited this way.
Environment info
- WordPress 7.1.3
- Gutenberg 24.2.0
- Twenty Twenty-Five
- Chrome, macOS
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
No (Jetpack and Theme Check were also active)
Please confirm which theme type you used for testing.
Block
Drafted with AI assistance, reproduced and verified by me.
Reacted by Sainath Poojary
Metadata
Metadata
Assignees
Labels
Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Status] In ProgressTracking issues with work in progress
Activity
SainathPoojary commentedon Oct 15, 2026
Thanks for reporting this issue @iamtakashi! I was able to reproduce this on my end as well by following the steps provided.
I am currently investigating this further, will share updates soon.
Environment
SainathPoojary commentedon Oct 15, 2026
I’ve put up #84826 to address the shorthand width problem. It updates
BorderBoxControlto properly unpack strings like0 0 0 2pxinto each side so valid CSS is produced when unlinking.Since the two reported issues live in different areas, it seemed better to split them into separate PRs to make reviewing and testing easier.
kmlyz commentedon Nov 19, 2026
Tested
WP_Theme_JSON_Gutenberg::merge()(lib/class-wp-theme-json-gutenberg.php:4752) without thecolor: null,style: null,width: nullproperties fromnormalizeBorderStyle(packages/global-styles-ui/src/screen-block.tsx:103-108).When a theme sets flat
bordervalues (color,style,width) and the user layer only stores split sides (top,left),array_replace_recursivekeeps the theme's flatborder-color,border-width, andborder-stylealongsideborder-top-*andborder-left-*in the generated stylesheet. That causes unedited or cleared sides to inherit the theme's flat border.I closed #86428 to avoid introducing that regression. Should this be fixed by filtering
nullborder keys during theme export, or by updatingWP_Theme_JSON_Gutenbergandglobal-styles-engineso split border keys supersede lower-layer flatborderproperties?