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

Input Field block: theme.json spacing/margin settings not working on front end #56458

Closed
bgardner opened this issue Nov 23, 2023 · 3 comments · Fixed by #56507
Closed

Input Field block: theme.json spacing/margin settings not working on front end #56458

bgardner opened this issue Nov 23, 2023 · 3 comments · Fixed by #56507
Assignees
Labels
[Block] Form (experimental) Affects the form block [Type] Bug An existing feature does not function as intended

Comments

@bgardner
Copy link

bgardner commented Nov 23, 2023

Description

With the experimental form block, the following code in theme.json for Input Field only seems to be applied to the block editor, not the front end. In my theme, the x-large spacing = 100px, which was applied to clearly demonstrate how it looks in both places.

"core/form-input": {
	"spacing": {
		"margin": {
			"bottom": "var(--wp--preset--spacing--x-large)"
		}
	}
}

According to the block.json, it appears the styling should occur via "style": [ "wp-block-form-input" ], but there are no wrapping divs for each input on the front end with the .wp-block-form-input class.

Step-by-step reproduction instructions

  1. Create form with input fields
  2. Add the code above to theme.json
  3. View block editor view vs. front end

Screenshots, screen recording, code snippet

Block editor view:

image

Front end view:

image

Environment info

WordPress 6.4.1, Gutenberg 17.1.0 active.

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@bgardner bgardner added the [Type] Bug An existing feature does not function as intended label Nov 23, 2023
@carolinan carolinan added the [Block] Form (experimental) Affects the form block label Nov 23, 2023
@t-hamano t-hamano self-assigned this Nov 23, 2023
@t-hamano
Copy link
Contributor

I will submit a PR to fix this issue in the near future.

@aristath
Copy link
Member

aristath commented Dec 1, 2023

Related to #55755 which fixes some styling issues in forms blocks

@t-hamano
Copy link
Contributor

t-hamano commented Dec 1, 2023

I submitted #56507 to resolve this issue. However, during the fixture test to ensure that deprecation was performed correctly, we discovered that form-related blocks were not working correctly. This issue is summarized in #56590.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Form (experimental) Affects the form block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants