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

Customizing the layout #62

Closed
jide opened this issue Apr 6, 2016 · 6 comments
Closed

Customizing the layout #62

jide opened this issue Apr 6, 2016 · 6 comments

Comments

@jide
Copy link
Contributor

jide commented Apr 6, 2016

It would be great to be able to customize the layout / html / css. Something like adding a custom component in .storybook.

@arunoda
Copy link
Member

arunoda commented Apr 6, 2016

Could you give us more information? What you are trying to achieve?

@jide
Copy link
Contributor Author

jide commented Apr 6, 2016

I would like to be able to customize the layout, make the sidebar smaller... I tried to inject css in config.js and use global selectors, but it did not work, and seems hackish anyway.

I like to have my code and storybook side by side, and on my screen the current design takes a lot of space. I'm sure there could be many other use cases !

@jide
Copy link
Contributor Author

jide commented Apr 6, 2016

I made a PR in case you find this useful.

@jide
Copy link
Contributor Author

jide commented Apr 7, 2016

If someone is interested, this can already be done using a custom webpack config file :

module.exports = {
  //...
  plugins: [
    new webpack.NormalModuleReplacementPlugin(/^\.\/layout$/, 'custom-layout'),
    new webpack.NormalModuleReplacementPlugin(/^\.\/controls$/, 'custom-controls')
  ],
  resolve: {
    alias: {
      'custom-layout': path.resolve('.storybook/layout.js'),
      'custom-controls': path.resolve('.storybook/controls.js')
    }
  }
}

@arunoda
Copy link
Member

arunoda commented Apr 7, 2016

Great. I added a comment on this PR. #67

@jide jide closed this as completed Apr 7, 2016
ndelangen pushed a commit that referenced this issue Apr 5, 2017
Fix issue where hot reloaded updates were not rendered
ndelangen pushed a commit that referenced this issue Apr 11, 2017
Add react-storybook-addon-chapters
ndelangen pushed a commit that referenced this issue Apr 11, 2017
save height of down panel in local storage #62
ndelangen pushed a commit that referenced this issue Apr 23, 2017
Implemented tests for maxSize and minSize
@andrey-skl
Copy link

andrey-skl commented May 15, 2019

I think somebody may find this useful. I achieved layout customization through custom preset that extends managerWebpack config. And then I load my custom header right before the main Storybook view. Key files there are "presets.js" and "custom-header/header-preset.js".

See details in commit
JetBrains/ring-ui@94328f6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants