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

Theming Option Not Appearing In Storybook #28

Closed
twcardenas opened this issue Jul 27, 2021 · 5 comments
Closed

Theming Option Not Appearing In Storybook #28

twcardenas opened this issue Jul 27, 2021 · 5 comments
Labels

Comments

@twcardenas
Copy link

twcardenas commented Jul 27, 2021

I am wanting to switch themes but the Theming Option is not appearing in the panel in Storybook
I've tried a few different versions of the react theming library but cannot change themes. The theme provider is being added with the decorator because the components render when it is there and don't when it is not as expected.

This is my related dependencies

"emotion-theming": "^10.0.27",
  "devDependencies": {
    "@react-theming/storybook-addon": "^1.1.1",
    "@storybook/addon-actions": "^6.3.6",
    "@storybook/addon-essentials": "^6.3.6",
    "@storybook/addon-links": "^6.3.6",
    "@storybook/react": "^6.3.6",
    "storybook-addon-i18next": "^1.3.0",
    "storybook-react-router": "^1.0.8",
    "typescript": "^4.2.2",
    "webpack": "^5.39.0",
    "webpack-cli": "^3.3.12",
    "webpack-dev-server": "^3.11.0",
....
  },

main.js

module.exports = {
  "stories": [
    "../src/**/*.stories.mdx",
    "../src/**/*.stories.@(js|jsx|ts|tsx)"
  ],
  "addons": [
    "@storybook/addon-links",
    "@storybook/addon-essentials",
    'storybook-addon-i18next/register',
    'storybook-react-router/register',
    '@react-theming/storybook-addon'
  ],
  typescript: {
    reactDocgen: 'none',
  }
}

preview.js


import { addDecorator } from '@storybook/react'
import { ThemeProvider } from 'emotion-theming';
import StoryRouter from 'storybook-react-router';
import { Suspense } from 'react'
import { withThemes } from '@react-theming/storybook-addon';
import {themeVariables} from '../src/utils/themes'

export const parameters = {
  actions: { argTypesRegex: "^on[A-Z].*" },
  controls: {
    matchers: {
      color: /(background|color)$/i,
      date: /Date$/,
    },
  },
}

addDecorator(withThemes(ThemeProvider, themeVariables));
addDecorator((story, context) => (
  <Suspense fallback="Loading...">{story(context)}</Suspense>
));
addDecorator(StoryRouter());

Any thoughts on why this is not working?

issue

@stale
Copy link

stale bot commented Jan 23, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jan 23, 2022
@stale stale bot closed this as completed Feb 7, 2022
@RHeynsZa
Copy link

RHeynsZa commented Jun 2, 2022

Was this ever resolved? Im having the same issue

@stale
Copy link

stale bot commented Oct 19, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Oct 19, 2022
@RHeynsZa
Copy link

Very nice

@stale stale bot removed the wontfix label Oct 19, 2022
@stale
Copy link

stale bot commented Feb 16, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Feb 16, 2023
@stale stale bot closed this as completed Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants