Skip to content

Commit ac5c4e5

Browse files
authored
chore(theme): Fix theme plugin (#658)
* Revert "Version Packages (#624)" This reverts commit 70390bb. * Revert "fix(theme): integrate with RHDH (#623)" This reverts commit cbb46e4.
1 parent 59ddbd6 commit ac5c4e5

12 files changed

Lines changed: 118 additions & 176 deletions

File tree

workspaces/theme/.changeset/version-bump-1-36-1.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
'@red-hat-developer-hub/backstage-plugin-bc-test': minor
33
'@red-hat-developer-hub/backstage-plugin-mui4-test': minor
44
'@red-hat-developer-hub/backstage-plugin-mui5-test': minor
5+
'@red-hat-developer-hub/backstage-plugin-theme': minor
56
---
67

78
Backstage version bump to v1.36.1

workspaces/theme/plugins/theme/CHANGELOG.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
# @red-hat-developer-hub/backstage-plugin-theme
22

3-
## 0.6.0
4-
5-
### Minor Changes
6-
7-
- cbb46e4: Backstage version bump to v1.36.1 and some UI bug fix.
8-
93
## 0.5.0
104

115
### Minor Changes

workspaces/theme/plugins/theme/package.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@red-hat-developer-hub/backstage-plugin-theme",
3-
"version": "0.6.0",
3+
"version": "0.5.0",
44
"description": "Red Hat Developer Hub Theme",
55
"main": "src/index.ts",
66
"types": "src/index.ts",
@@ -32,7 +32,6 @@
3232
"@backstage/core-plugin-api": "^1.10.4",
3333
"@backstage/theme": "^0.6.4",
3434
"@material-ui/icons": "^4.11.3",
35-
"@mui/icons-material": "^5.17.1",
3635
"@mui/material": "^5.0.0",
3736
"react": "^16.13.1 || ^17.0.0 || ^18.0.0"
3837
},
@@ -72,8 +71,5 @@
7271
"@ciiay",
7372
"@debsmita1",
7473
"@divyanshiGupta"
75-
],
76-
"dependencies": {
77-
"@mui/icons-material": "^5.17.1"
78-
}
74+
]
7975
}

workspaces/theme/plugins/theme/report.api.md

Lines changed: 106 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
44
55
```ts
6-
76
import { AppTheme } from '@backstage/core-plugin-api';
87
import { Theme } from '@mui/material/styles';
98
import { UnifiedThemeOptions } from '@backstage/theme';
@@ -13,18 +12,18 @@ export type BackstageThemePalette = UnifiedThemeOptions['palette'];
1312

1413
// @public (undocumented)
1514
export interface Branding {
16-
// (undocumented)
17-
theme?: {
18-
[key: string]: ThemeConfig;
19-
};
15+
// (undocumented)
16+
theme?: {
17+
[key: string]: ThemeConfig;
18+
};
2019
}
2120

2221
// @public (undocumented)
2322
export interface Config {
24-
// (undocumented)
25-
app: {
26-
branding?: Branding;
27-
};
23+
// (undocumented)
24+
app: {
25+
branding?: Branding;
26+
};
2827
}
2928

3029
// @public (undocumented)
@@ -35,124 +34,120 @@ export const getThemes: () => AppTheme[];
3534

3635
// @public (undocumented)
3736
export interface RHDHThemePalette {
38-
// (undocumented)
39-
cards?: {
40-
headerTextColor: string;
41-
headerBackgroundColor: string;
42-
headerBackgroundImage: string;
43-
};
44-
// (undocumented)
45-
general: {
46-
disabled: string;
47-
disabledBackground: string;
48-
paperBackgroundImage: string;
49-
paperBorderColor: string;
50-
popoverBoxShadow: string;
51-
cardBackgroundColor: string;
52-
cardBorderColor: string;
53-
headerBottomBorderColor: string;
54-
mainSectionBackgroundColor: string;
55-
formControlBackgroundColor: string;
56-
sideBarBackgroundColor?: string;
57-
sidebarBackgroundColor: string;
58-
sidebarItemSelectedBackgroundColor: string;
59-
tableTitleColor: string;
60-
tableSubtitleColor: string;
61-
tableColumnTitleColor: string;
62-
tableRowHover: string;
63-
tableBorderColor: string;
64-
tableBackgroundColor: string;
65-
tabsDisabledBackgroundColor: string;
66-
tabsBottomBorderColor: string;
67-
contrastText: string;
68-
appBarBackgroundColor: string;
69-
appBarBackgroundImage: string;
70-
};
71-
// (undocumented)
72-
primary: {
73-
main: string;
74-
focusVisibleBorder: string;
75-
};
76-
// (undocumented)
77-
secondary: {
78-
main: string;
79-
focusVisibleBorder: string;
80-
};
37+
// (undocumented)
38+
cards?: {
39+
headerTextColor: string;
40+
headerBackgroundColor: string;
41+
headerBackgroundImage: string;
42+
};
43+
// (undocumented)
44+
general: {
45+
disabled: string;
46+
disabledBackground: string;
47+
paperBackgroundImage: string;
48+
paperBorderColor: string;
49+
popoverBoxShadow: string;
50+
cardBackgroundColor: string;
51+
cardBorderColor: string;
52+
headerBottomBorderColor: string;
53+
mainSectionBackgroundColor: string;
54+
formControlBackgroundColor: string;
55+
sideBarBackgroundColor?: string;
56+
sidebarBackgroundColor: string;
57+
sidebarItemSelectedBackgroundColor: string;
58+
tableTitleColor: string;
59+
tableSubtitleColor: string;
60+
tableColumnTitleColor: string;
61+
tableRowHover: string;
62+
tableBorderColor: string;
63+
tableBackgroundColor: string;
64+
tabsDisabledBackgroundColor: string;
65+
tabsBottomBorderColor: string;
66+
contrastText: string;
67+
};
68+
// (undocumented)
69+
primary: {
70+
main: string;
71+
focusVisibleBorder: string;
72+
};
73+
// (undocumented)
74+
secondary: {
75+
main: string;
76+
focusVisibleBorder: string;
77+
};
8178
}
8279

8380
// @public (undocumented)
8481
export interface ThemeConfig {
85-
// (undocumented)
86-
defaultPageTheme?: string;
87-
// (undocumented)
88-
fontFamily?: UnifiedThemeOptions['fontFamily'];
89-
// (undocumented)
90-
htmlFontSize?: UnifiedThemeOptions['htmlFontSize'];
91-
mode?: 'light' | 'dark';
92-
// (undocumented)
93-
options?: ThemeConfigOptions;
94-
// (undocumented)
95-
pageTheme?: Record<string, ThemeConfigPageTheme>;
96-
// (undocumented)
97-
palette?: ThemeConfigPalette;
98-
// (undocumented)
99-
typography?: UnifiedThemeOptions['typography'];
100-
variant?: 'rhdh' | 'backstage';
82+
// (undocumented)
83+
defaultPageTheme?: string;
84+
// (undocumented)
85+
fontFamily?: UnifiedThemeOptions['fontFamily'];
86+
// (undocumented)
87+
htmlFontSize?: UnifiedThemeOptions['htmlFontSize'];
88+
mode?: 'light' | 'dark';
89+
// (undocumented)
90+
options?: ThemeConfigOptions;
91+
// (undocumented)
92+
pageTheme?: Record<string, ThemeConfigPageTheme>;
93+
// (undocumented)
94+
palette?: ThemeConfigPalette;
95+
// (undocumented)
96+
typography?: UnifiedThemeOptions['typography'];
97+
variant?: 'rhdh' | 'backstage';
10198
}
10299

103100
// @public (undocumented)
104101
export interface ThemeConfigOptions {
105-
// (undocumented)
106-
accordions?: 'patternfly' | 'mui';
107-
// (undocumented)
108-
appBar?: 'patternfly' | 'mui';
109-
// (undocumented)
110-
buttons?: 'patternfly' | 'mui';
111-
// (undocumented)
112-
cards?: 'patternfly' | 'mui';
113-
// (undocumented)
114-
checkbox?: 'patternfly' | 'mui';
115-
// (undocumented)
116-
components?: 'rhdh' | 'backstage' | 'mui';
117-
// (undocumented)
118-
dialogs?: 'patternfly' | 'mui';
119-
// (undocumented)
120-
headers?: 'patternfly' | 'mui';
121-
// (undocumented)
122-
inputs?: 'patternfly' | 'mui';
123-
// (undocumented)
124-
pages?: 'patternfly' | 'mui';
125-
// (undocumented)
126-
paper?: 'patternfly' | 'mui';
127-
// (undocumented)
128-
rippleEffect?: 'on' | 'off';
129-
// (undocumented)
130-
sidebars?: 'patternfly' | 'mui';
131-
// (undocumented)
132-
tables?: 'patternfly' | 'mui';
133-
// (undocumented)
134-
tabs?: 'patternfly' | 'mui';
135-
// (undocumented)
136-
toolbars?: 'patternfly' | 'mui';
102+
// (undocumented)
103+
accordions?: 'patternfly' | 'mui';
104+
// (undocumented)
105+
buttons?: 'patternfly' | 'mui';
106+
// (undocumented)
107+
cards?: 'patternfly' | 'mui';
108+
// (undocumented)
109+
checkbox?: 'patternfly' | 'mui';
110+
// (undocumented)
111+
components?: 'rhdh' | 'backstage' | 'mui';
112+
// (undocumented)
113+
dialogs?: 'patternfly' | 'mui';
114+
// (undocumented)
115+
headers?: 'patternfly' | 'mui';
116+
// (undocumented)
117+
inputs?: 'patternfly' | 'mui';
118+
// (undocumented)
119+
pages?: 'patternfly' | 'mui';
120+
// (undocumented)
121+
paper?: 'patternfly' | 'mui';
122+
// (undocumented)
123+
rippleEffect?: 'on' | 'off';
124+
// (undocumented)
125+
sidebars?: 'patternfly' | 'mui';
126+
// (undocumented)
127+
tables?: 'patternfly' | 'mui';
128+
// (undocumented)
129+
tabs?: 'patternfly' | 'mui';
130+
// (undocumented)
131+
toolbars?: 'patternfly' | 'mui';
137132
}
138133

139134
// @public (undocumented)
140135
export interface ThemeConfigPageTheme {
141-
// (undocumented)
142-
backgroundColor?: string | string[];
143-
// (undocumented)
144-
backgroundImage?: string;
145-
// (undocumented)
146-
colors?: string | string[];
147-
// (undocumented)
148-
fontColor?: string;
149-
// (undocumented)
150-
shape?: string;
136+
// (undocumented)
137+
backgroundColor?: string | string[];
138+
// (undocumented)
139+
backgroundImage?: string;
140+
// (undocumented)
141+
colors?: string | string[];
142+
// (undocumented)
143+
fontColor?: string;
144+
// (undocumented)
145+
shape?: string;
151146
}
152147

153148
// @public (undocumented)
154149
export type ThemeConfigPalette = BackstageThemePalette & {
155-
rhdh?: RHDHThemePalette;
150+
rhdh?: RHDHThemePalette;
156151
};
157152

158153
// @public (undocumented)
@@ -174,5 +169,4 @@ export const useThemeOptions: (themeConfig: ThemeConfig) => UnifiedThemeOptions;
174169
export const useThemes: () => AppTheme[];
175170

176171
// (No @packageDocumentation comment for this package)
177-
178172
```

workspaces/theme/plugins/theme/src/darkTheme.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,6 @@ describe('customDarkTheme', () => {
122122
tabsBottomBorderColor: '#444548',
123123

124124
contrastText: '#FFF',
125-
126-
appBarBackgroundColor: '#1b1d21',
127-
appBarBackgroundImage: 'none',
128125
},
129126
primary: {
130127
main: '#1FA7F8',

workspaces/theme/plugins/theme/src/darkTheme.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@ export const customDarkTheme = (): ThemeConfigPalette => {
7777
tabsBottomBorderColor: '#444548',
7878

7979
contrastText: '#FFF',
80-
81-
appBarBackgroundColor: '#1b1d21',
82-
appBarBackgroundImage: 'none',
8380
},
8481
primary: {
8582
main: '#1FA7F8',

workspaces/theme/plugins/theme/src/lightTheme.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,6 @@ describe('customLightTheme', () => {
126126
tabsBottomBorderColor: '#D2D2D2',
127127

128128
contrastText: '#FFF',
129-
130-
appBarBackgroundColor: '#212427',
131-
appBarBackgroundImage: 'none',
132129
},
133130
primary: {
134131
main: '#0066CC',

workspaces/theme/plugins/theme/src/lightTheme.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@ export const customLightTheme = (): ThemeConfigPalette => {
8181
tabsBottomBorderColor: '#D2D2D2',
8282

8383
contrastText: '#FFF',
84-
85-
appBarBackgroundColor: '#212427',
86-
appBarBackgroundImage: 'none',
8784
},
8885
primary: {
8986
main: '#0066CC',

workspaces/theme/plugins/theme/src/themes.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import React from 'react';
1818
import { AppTheme } from '@backstage/core-plugin-api';
1919
import { themes } from '@backstage/theme';
2020

21-
import LightIcon from '@mui/icons-material/WbSunnyRounded';
22-
import DarkIcon from '@mui/icons-material/Brightness2Rounded';
21+
import LightIcon from '@material-ui/icons/WbSunny';
22+
import DarkIcon from '@material-ui/icons/Brightness2';
2323
import { createTheme } from '@mui/material/styles';
2424

2525
import {

workspaces/theme/plugins/theme/src/types.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ export interface RHDHThemePalette {
5050
tabsBottomBorderColor: string;
5151

5252
contrastText: string;
53-
54-
appBarBackgroundColor: string;
55-
appBarBackgroundImage: string;
5653
};
5754

5855
primary: {
@@ -115,8 +112,6 @@ export interface ThemeConfigOptions {
115112
tables?: 'patternfly' | 'mui';
116113

117114
tabs?: 'patternfly' | 'mui';
118-
119-
appBar?: 'patternfly' | 'mui';
120115
}
121116

122117
export interface ThemeConfig {

0 commit comments

Comments
 (0)