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

Addon-docs: No global Style anymore #7264

Closed
rwieruch opened this issue Jul 3, 2019 · 3 comments
Closed

Addon-docs: No global Style anymore #7264

rwieruch opened this issue Jul 3, 2019 · 3 comments

Comments

@rwieruch
Copy link
Contributor

rwieruch commented Jul 3, 2019

Tried Addon-docs with Alpha version 35 today. Everything worked fine, except for my global style which isn't applied in the new Docs panel, but still working in the old Canvas panel.

This is how my .storybook/config.js looks like:

import React, { Fragment } from 'react';
import { load, addParameters, addDecorator } from '@storybook/react';
import { DocsPage } from '@storybook/addon-docs/blocks';

import { Style } from '../src';

// Global Style

addParameters({
  docs: DocsPage,
  options: {
    storySort: (a, b) => a[1].id.localeCompare(b[1].id),
  },
});

addDecorator(storyFn => (
  <Fragment>
    <Style />
    {storyFn()}
  </Fragment>
));

load(require.context('../src', true, /stories\.js$/), module);
load(require.context('../src', true, /stories\.js$/), module);

Whereas Style comes from styled-components:

import { createGlobalStyle } from 'styled-components';

import 'opensans-npm-webfont/style.css';

export default createGlobalStyle`
  h1 {
    font-size: 12px;
  }
`;
@shilman shilman added this to the 5.2.0 milestone Jul 3, 2019
@shilman
Copy link
Member

shilman commented Jul 3, 2019

This is closely related to #6803 cc @elevatebart

@stale stale bot added the inactive label Jul 24, 2019
@shilman shilman added the todo label Jul 24, 2019
@stale stale bot removed the inactive label Jul 24, 2019
@storybookjs storybookjs deleted a comment from stale bot Jul 24, 2019
@leerob
Copy link

leerob commented Jul 24, 2019

I also noticed this one!

@shilman
Copy link
Member

shilman commented Aug 16, 2019

Hurrah!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.2.0-beta.31 containing PR #7771 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed Aug 16, 2019
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