-
Notifications
You must be signed in to change notification settings - Fork 950
Introduce a ToggleButtons button_width style attribute. #1257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
One question: is it more likely for people to want equal-sized buttons, or buttons sized to content? |
Sometimes you want an ugly-but-using-all-the-availiable-space solution :) |
which would be equivalent to setting the button's width to |
I ment as small as possible, to use all the available space for widgets, would that also be possible? |
Okay, that was my question. Should we just change the default to 'size to content', but still provide an option to set a fixed size? |
0a7fab4
to
c0fc921
Compare
ping @SylvainCorlay |
Not sure what I was thinking there - we can't set the flex property in a width css attribute. I'll punt this one to the beta. |
…ation. This is needed if, for example, the DOM structure is regenerated, and we want to set back the styles.
5f0abd2
to
78e510f
Compare
I updated this for the current state of the codebase. |
Let's try this out. The default is the same fixed width as before. Setting the |
My toggle button does not have a style.button_width property to set. Has this changed? How can I set the width of my toggle buttons? |
Fixes #1189
However, after doing this, I'm thinking we should do it a different way. For one, the assumption at https://github.com/jupyter-widgets/ipywidgets/blob/master/jupyter-js-widgets/src/widget.ts#L818 is now not true - the size of the widget could change. Two, perhaps a more useful default is to size the buttons with the content with some margin, with a minimum width so things don't get too small. Or use flex to layout the buttons in the space of the widget, so it's easy to control the total size of the buttons by changing the size of the buttons container.