-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Pattern code with json-styled variable paths is not acceptable, producing error #69477
Comments
Hi |
I apologize for being unclear, I meant the JavaScript error in the browser console.
|
Can you share how your custom var is added under "custom" in theme.json? |
Hi @carolinan I have following error trace from the console:
My custom vars added following way (there are no errors in theme.json, all content are valid according to json schema):
|
To me, this seems like a bug, because <!-- wp:paragraph {"style":{"border":{"color":"var:custom|test","width":"var:custom|test","style":"var:custom|test"}}} -->
<p class="has-border-color" style="border-color:var(--wp--custom--test);border-style:var(--wp--custom--test);border-width:var(--wp--custom--test)">Hello World</p>
<!-- /wp:paragraph --> The problem occurs only with |
Description
For example, I want to style border-radius using variable defined in theme.json. Using CSS-styled path
var(--wp--custom--border-radius--large)
works ok:But using json-styled variable path
var:custom|border-radius|large
produces error that block contains invalid content:Step-by-step reproduction instructions
.
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
The text was updated successfully, but these errors were encountered: