Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Organise styles and use theme instead of hardcoded values #180

Merged
merged 2 commits into from
Jun 29, 2023

Conversation

wKich
Copy link
Contributor

@wKich wKich commented Jun 28, 2023

No description provided.

Signed-off-by: Dmitriy Lazarev <w@kich.dev>
@wKich wKich requested a review from dagda1 June 28, 2023 14:04
const createParodosThemeOverrides = (
_theme: BackstageTheme,
): ParodosPluginTheme['parodos'] => ({
headerBackground: '#0E2465',
Copy link
Contributor

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?

Copy link
Contributor Author

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),
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor Author

@wKich wKich Jun 29, 2023

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

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>
),
},
],

Copy link
Contributor

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>
@wKich wKich merged commit 44e149d into main Jun 29, 2023
1 check passed
@wKich wKich deleted the dl/parodos-customization branch June 29, 2023 10:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants