storybook: @storybook/theming brand property does not update with custom logo/svg
Describe the bug
brand property in @storybook/theming create() function has no effect
Expected behavior
Logo should reflect SVG component from brand property.
Screenshots

Code snippets
config.ts
import {
addParameters,
...
} from '@storybook/react';
...
import { theme } from './theme';
...
addParameters({
options: {
theme,
},
});
theme.ts
import { create } from '@storybook/theming';
import { logo } from './logo';
export const theme = create({
base: 'light',
colorPrimary: PistachioLightened,
colorSecondary: VimeoBlue,
...
brand: logo,
});
logo.tsx
import React from 'react';
export const logo = ({ alt, ...props }) => (
<svg alt={alt} {...props}>
...
</svg>
);
System:
- OS: macOS
- Device: all
- Browser: all
- Framework: React
- Addons:
@storybook/theming - Version: 5.0.0
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 11
- Comments: 31 (9 by maintainers)
I got this to work with an SVG. It’s important to set the
widthandheightinside the svg. Here is what worked for me:logo.svg
theme.js
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.
My issue is resolved by removing the
storybook-dark-modeaddon.https://github.com/hipstersmoothie/storybook-dark-mode/issues/157
I can’t get the general branding working on
Storybook 5.1.0-alpha.24. That means neitherbrandTitlenorbrandImageseem to have an effect. The rest of the theming seems to be working fine though.I tried the following:
brandUrlHad 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: https://github.com/storybookjs/storybook/issues/13200#issuecomment-733816046
Essentially, you might have to run storybook with the
--no-manager-cacheflag.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 😕
@DimitrK I think you can get more info from #6521
I got this working by removing the
namefrom parameter options.