Skip to content

Commit

Permalink
feat: 兼容暗黑模式
Browse files Browse the repository at this point in the history
  • Loading branch information
lijinke666 committed Nov 20, 2023
1 parent 0aec291 commit 2f68e70
Show file tree
Hide file tree
Showing 23 changed files with 3,314 additions and 1,846 deletions.
2,190 changes: 2,143 additions & 47 deletions packages/s2-core/__tests__/spreadsheet/__snapshots__/theme-spec.ts.snap

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions packages/s2-core/__tests__/spreadsheet/theme-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import type {
TextBaseline,
TextTheme,
ThemeCfg,
ThemeName,
} from '@/common/interface/theme';
import type { Node } from '@/facet/layout/node';
import type { PivotSheet } from '@/sheet-type';
Expand Down Expand Up @@ -66,6 +67,17 @@ describe('SpreadSheet Theme Tests', () => {
expect(s2.theme).toEqual(s2.getTheme());
});

test.each(['dark', 'gray', 'colorful', 'default'] as ThemeName[])(
'should get %s theme',
(name) => {
s2.setThemeCfg({
name,
});

expect(s2.theme).toMatchSnapshot();
},
);

test.each(CELL_TYPES)(
"should assign the same color for %s's text and icon",
async (cellType: CellType) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/s2-core/src/theme/palette/dark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const paletteDark: Palette = {
'#7899ff',
'#7899ff',
'#f0f0f0',
'#ffffff',
'#dcdcdc',
],
semanticColors: { red: '#FF4D4F', green: '#29A294', yellow: '#FAAD14' },
};
Loading

0 comments on commit 2f68e70

Please sign in to comment.