Skip to content

Commit f7989b6

Browse files
authored
fix: DH-16461: Preload --dh-color-text-highlight (#1780) (#1781)
DH-16461: Preload --dh-color-text-highlight **Testing** This doesn't actually impact anything in DHC. If you want to test in DHE, see test plan on DH-16461 and run `npm run start-community` in DHE.
1 parent 8930522 commit f7989b6

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

packages/components/src/theme/ThemeModel.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ export type BaseThemeKey = `default-${BaseThemeType}`;
33
export type CssVariableStyleContent = `:root{${string}`;
44
export type ThemeCssVariableName = `--dh-${string}`;
55

6+
// DHC should only need to preload variables that are required by the empty page
7+
// with loading spinner that shows while plugins are loading. The rest of the
8+
// preload variables defined here are required by DHE due to theme plugins
9+
// loading after login. We should consider moving most of these to the DHE
10+
// codebase. To be addressed by #1679
611
export type ThemePreloadColorVariable =
712
| '--dh-color-accent-contrast'
813
| '--dh-color-accent-bg'
@@ -20,9 +25,7 @@ export type ThemePreloadColorVariable =
2025
| '--dh-color-input-border'
2126
| '--dh-color-input-placeholder'
2227
| '--dh-color-input-focus-border'
23-
// Preloading login specific variables should only be needed in DHE. Including
24-
// them for now until we have a way for DHE to configure them. To be addressed
25-
// by #1679
28+
| '--dh-color-text-highlight'
2629
| '--dh-color-login-form-bg'
2730
| '--dh-color-login-status-message'
2831
| '--dh-color-login-logo-bg'
@@ -48,6 +51,7 @@ export const DEFAULT_DARK_THEME_PALETTE = {
4851
500: '#2f5bc0',
4952
400: '#254ba4',
5053
600: '#3b6bda', // accent color
54+
700: '#4c7dee',
5155
},
5256
red: {
5357
600: '#c73f61',
@@ -66,6 +70,11 @@ export const DEFAULT_DARK_THEME_PALETTE = {
6670
} as const;
6771

6872
// Css properties that are used in preload data with default values.
73+
// DHC should only need to preload variables that are required by the empty page
74+
// with loading spinner that shows while plugins are loading. The rest of the
75+
// preload variables defined here are required by DHE due to theme plugins
76+
// loading after login. We should consider moving most of these to the DHE
77+
// codebase. To be addressed by #1679
6978
export const DEFAULT_PRELOAD_DATA_VARIABLES: Record<
7079
ThemePreloadColorVariable,
7180
string
@@ -86,9 +95,7 @@ export const DEFAULT_PRELOAD_DATA_VARIABLES: Record<
8695
'--dh-color-input-border': DEFAULT_DARK_THEME_PALETTE.gray[600],
8796
'--dh-color-input-placeholder': DEFAULT_DARK_THEME_PALETTE.gray[600],
8897
'--dh-color-input-focus-border': `${DEFAULT_DARK_THEME_PALETTE.blue[600]}d9`, // 85% opacity
89-
// Preloading login specific variables should only be needed in DHE. Including
90-
// them for now until we have a way for DHE to configure them. To be addressed
91-
// by #1679
98+
'--dh-color-text-highlight': `${DEFAULT_DARK_THEME_PALETTE.blue[700]}4d`, // 30% opacity
9299
'--dh-color-login-form-bg': DEFAULT_DARK_THEME_PALETTE.gray[400],
93100
'--dh-color-login-status-message': DEFAULT_DARK_THEME_PALETTE.gray[600],
94101
'--dh-color-login-logo-bg': DEFAULT_DARK_THEME_PALETTE.gray[900],

packages/components/src/theme/__snapshots__/ThemeUtils.test.ts.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ exports[`DEFAULT_PRELOAD_DATA_VARIABLES should match snapshot 1`] = `
2626
"--dh-color-random-area-plot-animation-fg-fill": "#3b6bda14",
2727
"--dh-color-random-area-plot-animation-fg-stroke": "#3b6bda33",
2828
"--dh-color-random-area-plot-animation-grid": "#373438",
29+
"--dh-color-text-highlight": "#4c7dee4d",
2930
}
3031
`;
3132

0 commit comments

Comments
 (0)