`theme` Attribute does not render in the example code
dsrees opened this issue · 4 comments
If I declare a component with the attr :theme, :string
, then the variation will properly style the example, but the code block next to the example will not include the theme
. I haven't had the chance yet to look over the source, but I'm assuming that theme
may be some special term in storybook.
# My functional component
attr :theme, :string, default: "primary"
def button(assigns) do
...
end
# In the .story.exs
%Variation{
id: :button,
attributes: %{
text: "Button text",
theme: "red"
}
}
Hey Daniel,
theme
has indeed a special meaning in the storybook. I recommend you read this guide
But it shouldn't be removed from your code unless you explicitly use the theming assign strategy.
I'll have a look into it
Thanks @cblavier for pointing out those docs and taking a look. We are not making use of any theming as described. Happy to provide more details if helpful.
I just fixed the issue, would you mind testing your code against storybook's main branch to make sure this is ok now?
(if you have any issues with assets while testing an unreleased version of the library, please make sure you have read https://github.com/phenixdigital/phoenix_storybook#contributing)