-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Theme variable brandTitle incorrectly applied #5866
Comments
The source of this issue is all these checks for Looking at the relevant stories, it looks like you are supposed to set the @ndelangen / @domyen I'm not sure why the decision was to use theme: create({ brandTitle: 'foo', brandImage: null, colorPrimary: 'hotpink', colorSecondary: 'orangered' }), A documentation issue? |
Just ran into this issue myself. I think the main problem is that the default Storybook logo/svg contains text so as a dev I assumed the It's not clear from documentation or intuition that you can only have one OR the other, image OR text. I would recommend one of the following:
IMO the second option is more intuitive and easier to understand without having to dig/search through the Docs and would allow any devs to easily add their library's logo AND title without having to make an image/svg including the logo and text. |
@jjspace I'll open a PR with the following change:
This will result in the text being shown, no need to set What do you think? |
Jeepers creepers!! I just released https://github.com/storybooks/storybook/releases/tag/v5.1.0-alpha.7 containing PR #6120 that references this issue. Upgrade today to try it out! Because it's a pre-release you can find it on the Closing this issue. Please re-open if you think there's still more to do. |
w00t!! I just released https://github.com/storybooks/storybook/releases/tag/v5.0.9 containing PR #6120 that references this issue. Upgrade today to try it out! |
Yay!! I just released https://github.com/storybooks/storybook/releases/tag/v5.1.0-alpha.29 containing PR #6544 that references this issue. Upgrade today to try it out! Because it's a pre-release you can find it on the |
If somebody can confirm #6444 I'll cherry pick it back into |
Yippee!! I just released https://github.com/storybooks/storybook/releases/tag/v5.0.10 containing PR #6544 that references this issue. Upgrade today to try it out! |
@shilman how to upgrade to https://github.com/storybooks/storybook/releases/tag/v5.1.0-alpha.29 ? will this be enough |
We're on |
I am on 5.1.9 and I am still observing this issue - my |
@miguelyoobic95 are you specifying a custom brandImage? If so, I think that's the designed behavior. If not, maybe this regressed? |
if you supply a custom Image AND a custom title, then the title will be placed as the alt-text on the image. This is intended behaviour. I'm unsure what else to expect. |
@shilman I am specifying a custom brandImage but I would like to add some text underneath, in this case the version number of the app. Is there anywhere to separate these two ? seems like a valid use case for me - a subtitle could be an alternative possibility maybe |
@miguelyoobic95 I believe the intent is that you should include the text in your brandImage. cc @domyen who specified this feature. |
@shilman what if that text is dynamic i.e. a version number. I cannot include it as part of the brandImage (since I would have to regenerate the asset everytime) but I still think it would be valuable information to add as a subtitle for instance. Could you point me to where the |
@miguelyoobic95 after monoconfig is done, themes will gain the ability to have overriding react components. Making your use-case possible. But this is some time away. If you'd like, I could show you how far along monoconfig is, how it works, and possibly find a way for you to help? |
Hey @ndelangen sorry for the slow reply, we had some other stuff coming up. If you could give me some pointers to the config that would be great :) |
Sure, join me on discord here: And I'll talk you through what I've got so far. |
Hey @ndelangen, I actually found a workaround for our use case. It is a bit hacky but it works nicely and does exactly what we want it to do.
I am still happy to discuss on Discord towards the end of the week - I should have time this Friday so will contact you there. I have signed up for the group already. Thanks again for all your time and help. |
I see this issue in current version of Storybook for React as well ("@storybook/react": "^5.3.18",). @miguelyoobic95's hack works decently enough!!.. P.S: This issue is reproducible in this reference project: https://github.com/karthiks/build-a-burger |
Thanks @miguelyoobic95 for this workaround. Indeed I ran into the same issue where I want to show a dynamic version number. I feel like Storybook shouldn't be opinionated about this. If I want to show a brandTitle AND brandImage, I should be allowed to do it. |
Based on default light theme. This is the recommended way of updating the title and setting some baseline defaults for Storybook UI. **Note** Setting a brand image will completely replace the text. Potential workaround here if we really want logo + text - storybookjs/storybook#5866 (comment)
Describe the bug
When we use the theme variable
brandTitle
on its own, it should replace the Storybook logo in the upper left with a string. Instead, it simply modifies the alt tag for the existing image.Repro in
official-storybook
:System:
The text was updated successfully, but these errors were encountered: