0afc1d2b5a
## Documentation / Examples - [x] Make sure the linting passes by running `yarn lint` x-ref: https://github.com/vercel/styled-jsx/issues/761 Since next.js is using styled-jsx v5 beta now, it requires wrapping a `StyleRegistry` component on the root top. ref: [styled-jsx doc](https://github.com/vercel/styled-jsx/tree/beta#server-side-rendering) |
||
---|---|---|
.. | ||
.storybook | ||
components | ||
pages | ||
public | ||
stories | ||
styles | ||
.babelrc | ||
.gitignore | ||
next-env.d.ts | ||
package.json | ||
README.md | ||
tsconfig.json |
Example app with Storybook setup for SCSS in Styled-jsx
This example shows Styled-jsx (with SCSS) working for components written in TypeScript rendered both inside and outside of Storybook.
Preview
Preview the example live on StackBlitz:
Deploy your own
Deploy the example using Vercel:
How to use
Execute create-next-app
with npm or Yarn to bootstrap the example:
npx create-next-app --example with-storybook-styled-jsx-scss with-storybook-styled-jsx-scss-app
# or
yarn create next-app --example with-storybook-styled-jsx-scss with-storybook-styled-jsx-scss-app
Run Storybook
npm run storybook
# or
yarn storybook
Build Static Storybook
npm run build-storybook
# or
yarn build-storybook
You can use Vercel to deploy Storybook. Specify storybook-static
as the output directory.
Notes
This example combines the following examples, with some required extra config added: