orbeon / orbeon-forms

Orbeon Forms is an open source web forms solution. It includes an XForms engine, the Form Builder web-based form editor, and the Form Runner runtime.
http://www.orbeon.com/
GNU Lesser General Public License v2.1
512 stars 220 forks source link

Control label to be horizontally aligned with the field #2865

Open syaimaamri opened 7 years ago

syaimaamri commented 7 years ago

Hi I would like to align the label with control as image below. Is this possible using Custom CSS classes in Orbeon Builder 2016.1? Would appreciate your help.

label

avernet commented 7 years ago

I thought we already had an RFE for this, but can't seem to be able to locate it. So I've slightly changed the title of this issue, and marked this as an RFE.

For reference, similarly, we'd like to be able to layout radio buttons and checkboxes horizontally, which is covered by #333.

ebruchez commented 7 years ago

Note that in general we prefer the top-aligned labels. See also Design Better Forms - Top align labels.

ebruchez commented 7 years ago

+1 from user

avernet commented 7 years ago

+1 from customer

avernet commented 7 years ago

+1 from evaluator

avernet commented 6 years ago

+1 from user

ebruchez commented 5 years ago

+1 from customer

ebruchez commented 4 years ago

#4190 #4778 would be another way of doing it.

ebruchez commented 4 years ago

+1 from me for some parts of the workflow UI (#3463)

ebruchez commented 4 years ago

In Form Builder, we'd lke this only for some controls. Could we use a label appearance?

<xf:input>
    <xf:label appearance="xxf:left">Label</xf:label>

This would place a class on the enclosing control, for example xxforms-label-appearance-left.

For something form-wide, the issue is a little different as there are alignment questions.

ebruchez commented 4 years ago
ebruchez commented 4 years ago

The CSS is easy with CSS grids, harder with other CSS. For Form Builder, we can use CSS grids as all browsers that support Form Builder also support CSS grids.

ebruchez commented 4 years ago

One issue with form-level horizontal labels is that controls must be aligned or the result will be unacceptably ugly.

Ideally, you'd like them to be automatically sized based on content, maybe with a min/max width. But this is probably not possible right now at the level of an entire form even with bleeding-edge CSS, at least without us changing our markup, as we have nested sections and grids.

But we don't necessarily need to do this at the entire form level. Doing it at the grid level is already useful. With CSS grids and subgrids, you can do this for a single non-repeated grid for sure, maybe for repeated grids as well (but we need this less or not at all for repeated grids). But right now, subgrids are only implemented by Firefox, and IE11 doesn't support CSS grids at all anyway.

Without subgrids, it's possible to do it with display: contents if you don't need the intermediary elements to participate to styling/layout (see "Why we need CSS subgrid". I have tried this punctually in Form Builder and it works great. But IE11 still doesn't have CSS grids.

So right now, the only way to have good support at the grid level, probably, is to have a fixed width for the labels, until we don't support IE11 anymore.

Bottom line:

avernet commented 3 years ago

+1 from user

avernet commented 2 years ago

+1 from customer