-
Notifications
You must be signed in to change notification settings - Fork 13
Organise styles and use theme instead of hardcoded values #180
Conversation
Signed-off-by: Dmitriy Lazarev <w@kich.dev>
const createParodosThemeOverrides = ( | ||
_theme: BackstageTheme, | ||
): ParodosPluginTheme['parodos'] => ({ | ||
headerBackground: '#0E2465', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to think about dark mode and light mode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's default color for parodos. And when we are overriding theme we don't know what kind of theme it is, light or dark it's just a theme.
) => ({ | ||
...theme, | ||
parodos: { | ||
...createParodosThemeOverrides(theme), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks good, I was thinking each client could have a file or something with their overrides but this looks good for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, you mean to allow specify colours from yaml file, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case you can't switch themes through backstage in UI. So I suggest to use backstage theme API
backstage-parodos/packages/app/src/App.tsx
Lines 45 to 68 in 6c385da
const parodosTheme: ParodosPluginTheme = createParodosTheme({ | |
...lightTheme, | |
parodos: { | |
headerBackground: '#003B70', | |
}, | |
}); | |
const app = createApp({ | |
apis, | |
components: { | |
SignInPage: ParodosSignInPage, | |
}, | |
themes: [ | |
{ | |
id: 'parodos', | |
title: 'Parodos', | |
variant: 'light', | |
Provider: ({ children }) => ( | |
<ThemeProvider theme={parodosTheme}> | |
<CssBaseline>{children}</CssBaseline> | |
</ThemeProvider> | |
), | |
}, | |
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets just ship this and see what happens when we apply it to citibank
Signed-off-by: Dmitriy Lazarev <w@kich.dev>
No description provided.