-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[BUG] Style: Title of Panels #959
Comments
Hi @wcastand! Thank you for the great addon! The place you want to fix is here. But before creating PR did you consider the possibility that the issue is on your addon side? Because when I tried to reproduce it in a single example:
it looked good and was properly centered: Maybe live demo with your addon could help us to test it and investigate the bug? |
Hi ! Thank you for storybook !! :) I think my addon break the layout of the titles because he contains a button and he's larger than other title. I use Chrome on OSX (Just in case) Right now, no align-items is specified so he take the default which is For the documentation about the possibility of using a React component in the title. I think we can simply add it in the example of Something like that should be enough i think : addonAPI.register('kadira/notes', (storybookAPI) => {
// Also need to set a unique name to the panel.
addonAPI.addPanel('kadira/notes/panel', {
title: () => <span>Notes</span>,
render: () => (
<Notes channel={addons.getChannel()} api={storybookAPI}/>
),
})
}) Or maybe something more complete in case people doesn't know stateless component in react ? class Title extends React.Component {
render(){
return <span>Notes</span>;
}
}
addonAPI.register('kadira/notes', (storybookAPI) => {
// Also need to set a unique name to the panel.
addonAPI.addPanel('kadira/notes/panel', {
title: () => <Title/>,
render: () => (
<Notes channel={addons.getChannel()} api={storybookAPI}/>
),
})
}) |
Yeap @wcastand I got your point! I think PR for fixing that would be very welcomed! |
I'll do a PR tonight then :) For the max-height, it could be a good idea. Or maybe we fix the height and put a Let me know if you prefer a max-height or fixed height with a |
|
Ok, i'll make the Pr with the max-height solution. |
#959 add a max-height and center element with alignItems: center
Fixed by #961 |
Hi,
I'm developing an addon for storybook and i create a panel with a custom React component as
title
and the title aren't centered with flex so it doesn't look really nice.Is it possible to center the Panel's titles or he can break something i'm not aware of ?
If it's possible, i'd love to help and do a PR :)
The text was updated successfully, but these errors were encountered: