forked from janus-idp/backstage-showcase
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(app): Add dark theme support (janus-idp#524)
- Loading branch information
1 parent
6d93ba8
commit 68a2221
Showing
8 changed files
with
99 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'app': minor | ||
--- | ||
|
||
Dark theme support has been added to the showcase app. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { UnifiedThemeOptions } from '@backstage/theme'; | ||
|
||
const redhatFont = `@font-face { | ||
font-family: 'Red Hat Font'; | ||
font-style: normal; | ||
font-display: swap; | ||
font-weight: 400; | ||
src: url(/fonts/RedHatText-Regular.woff2) format('woff2'), | ||
url(/fonts/RedHatText-Regular.otf) format('opentype'), | ||
url(/fonts/RedHatText-Regular.ttf) format('truetype'); | ||
}`; | ||
|
||
export const components: UnifiedThemeOptions['components'] = { | ||
MuiCssBaseline: { | ||
styleOverrides: redhatFont, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const fontFamily = '"Red Hat Font", Arial'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { createUnifiedTheme, themes } from '@backstage/theme'; | ||
import { components } from './componentOverrides'; | ||
import { fontFamily } from './consts'; | ||
import { pageTheme } from './pageTheme'; | ||
|
||
export const customDarkTheme = createUnifiedTheme({ | ||
fontFamily, | ||
palette: { | ||
...themes.dark.getTheme('v5')?.palette, | ||
navigation: { | ||
background: '#0f1214', | ||
indicator: '#009596', | ||
color: '#ffffff', | ||
selectedColor: '#ffffff', | ||
navItem: { | ||
hoverBackground: '#030303', | ||
}, | ||
}, | ||
}, | ||
defaultPageTheme: 'home', | ||
pageTheme, | ||
components, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { createUnifiedTheme, themes } from '@backstage/theme'; | ||
import { components } from './componentOverrides'; | ||
import { fontFamily } from './consts'; | ||
import { pageTheme } from './pageTheme'; | ||
|
||
export const customLightTheme = createUnifiedTheme({ | ||
fontFamily, | ||
palette: { | ||
...themes.light.getTheme('v5')?.palette, | ||
navigation: { | ||
background: '#222427', | ||
indicator: '#009596', | ||
color: '#ffffff', | ||
selectedColor: '#ffffff', | ||
navItem: { | ||
hoverBackground: '#4f5255', | ||
}, | ||
}, | ||
}, | ||
defaultPageTheme: 'home', | ||
pageTheme, | ||
components, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { PageTheme, genPageTheme, shapes } from '@backstage/theme'; | ||
|
||
export const pageTheme: Record<string, PageTheme> = { | ||
home: genPageTheme({ colors: ['#005f60', '#73c5c5'], shape: shapes.wave }), | ||
app: genPageTheme({ colors: ['#005f60', '#73c5c5'], shape: shapes.wave }), | ||
apis: genPageTheme({ colors: ['#005f60', '#73c5c5'], shape: shapes.wave }), | ||
documentation: genPageTheme({ | ||
colors: ['#005f60', '#73c5c5'], | ||
shape: shapes.wave, | ||
}), | ||
tool: genPageTheme({ colors: ['#005f60', '#73c5c5'], shape: shapes.round }), | ||
other: genPageTheme({ colors: ['#005f60', '#73c5c5'], shape: shapes.wave }), | ||
}; |
This file was deleted.
Oops, something went wrong.