Skip to content
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

fix: allow theme buttons to wrap when many themes #48

Merged
merged 1 commit into from
May 28, 2021

Conversation

micmro
Copy link
Contributor

@micmro micmro commented May 25, 2021

Hi @semoal, first of all thanks for your great addon!

Issue

I noticed one issue when using themeprovider-storybook with many themes - they get all squeezed together and become illegible (see screenshot below):
Screen Shot 2021-05-24 at 8 56 25 PM

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
Screen Shot 2021-05-24 at 9 09 04 PM

There is no change if all of the themes fit into the first line:
Screen Shot 2021-05-24 at 9 27 21 PM

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]:

const MANY_THEMES = THEMES.concat(new Array(15).fill(null).map((_, i) => ({
  ...THEMES[0],
  name: `Theme ${i + 1}`,
  backgroundColor: `#${i.toString(16).repeat(6)}`,
})))

@commit-lint
Copy link

commit-lint bot commented May 25, 2021

Features

  • allow theme-buttons to wrap (7eda2b5)

Contributors

micmro

Commit-Lint commands

You can trigger Commit-Lint actions by commenting on this PR:

  • @Commit-Lint merge patch will merge dependabot PR on "patch" versions (X.X.Y - Y change)
  • @Commit-Lint merge minor will merge dependabot PR on "minor" versions (X.Y.Y - Y change)
  • @Commit-Lint merge major will merge dependabot PR on "major" versions (Y.Y.Y - Y change)
  • @Commit-Lint merge disable will desactivate merge dependabot PR
  • @Commit-Lint review will approve dependabot PR
  • @Commit-Lint stop review will stop approve dependabot PR

@semoal
Copy link
Owner

semoal commented May 28, 2021

Yay, looks good to me! Thanks for contributing! Much appreciated

@semoal semoal changed the title feat: allow theme-buttons to wrap fix: allow theme buttons to wrap when many themes May 28, 2021
@semoal semoal merged commit 5cd335b into semoal:master May 28, 2021
semoal pushed a commit that referenced this pull request May 28, 2021
### Bug Fixes

* allow theme buttons to wrap when many themes ([#48](#48)) ([5cd335b](5cd335b))
@semoal
Copy link
Owner

semoal commented May 28, 2021

🎉 This PR is included in version 1.7.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@micmro micmro deleted the feat/allow-theme-buttons-to-wrap branch May 28, 2021 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants