Open CobusT opened 3 years ago
Having CSS custom properties for most measurements would be ideal. These could then be overridden through inline styles set on each root element.
To provide a consistent API, overrides could be passed to constructors via the options. E.g.:
.__ns__ {
--label-width: 120px;
}
Range([0, 1], {
style: {
'label-width': '240px',
}
})
<form class="oi-5f34c7" style="--label-width:240px">
I would also recommend to expose the CSS namespace, so that it can be referenced dynamically in custom stylesheets.
I’ve adopted CSS custom properties in eb1e7c5659cdef9d83711598db95d706ee8fbd55 (and fixed a related bug in Hypertext Literal https://github.com/observablehq/htl/issues/28). So, you can now redefine the --input-width or --label-width custom properties to change the layout (possibly globally), although I haven’t yet exposed the CSS namespace because I haven’t decided yet if I want to go that route.
Nice ! Where could I see an example ?
Nice ! Where could I see an example ?
I showed a few methods at the bottom of this notebook https://observablehq.com/d/ab8cd2ed34740752?collection=@cobus/quick-demos
I was trying to force the label to be wider, but couldn't get it to work using
<span style="white-space: nowrap; display:block; ">this is a long label that I don't want to wrap or cut off
It would be great to have an option for the label to define the width of the label and push the input out.