# storybook-addon-themes

## 10.0.0

### Major Changes

- 3359d6a: Rewrite the theme switcher for Storybook 10 with a framework-independent preview decorator, automatic addon registration, and an ESM package.
  
  - Keep `parameters.themes`, including theme lists, defaults, multiple CSS classes, color swatches, clearing, disabling, and custom targets.
  - Store the selection in Storybook globals for shareable URLs, persistent selection between stories, and fixed per-story themes.
  - Apply themes in Canvas, Docs, and standalone previews, with cleanup when stories or targets change and preservation of existing CSS classes.
  - Add example apps and browser regression tests for React, Vue 3, Svelte 5, HTML, Preact, Web Components, and Angular.
  
  ### Migration from version 6
  
  - Upgrade to Storybook 10 and register `storybook-addon-themes` in your Storybook `addons` configuration.
  - Remove `/register` and framework-specific imports (`/react`, `/vue`, `/svelte`, `/html`); the addon registers its preview decorator automatically.
  - Replace the `Decorator` parameter with a regular framework decorator that reads `context.globals.theme`.
  - Move `onChange` effects into preview configuration. The callback now runs in the preview on initial render and theme changes, and may return a cleanup function.
  - Use Node 20.19+ or 22.12+ and ESM-compatible tooling. Storybook 6 and Storybook 11 prereleases are outside this release's compatibility range.
  
  See the [migration guide](https://github.com/tonai/storybook-addon-themes/blob/10.x/packages/storybook-addon-themes/README.md#migrating-from-6x) for examples.

## 6.1.0

### Minor Changes

- Default as string parameter in config. ([@norin89](https://github.com/https://github.com/norin89) in [#43](https://github.com/tonai/storybook-addon-themes/pull/43))
- Add HTML support for decorators. ([@tonai](https://github.com/https://github.com/tonai) in [#44](https://github.com/tonai/storybook-addon-themes/pull/44))
- Allow to set target element to apply classes to. ([@pixtron](https://github.com/https://github.com/pixtron) in [#45](https://github.com/tonai/storybook-addon-themes/pull/45))
- Update Storybook addon metadata. ([@coderkevin](https://github.com/https://github.com/coderkevin) in [#46](https://github.com/tonai/storybook-addon-themes/pull/46))

## 6.0.1

### Patch Changes

- Remove peer dependencies. ([@rcline](https://github.com/https://github.com/rcline) in [#40](https://github.com/tonai/storybook-addon-themes/pull/40))
- Remove @types/vue + security fix.

## 6.0.0

### Major Changes

- Storybook 6.x compatibility.
- Add PUBLISHING file.

## 5.5.0

### Minor Changes

- Show theme selector in doc tabs. ([@jpzwarte](https://github.com/jpzwarte) in [#29](https://github.com/tonai/storybook-addon-themes/pull/29))
- Security update.  ([@tonai](https://github.com/tonai) in [#31](https://github.com/tonai/storybook-addon-themes/pull/31) and [#35](https://github.com/tonai/storybook-addon-themes/pull/35))
- Launch change event even if no decorator is set. ([@tonai](https://github.com/tonai) in [#32](https://github.com/tonai/storybook-addon-themes/pull/32))
- Add onChange parameter. ([@tonai](https://github.com/tonai) in [#33](https://github.com/tonai/storybook-addon-themes/pull/33))
- Add clearable parameter. ([@tonai](https://github.com/tonai) in [#34](https://github.com/tonai/storybook-addon-themes/pull/34))

## 6.0.0-alpha2

### Major Changes

- Add option for customizing the decorator. ([@tonai](https://github.com/tonai) in [#23](https://github.com/tonai/storybook-addon-themes/pull/23))
- Support custom decorator for svelte.
- Fix error when a theme without the class property is selected.

## 5.4.1

### Patch Changes

- Security update.
- Fix error when a theme without the class property is selected.

## 5.4.0

### Minor Changes

- Add option for customizing the decorator. ([@tonai](https://github.com/tonai) in [#23](https://github.com/tonai/storybook-addon-themes/pull/23))

## 6.0.0-alpha1

### Major Changes

- Add demo gif in README. ([@tonai](https://github.com/tonai) in [#19](https://github.com/tonai/storybook-addon-themes/pull/19))
- Add Svelte support for decorator.

## 5.3.0

### Minor Changes

- Security update.
- Add vue support for decorator. ([@tonai](https://github.com/tonai) in [#16](https://github.com/tonai/storybook-addon-themes/pull/16))

## 5.2.0

### Minor Changes

- Add CHANGELOG file.
- Add decorator usage. ([@tonai](https://github.com/tonai) in [#8](https://github.com/tonai/storybook-addon-themes/pull/8))

## 5.1.0

### Minor Changes

- Active theme styles. ([@Yankovsky](https://github.com/Yankovsky) in [#3](https://github.com/tonai/storybook-addon-themes/pull/3))
- Multiple classes theme. ([@Yankovsky](https://github.com/Yankovsky) in [#4](https://github.com/tonai/storybook-addon-themes/pull/4))

## 5.0.0

### Major Changes

- Storybook 5.x compatibility.

## 4.0.0

### Major Changes

- Storybook 4.x compatibility.

## 3.0.0

### Major Changes

- Storybook 3.x compatibility.

## 0.0.4

### Patch Changes

- Add LICENCE and .npmignore files.

## 0.0.3

### Patch Changes

- Publication test.

## 0.0.2

### Patch Changes

- Add prepublish script.

## 0.0.1

### Patch Changes

- Initial commit.
