Steps to replicate the issue (include links if applicable):
What happens?:
The horizontal layout is broken due to a margin-top on the second field:
What should have happened instead?:
The two fields should appear vertically aligned to the top:
Software version (skip for WMF-hosted wikis like Wikipedia): Codex 1.3.5
Solution
We need to determine how to solve this—is it an issue with the margin-top placed on fields in Codex, or an issue with this specific demo?
We do not explicitly support horizontal field layouts at this time. The new margin for fields only takes into account a vertical layout. If we want to continue this paradigm, we should simply add a style to the demo to remove the margin-top of the second field.
However, if we want to at least improve support for horizontal field layouts, which we do recommend in the field/form guidelines, we should reconsider the margin-top. Some other options:
- Use a margin-bottom instead (removing it on the last field). This would make horizontal layouts appear less broken, but the margin-bottom would still be problematic in the case that the last field is longer (taller) than the ones next to it, yet it has no margin-bottom, so the spacing between the horizontal field layout and whatever's below it is too small. The demo in question is an example of this - if it had, say, another fieldset below it, the margin between the two fieldsets might appear too small, since the "Weight value" field's margin-bottom doesn't start below the "Unit" field's help text.
- Set the vertical margin by default, but add an option to set a horizontal margin instead
I think a combination of these might be ideal. However, since we haven't determined exactly how to support horizontal field layouts in Codex, I recommend we just do the first one for now.
Acceptance criteria
- Agree on a solution and document it in this task
- Implement the solution