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

Apply the same margin-top rule for all input elements of a form #676

Open
lcarcone opened this issue Oct 15, 2024 · 0 comments
Open

Apply the same margin-top rule for all input elements of a form #676

lcarcone opened this issue Oct 15, 2024 · 0 comments
Assignees

Comments

@lcarcone
Copy link
Member

I need to redesing a form containing several questions and for visibility concerns I'd like to use for each question a box as defined in [1].
While doing this, I noticed that some inputs had no 'margin-top' as the css rule 'form > * + *' does not apply.
I created a small page [2] reusing the sample given in [3].

The first example reuse the original test, the input elements have a 'margin-top' rule
The secong example shows the same test within an extra div element containing the class 'l-box', the input elements have no 'margin-top' rule
I found a go-round by using the class 'field-group' along with the class 'l-box' on the extra div, this class acts as the rule 'form > * + *' and gives the expected result, see third example.

It would be better if all input elements of a form had the same 'margin-top' regardless of their postion in the structure, ie even if they are not a direct child of the form element

[1] https://design-system.w3.org/layouts/box.html#default-box

[2] https://w3c.github.io/wbs-design/html/report-1.html

[3] https://design-system.w3.org/styles/forms.html#dealing-with-dates-and-times

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Blocked
Development

No branches or pull requests

2 participants