diff --git a/lib/form-layout.less b/lib/form-layout.less new file mode 100644 index 0000000..fd9df97 --- /dev/null +++ b/lib/form-layout.less @@ -0,0 +1,403 @@ +/* Form layout */ + +@import "./variables.less"; + +:root { + // CSS variable to define the number of (label + control) columns. + // It dynamically changes on narrow pages (see media query below). + --ct-form-columns: 2; +} + +// Cockpit Form Layout: Automatically have Cockpit display your form in +// an optimal layout. +// +// By default, all labels are aligned and sized properly and form elements +// stretch to take up the remaining space. +// +// +// There are additional classes and attributes you can add to each +// control directly under `ct-form`: +// +// `ct-form-split`: The grid can be split on a `form-control` +// level by adding a this class. If you want two elements next to each +// other, both should have this class. Widths are equal by default. +// See ct-form-minmax & ct-form-maxmin for alternate sizing. +// +// `ct-form-relax`: Form elements normally stretch to take up the +// full space. You can relax their width by adding this class to the +// control. Inputs with a size attribute are auto-relaxed and do not +// need this class. +// +// `ct-form-stretch`: If a control has a width specified +// elsewhere, you can force it to stretch. This is mainly useful when +// using