Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Missing conversion from json styled variable to CSS variable #69551

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

karthikeya-io
Copy link

@karthikeya-io karthikeya-io commented Mar 12, 2025

What?

Closes #69477

This PR fixes a block validation error occurring when using preset-based styling, ( for some properties like border-radius), defined with CSS variables in the format var:custom|border-radius|large.

How?

  • Fix: Missing conversion from json styled variable to CSS variable

Testing Instructions

  1. Open a post or page
  2. Open the code editor and add the block with block-radius and CSS variable in the format var:custom|border-radius|large.
    Example
<!-- wp:group {"style":{"border":{"radius":"var:custom|border-radius|large"}},"backgroundColor":"brand-accent-1","layout":{"type":"constrained"}} -->
<div class="wp-block-group has-brand-accent-1-background-color has-background" style="border-radius:var(--wp--custom--border-radius--large)"><!-- wp:paragraph -->
<p>test</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->
  1. Confirm there's no block validation error

Testing Instructions for Keyboard

Same

Screenshots or screencast

Before After
ss image

Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @karthikeya-io! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Mar 12, 2025
@karthikeya-io karthikeya-io marked this pull request as ready for review March 12, 2025 18:45
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @EldarAgalarov.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: EldarAgalarov.

Co-authored-by: karthikeya-io <[email protected]>
Co-authored-by: carolinan <[email protected]>
Co-authored-by: t-hamano <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@Mamaduka Mamaduka added [Type] Bug An existing feature does not function as intended [Feature] Block API API that allows to express the block paradigm. labels Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block API API that allows to express the block paradigm. First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pattern code with json-styled variable paths is not acceptable, producing error
2 participants