You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we had some issues with the theme plugin and their decorator and decided to give it a try ourselves to improve this. We figured out to easily make the same menu with globalTypes (docs) and adjusted our own decorator to set a data attribute just like withThemeByDataAttribute did (docs). This was easy.
What we are missing is to also change the docs theme to dark and light, because the component styling is better visible for dark on a dark docs page and the light theme on a light docs page (and it's also more stylish that way).
We tried to set the story parameters with useEffect but this is executed too late and applied only on 2nd rendering of the page. Is there a way to programmatically change the docs' theme state like it is possible with the manager API for the whole surrounding storybook?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Summary
Hello,
we had some issues with the theme plugin and their decorator and decided to give it a try ourselves to improve this. We figured out to easily make the same menu with
globalTypes
(docs) and adjusted our own decorator to set adata
attribute just likewithThemeByDataAttribute
did (docs). This was easy.What we are missing is to also change the docs theme to dark and light, because the component styling is better visible for dark on a dark docs page and the light theme on a light docs page (and it's also more stylish that way).
We tried to set the story parameters with
useEffect
but this is executed too late and applied only on 2nd rendering of the page. Is there a way to programmatically change the docs' theme state like it is possible with the manager API for the whole surrounding storybook?Additional information
No response
Create a reproduction
No response
Beta Was this translation helpful? Give feedback.
All reactions