Skip to content

Commit

Permalink
Re-organized base themes
Browse files Browse the repository at this point in the history
  • Loading branch information
bmingles committed Oct 10, 2023
1 parent 9f428e5 commit 0302957
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/components/src/theme/ThemeUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ describe('getDefaultBaseThemes', () => {
{
name: 'Default Dark',
themeKey: 'default-dark',
styleContent: 'test-file-stub\ntest-file-stub',
styleContent: 'test-file-stub\ntest-file-stub\ntest-file-stub',
},
{
name: 'Default Light',
Expand Down
9 changes: 4 additions & 5 deletions packages/components/src/theme/ThemeUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ import { assertNotNull, ColorUtils } from '@deephaven/utils';
// },
// ],
// },
import darkThemePalette from './theme_default_dark_palette.css?inline';
import darkThemeSemantic from './theme_default_dark_semantic.css?inline';
import lightTheme from './theme_default_light.css?inline';
import { themeDark } from './theme-dark';
import { themeLight } from './theme-light';
import {
DEFAULT_DARK_THEME_KEY,
DEFAULT_LIGHT_THEME_KEY,
Expand Down Expand Up @@ -117,12 +116,12 @@ export function getDefaultBaseThemes(): ThemeData[] {
{
name: 'Default Dark',
themeKey: DEFAULT_DARK_THEME_KEY,
styleContent: [darkThemePalette, darkThemeSemantic].join('\n'),
styleContent: themeDark,
},
{
name: 'Default Light',
themeKey: DEFAULT_LIGHT_THEME_KEY,
styleContent: lightTheme,
styleContent: themeLight,
},
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ exports[`ThemeProvider setSelectedThemeKey: [ [Object] ] should change selected
data-theme-key="default-dark"
>
test-file-stub
test-file-stub
test-file-stub
</style>
<style
Expand Down Expand Up @@ -61,6 +62,7 @@ exports[`ThemeProvider should load themes based on preload data or default: [ [O
data-theme-key="default-dark"
>
test-file-stub
test-file-stub
test-file-stub
</style>
<style
Expand All @@ -80,6 +82,7 @@ exports[`ThemeProvider should load themes based on preload data or default: [ [O
data-theme-key="default-dark"
>
test-file-stub
test-file-stub
test-file-stub
</style>
<div>
Expand Down
11 changes: 11 additions & 0 deletions packages/components/src/theme/theme-dark/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import themeDarkPalette from './theme-dark-palette.css?inline';
import themeDarkSemantic from './theme-dark-semantic.css?inline';
import themeDarkSemanticGrid from './theme-dark-semantic-grid.css?inline';

export const themeDark = [
themeDarkPalette,
themeDarkSemantic,
themeDarkSemanticGrid,
].join('\n');

export default themeDark;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
:root {
--dh-color-grid-background: var(--dh-color-background);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
--dh-color-border: var(--dh-color-gray-500);
--dh-color-background: var(--dh-color-black);
--dh-color-foreground: var(--dh-color-white);
--dh-color-grid-background: var(--dh-color-background);
--dh-color-content-background: var(--dh-color-gray-100);

/* Text */
Expand Down
5 changes: 5 additions & 0 deletions packages/components/src/theme/theme-light/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import themeLightPalette from './theme-light-palette.css?inline';

export const themeLight = themeLightPalette;

export default themeLight;

0 comments on commit 0302957

Please sign in to comment.