Skip to content

Commit 900a5c8

Browse files
committed
fix nav and tab color
1 parent ba3500b commit 900a5c8

File tree

5 files changed

+66
-13
lines changed

5 files changed

+66
-13
lines changed

.changeset/sweet-colts-exercise.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'app': minor
3+
---
4+
5+
updated Nav and tab styles to match PatternFly5.

packages/app/src/components/Root/Root.tsx

-3
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ import { IconComponent, useApp } from '@backstage/core-plugin-api';
2929
const useStyles = makeStyles()({
3030
sidebarItem: {
3131
textDecorationLine: 'none',
32-
'&:hover': {
33-
textDecorationLine: 'underline',
34-
},
3532
},
3633
});
3734

+51-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { UnifiedThemeOptions } from '@backstage/theme';
2+
import { ThemeColors } from '../types/types';
23

34
const redhatFont = `@font-face {
45
font-family: 'Red Hat Font';
@@ -10,8 +11,54 @@ const redhatFont = `@font-face {
1011
url(/fonts/RedHatText-Regular.ttf) format('truetype');
1112
}`;
1213

13-
export const components: UnifiedThemeOptions['components'] = {
14-
MuiCssBaseline: {
15-
styleOverrides: redhatFont,
16-
},
14+
export const components = (
15+
themeColors: ThemeColors,
16+
): UnifiedThemeOptions['components'] => {
17+
return {
18+
BackstageHeaderTabs: {
19+
styleOverrides: {
20+
tabsWrapper: {
21+
paddingLeft: '0px',
22+
},
23+
defaultTab: {
24+
textTransform: 'none',
25+
fontSize: '0.875rem',
26+
},
27+
},
28+
},
29+
MuiTabs: {
30+
defaultProps: {
31+
TabIndicatorProps: {
32+
style: {
33+
height: '3px',
34+
background: themeColors.navigationIndicatorColor || '#0066CC',
35+
},
36+
},
37+
},
38+
styleOverrides: {
39+
root: {
40+
borderBottom: '1px solid #d2d2d2',
41+
},
42+
},
43+
},
44+
MuiTab: {
45+
defaultProps: {
46+
disableRipple: true,
47+
},
48+
styleOverrides: {
49+
root: {
50+
minWidth: 'initial !important',
51+
'&:hover': {
52+
boxShadow: '0 -3px #b8bbbe inset',
53+
},
54+
},
55+
disabled: {
56+
backgroundColor: '#6a6e73',
57+
},
58+
},
59+
},
60+
MuiCssBaseline: {
61+
styleOverrides: redhatFont,
62+
},
63+
};
1764
};

packages/app/src/themes/darkTheme.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ export const customDarkTheme = (themeColors: ThemeColors) =>
1515
}),
1616
navigation: {
1717
background: '#0f1214',
18-
indicator: themeColors.navigationIndicatorColor || '#009596',
18+
indicator: themeColors.navigationIndicatorColor || '#0066CC',
1919
color: '#ffffff',
2020
selectedColor: '#ffffff',
2121
navItem: {
22-
hoverBackground: '#030303',
22+
hoverBackground: '#3c3f42',
2323
},
2424
},
2525
},
2626
defaultPageTheme: 'home',
2727
pageTheme: pageTheme(themeColors),
28-
components,
28+
components: components(themeColors),
2929
});

packages/app/src/themes/lightTheme.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,19 @@ export const customLightTheme = (themeColors: ThemeColors) =>
1515
}),
1616
navigation: {
1717
background: '#222427',
18-
indicator: themeColors.navigationIndicatorColor || '#009596',
18+
indicator: themeColors.navigationIndicatorColor || '#0066CC',
1919
color: '#ffffff',
2020
selectedColor: '#ffffff',
2121
navItem: {
22-
hoverBackground: '#4f5255',
22+
hoverBackground: '#3c3f42',
2323
},
2424
},
25+
text: {
26+
primary: '#151515',
27+
secondary: '#757575',
28+
},
2529
},
2630
defaultPageTheme: 'home',
2731
pageTheme: pageTheme(themeColors),
28-
components,
32+
components: components(themeColors),
2933
});

0 commit comments

Comments
 (0)