👋 Support Styleguidist on Open Collective 👋
I’m happy to announce a new major release of React Styleguidist.
Webpack 3 is still supported too.
Styleguidist won’t work with Node.js 4 anymore.
You don’t need to wrap multiple JSX tags in a div anymore.
// 6.x<div> <Button primary>Primary button</Button> <Button secondary>Secondary button</Button></div>// 7.x<Button primary>Primary button</Button><Button secondary>Secondary button</Button>
Fragment JSX syntax also works:
// 7.x<> <Button primary>Primary button</Button> <Button secondary>Secondary button</Button></>
We’re now using mini-html-webpack-plugin and @vxna/mini-html-webpack-template instead of html-webpack-plugin. This will make things like adding a favicon or fonts from Google Fonts much easier.
If you’re using a custom HTML template, you need to update your style guide config. Instead of:
// 6.xmodule.exports = { template: './styleguie/template.html'}
You need to use something like this:
// 7.xmodule.exports = { template: { favicon: 'https://assets-cdn.github.com/favicon.ico' }}
Or like this:
// 7.xmodule.exports = { template: { head: { links: [ { rel: 'stylesheet', href: 'https://fonts.googleapis.com/css?family=Roboto' } ] } }, theme: { fontFamily: { base: '"Roboto", sans-serif' } }}
There are a few more changes, see a full change log.
❤️ Huge thanks to Andrey Okonetchnikov, Nikolay Burlov, Rubén Moya and others for help with this release️! ❤️