bookshop
bookshop copied to clipboard
Make it possible for a component to have a wrapper class
It would be great if we could have a custom wrapper for a single component if we want.
I think others would be interested in this too.
In traditional storybook this is something I do quite a lot. For example, for a full-width
button, I want to have a wrapper class to demonstrate that the button is bigger.
Maybe this is something we could add to [meta]?
e.g.
[meta]
wrapper = """
<div class="big-iron"></div>
"""
And styles can be defined in .storybook/styles.scss
.
Any thoughts @bglw ?
I'm hesitant to add too much more to the TOML file, as it serves primarily as documentation and CloudCannon config, and is sitting on the border of readability as it is.
I'll have a think on how to set this up in a sane way - it will likely be the trigger for a second config file specific to meta (and will come after we finish the refactor)
This could now be solved in some cases by wrapping the entire bookshop renderer in a class. There's still some value in this issue for wrapping a component in a class on the fly.