histoire-dev / histoire-dev/histoire

Dispatch custom event regarding theme changing

Open
#545 1 comment 2 reactions 0 assignees View on GitHub
enhancement: to triage
Dominant language
TypeScript
Stars
3.6k
Forks
212
PR merge metrics
No merged PRs in 30d

Description

### Clear and concise description of the problem

As a developer using Histoire I want to custom control the theme changing so that my stories can behave accordingly regarding my themes.

### Suggested solution

There could be a global custom `theme` event which is dispatched whenever the user clicks on the `theme` changing icon button.

### Alternative

Another alternative would be to have some sort of config or preview where you can specify a callback for the theme changing action.

### Additional context

I'm creating a story wrapper where I wrap every story with a generic `Theme` component where I control the theme based on the selected/specified theme.

### Validations

- [X] Follow our [Code of Conduct](https://github.com/histoire-dev/histoire/blob/main/CODE_OF_CONDUCT.md)
- [X] Read the [Contributing Guidelines](https://github.com/histoire-dev/histoire/blob/main/CONTRIBUTING.md).
- [X] Read the [docs](https://histoire.dev/guide/).
- [X] Check that there isn't [already an issue](https://github.com/histoire-dev/histoire/issues) that requests the same feature to avoid creating a duplicate.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.