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

Docs not applying base theme in manager.js #9498

Closed
wadehammes opened this issue Jan 16, 2020 · 8 comments
Closed

Docs not applying base theme in manager.js #9498

wadehammes opened this issue Jan 16, 2020 · 8 comments
Assignees
Milestone

Comments

@wadehammes
Copy link

wadehammes commented Jan 16, 2020

Describe the bug
Migrating to manager.js has caused Docs to not apply my theme which has a base of 'dark'

To Reproduce
Steps to reproduce the behavior:

  1. Create a theme in manager.js and set the base to 'dark'.

Expected behavior
Docs would have a base theme of 'dark' as in 5.2.

Screenshots
Canvas:
Screen Shot 2020-01-16 at 12 54 14 PM

Docs:
Screen Shot 2020-01-16 at 12 54 20 PM

Code snippets
manager.js

import {addons} from '@storybook/addons';
import {create} from '@storybook/theming/create';
import {APP_COLORS as color} from '../src/styles/colors';

const theme = create({
  base: 'dark',
  colorPrimary: color.SW_SKY_BLUE,
  colorSecondary: color.SW_SKY_BLUE,
});

addons.setConfig({
  theme,
});

System:
Environment Info:

System:
OS: macOS 10.15.2
CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
Binaries:
Node: 10.16.0 - /usr/local/bin/node
Yarn: 1.13.0 - ~/.yarn/bin/yarn
npm: 6.13.6 - /usr/local/bin/npm
Browsers:
Chrome: 79.0.3945.117
Firefox: 70.0.1
Safari: 13.0.4
npmPackages:
@storybook/addon-actions: ^5.3.4 => 5.3.4
@storybook/addon-centered: ^5.3.4 => 5.3.4
@storybook/addon-docs: ^5.3.4 => 5.3.4
@storybook/addon-jest: ^5.3.4 => 5.3.4
@storybook/addon-knobs: ^5.3.4 => 5.3.4
@storybook/addon-links: ^5.3.4 => 5.3.4
@storybook/addon-storysource: ^5.3.4 => 5.3.4
@storybook/addons: ^5.3.4 => 5.3.4
@storybook/react: ^5.3.4 => 5.3.4
npmGlobalPackages:
@storybook/cli: 3.4.4

@shilman
Copy link
Member

shilman commented Jan 16, 2020

@ndelangen I think this was a case we didn't think through in the theming update 😱

What the heck can we do about it?

@shilman
Copy link
Member

shilman commented Jan 17, 2020

Based on discussion with @ndelangen:

In 5.3

  • Verify that parameters still works
  • Recommend to users (here and in migration/documentation) to use parameters if they're using docs

In 6.0

  • Allow specifying manager/preview/(docs?) themes in main.js and recommend that

cc @tmeasday

@tmeasday
Copy link
Member

😨

@ndelangen
Copy link
Member

I added this to my todo list

@palashkaria
Copy link

palashkaria commented Jan 24, 2020

current workaround: use addParameters -> docs -> container & use Global style from emotion there. A couple of custom overrides

@shilman
Copy link
Member

shilman commented Jan 25, 2020

@palashkaria if you use addParameters on options.theme I'd expect it to work in docs without having to do any other workarounds.

@ndelangen
Copy link
Member

Recommend to users (here and in migration/documentation) to use parameters if they're using docs

in PR: #9661

@ndelangen
Copy link
Member

I'll open a new issue for #9498 (comment)

Allow specifying manager/preview/(docs?) themes in main.js and recommend that

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

5 participants