The Valid widget does not provide a way to control the readout style, as far as I can tell. This was originally raised in issue #1937 .
One way to do this would be to create a new ValidStyle object for the Valid widget that contains both the description_width and the readout_width fields. The ValidStyle object should probably inherit from DescriptionStyle.
Alternatively, we could make a new ReadoutStyle widget, with a corresponding readout_style traitlet on the Valid widget. This seems a bit more extensible in the future.
For a minimal example of the current (broken) behaviour:
import ipywidgets as widgets
widget = widgets.Valid(
readout='some very very long sentence about invalidity',
layout={'width': '700px'}
)
widget
Perhaps also the sliders could inherit from this style so you could control their readout widths too.
I was just about to create an issue to request a larger readout width for the SelectionRangeSlider widget but I think this issue addresses it. Looking forward to this development on what is an amazingly useful data analysis tool!
For the moment it might be useful to note in the documentation the non-intuitive omission of the "readout_width" feature in the style given that there is a "description_width":
https://ipywidgets.readthedocs.io/en/latest/examples/Widget%20Styling.html
I spent ages looking for this feature (among various different margin settings), which I needed to improve the packing of these generously spaced slider widgets into my small screen to make them more useful, not knowing that this feature didn't exist.
Even better - how about we add readout_width as another style attribute? Anyone up to making a PR?
Most helpful comment
I was just about to create an issue to request a larger
readoutwidth for theSelectionRangeSliderwidget but I think this issue addresses it. Looking forward to this development on what is an amazingly useful data analysis tool!