-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
@storybook/theming brand property does not update with custom logo/svg #5878
Comments
I'm experiencing the same thing |
I think you want |
I tried both brandImage and brand and still am only seeing the title. :( Any other things to try? |
I'm guessing this is probably a duplicate to #5866 |
Same behavior. I modified the brand property, and nothing happens. |
FWIW The default storybook logo doesn't even show up for me, it only shows the title of the Storybook. Would this have anything to do with this? Screenshot |
The below worked for me. I just had to ensure I didn't have a name set in the main storybook config file under addParameters. That seems to overwrite the logo.
|
Yup, I had brandImage as a property within brand for some reason. Also it was helpful to note that the brandImage value should be a url (or a data url if you are using the included webpack url-loader) |
@regs79 Solution worked for me too. SVG's didn't work though and I couldn't have a URL set in the storybook config. |
@ndelangen Since you're working on the theming documentation, please make sure this gets clarified in the docs. |
I got this to work with an SVG. It's important to set the logo.svg
theme.js
|
@wirtzdan Do you have a custom webpack config to support loading SVG files? |
@seanmcintyre The reason this works without the custom webpack config is because |
This is not working for me: import { create } from '@storybook/theming';
export default create({
base: 'light',
colorPrimary: '#8ff8ff',
colorSecondary: '#6e7d81',
fontBase: "'proxima-nova', arial, sans-serif",
fontCode: 'monospace',
brandImage: '/logo.png',
brandTitle: 'Components',
brandUrl: 'https://components.dev',
}) If i load the page, then set the 'logo' property on the themeprovider via react dev tools to '/logo.png', it updates and displays normally. |
I have tried multiple different ways to try and load an svg as a logo but no luck. This is what I have tried: config.js
and no luck. I have also added The result is I still see the Storybook logo being loaded in. There seems to be some confusion as to whether this brandImage variable is a URL to an svg, or a URL to a png, or an import of an svg, or a require of an svg using svg-inline-loader. @shilman can you clarify? i'm using:
|
@rezaabedian |
I'm loading an svg file from my directory. This is converted to a base64 string and prefixed with |
@shilman thank you for getting back to me, I will try that. Edit: @shilman I have tried that and no luck. Intact, if you look at the localStorage representation of the store, you see that brandImage is set to null. Edit 2: @shilman I downgraded from 5.1.0-alpha.20 to 5.0.6 and it's working. @Pixelatex could you provide a sample of how you do that? I'd like to do something similar! |
Then just use the converted logo. This works in a theme file but without height/width added on the img element, you won't see it :/ |
I can't get the general branding working on I tried the following:
|
I got this working by removing the
|
I reproduce the same issue with Storybook version 5.0.5 I had tried with the brand, brandImage, brandTitle but with every case showing default text "Storybook". I want to replace this text with my own logo. Does anyone have any suggestion regarding this issue? |
Hi, as @milesj found out, you have to remove the "name" option, and than "brandImage" must be a url: I couldn't point it to a local asset, so using a public url just works (I use the url of my logo image on a cdn). |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
In ./storybook/manager.js I have this code: import { addons } from "@storybook/addons";
import { create } from "@storybook/theming/create";
addons.setConfig({
theme: create({
base: "light",
brandTitle: "COMPANY NAME",
brandUrl: "https://example.com",
// brandImage: "https://placehold.it/350x150",
colorPrimary: "hotpink",
colorSecondary: "orangered"
})
}); I can see the brandImage but the Title goes away even if the image is very small. |
@alexdobsom that's the design. once you use the brandImage, it takes over. i think the rationale is that if you care enough to override the brand image you probably also care about the typography, so use a bigger image that includes that. |
The title IS used as the image alt/title attribute though, so you should still provide it |
Had an issue where the logo just wouldn't show, figured it was caching because I couldn't change anything about the theme, all of a sudden. This helped me: #13200 (comment) Essentially, you might have to run storybook with the |
Migrated to 6.3.4, seeing the same issue. // .storybook/manager.js
import { addons } from "@storybook/addons";
import { create } from "@storybook/theming";
addons.setConfig({
theme: create({
base: "light",
brandTitle: "ABC Storybook",
brandUrl: "https://www.abc.com/",
brandImage:
"https://abc/xyz.png",
}),
}); |
My issue is resolved by removing the |
Describe the bug
brand
property in@storybook/theming
create()
function has no effectExpected behavior
Logo should reflect SVG component from
brand
property.Screenshots
Code snippets
config.ts
theme.ts
logo.tsx
System:
@storybook/theming
The text was updated successfully, but these errors were encountered: