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
I have a decorator that changes the text's direction on the document.body, which I use to render a story for each of my components, to check that everything looks alright in rtl mode.
I'm aware that there are addons to do that switch the dir, but I'd rather have specific stories for this, as tools like chromatic cannot control addons when capturing the stories (as far as I'm aware).
On the canvas' side of things, that works fine as I reset the text's direction when the component unmounts.
When rendering in the docs though, since all the stories are rendered together the text's direction changes on the whole page, which is obviously not what I want.
I can hide the stories that mess with the text's direction from the docs using strory.parameters = { docs: { disable: true } }, but that requires me to remember to do so every time I use the decorator.
Hence my question, is there a way to automatically hide all the stories using a specific decorator from the docs?
I've tried to fiddle around with things a little bit, but I can't seem to find a good solution for that.
Alternatively, I'd also be happy being able to hide the stories based on a name pattern, but I haven't found a way to do that either.
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
-
I have a decorator that changes the text's direction on the
document.body
, which I use to render a story for each of my components, to check that everything looks alright inrtl
mode.I'm aware that there are addons to do that switch the
dir
, but I'd rather have specific stories for this, as tools like chromatic cannot control addons when capturing the stories (as far as I'm aware).On the canvas' side of things, that works fine as I reset the text's direction when the component unmounts.
When rendering in the docs though, since all the stories are rendered together the text's direction changes on the whole page, which is obviously not what I want.
I can hide the stories that mess with the text's direction from the docs using
strory.parameters = { docs: { disable: true } }
, but that requires me to remember to do so every time I use the decorator.Hence my question, is there a way to automatically hide all the stories using a specific decorator from the docs?
I've tried to fiddle around with things a little bit, but I can't seem to find a good solution for that.
Alternatively, I'd also be happy being able to hide the stories based on a name pattern, but I haven't found a way to do that either.
Beta Was this translation helpful? Give feedback.
All reactions