fix: allow theme buttons to wrap when many themes #48
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @semoal, first of all thanks for your great addon!
Issue
I noticed one issue when using
![Screen Shot 2021-05-24 at 8 56 25 PM](https://user-images.githubusercontent.com/1680390/119425682-d440bb00-bcd5-11eb-892e-40e1e3f2f34c.png)
themeprovider-storybook
with many themes - they get all squeezed together and become illegible (see screenshot below):Suggested fix
I've made some minor changes to the styles to allow the theme-buttons to wrap if they fill up the full width available:
![Screen Shot 2021-05-24 at 9 08 49 PM](https://user-images.githubusercontent.com/1680390/119425817-123ddf00-bcd6-11eb-8d0f-533834920cb8.png)
![Screen Shot 2021-05-24 at 9 09 04 PM](https://user-images.githubusercontent.com/1680390/119425820-123ddf00-bcd6-11eb-9568-e4fb3fdf7bd7.png)
There is no change if all of the themes fit into the first line:
![Screen Shot 2021-05-24 at 9 27 21 PM](https://user-images.githubusercontent.com/1680390/119426310-f555db80-bcd6-11eb-8d4d-25a44fcde4a3.png)
Tested in the latest Chrome, FF, Safari and Edge.
Test Scaffolding
To test this behaviour and add the scaffolding to add 17 themes you could instead merge the
docs/allow-theme-buttons-to-wrap-demo
branch instead.In a just I've added some copies of
THEMES[0]
: