How to change preview background color mode when user click the customized addon created by globalTypes

13 views Asked by At

I am creating the following customized addon.

export const globalTypes = {
  mode: {
    description: 'Select light or dark mode',
    defaultValue: 'light',
    toolbar: {
      title: 'Mode',
      items: [
        { value: 'light', icon: 'sun', title: 'Light' },
        { value: 'dark', icon: 'moon', title: 'Dark' }
      ],
      dynamicTitle: true
    }
  }
}

I also add own dark-modeclassname in the Decorator. In the mean time, I am trying to change the overall preview color mode. Does anyone has any suggestion how to achieve it? Thanks for the help!

0

There are 0 answers