Skip to content

Commit c0d93d1

Browse files
authored
feat: Use unified theming implementation (#36)
1 parent ecb84c5 commit c0d93d1

9 files changed

Lines changed: 200 additions & 438 deletions

File tree

package-lock.json

Lines changed: 162 additions & 210 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"dependencies": {
4747
"@lit-labs/virtualizer": "^2.1.1",
4848
"@lit/context": "^1.1.6",
49-
"igniteui-webcomponents": "~6.4.0",
49+
"igniteui-webcomponents": "~6.5.0",
5050
"lit": "^3.3.2"
5151
},
5252
"devDependencies": {
@@ -68,10 +68,10 @@
6868
"postcss": "^8.5.6",
6969
"sass-embedded": "^1.97.2",
7070
"sinon": "^21.0.1",
71-
"stylelint": "^16.26.1",
72-
"stylelint-config-standard-scss": "^16.0.0",
71+
"stylelint": "^17.0.0",
72+
"stylelint-config-standard-scss": "^17.0.0",
7373
"stylelint-prettier": "^5.0.3",
74-
"stylelint-scss": "^6.14.0",
74+
"stylelint-scss": "^7.0.0",
7575
"tslib": "^2.8.1",
7676
"typedoc": "^0.28.16",
7777
"typescript": "^5.9.3",

scripts/_package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"dependencies": {
3232
"@lit-labs/virtualizer": "~2.1.0",
3333
"@lit/context": "~1.1.5",
34-
"igniteui-webcomponents": "~6.4.0",
34+
"igniteui-webcomponents": "~6.5.0",
3535
"lit": "^3.3.0"
3636
}
3737
}

src/components/grid.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { ContextProvider } from '@lit/context';
22
import type { RenderItemFunction } from '@lit-labs/virtualizer/virtualize.js';
33
import {
4+
θaddThemingController as addThemingController,
45
IgcButtonComponent,
56
IgcChipComponent,
67
IgcDropdownComponent,
@@ -19,7 +20,6 @@ import { getElementFromEventPath } from '../internal/element-from-event-path.js'
1920
import { EventEmitterBase } from '../internal/mixins/event-emitter.js';
2021
import { registerComponent } from '../internal/register.js';
2122
import { GRID_TAG } from '../internal/tags.js';
22-
import { addThemingController } from '../internal/theming.js';
2323
import type {
2424
ColumnConfiguration,
2525
DataPipelineConfiguration,

src/components/header.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { consume } from '@lit/context';
2-
import { IgcIconComponent } from 'igniteui-webcomponents';
2+
import {
3+
θaddThemingController as addThemingController,
4+
IgcIconComponent,
5+
} from 'igniteui-webcomponents';
36
import { html, LitElement, nothing } from 'lit';
47
import { property } from 'lit/decorators.js';
58
import type { StateController } from '../controllers/state.js';
@@ -12,7 +15,6 @@ import { GRID_STATE_CONTEXT } from '../internal/context.js';
1215
import { partMap } from '../internal/part-map.js';
1316
import { registerComponent } from '../internal/register.js';
1417
import { GRID_HEADER_TAG } from '../internal/tags.js';
15-
import { addThemingController } from '../internal/theming.js';
1618
import type { ColumnConfiguration, IgcHeaderContext } from '../internal/types.js';
1719
import { styles } from '../styles/header-cell/header-cell.css.js';
1820
import { all } from '../styles/themes/grid-header-themes.js';
@@ -55,6 +57,7 @@ export default class IgcGridLiteHeader<T extends object> extends LitElement {
5557

5658
addThemingController(this, all);
5759
}
60+
5861
#addResizeEventHandlers() {
5962
const config: AddEventListenerOptions = { once: true };
6063

src/internal/theming.ts

Lines changed: 0 additions & 201 deletions
This file was deleted.

src/internal/types.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import type { ReactiveControllerHost, TemplateResult } from 'lit';
1+
import type { Theme } from 'igniteui-webcomponents';
2+
import type { CSSResult, ReactiveControllerHost, TemplateResult } from 'lit';
23
import type IgcGridLiteCell from '../components/cell.js';
34
import type { IgcGridLite } from '../components/grid.js';
45
import type IgcGridLiteHeader from '../components/header.js';
@@ -8,6 +9,15 @@ import type { SortComparer } from '../operations/sort/types.js';
89
export type NavigationState = 'previous' | 'current';
910
export type GridHost<T extends object> = ReactiveControllerHost & IgcGridLite<T>;
1011

12+
export type Themes = {
13+
light: {
14+
[K in Theme | 'shared']?: CSSResult;
15+
};
16+
dark: {
17+
[K in Theme | 'shared']?: CSSResult;
18+
};
19+
};
20+
1121
type FlatKeys<T> = keyof T;
1222
type DotPaths<T> = {
1323
[K in keyof T & string]: T[K] extends object

src/styles/themes/grid-header-themes.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
import { css } from 'lit';
22

3-
import type { Themes } from '../../internal/theming.js';
4-
3+
import type { Themes } from '../../internal/types.js';
54
// Shared
65
import { styles as bootstrap } from './shared/header.bootstrap.css.js';
76
import { styles as fluent } from './shared/header.fluent.css.js';
87

98
const light = {
109
bootstrap: css`
11-
${bootstrap}
10+
${bootstrap}
1211
`,
1312
fluent: css`
14-
${fluent}
13+
${fluent}
1514
`,
1615
};
1716

1817
const dark = {
1918
bootstrap: css`
20-
${bootstrap}
19+
${bootstrap}
2120
`,
2221
fluent: css`
23-
${fluent}
22+
${fluent}
2423
`,
2524
};
2625

src/styles/themes/grid-themes.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { css } from 'lit';
2-
3-
import type { Themes } from '../../internal/theming.js';
2+
import type { Themes } from '../../internal/types.js';
43
// Dark Overrides
54
import { styles as bootstrapDark } from './dark/grid.bootstrap.css.js';
65
import { styles as fluentDark } from './dark/grid.fluent.css.js';
@@ -17,37 +16,37 @@ import { styles as bootstrap } from './shared/grid.common.css.js';
1716

1817
const light = {
1918
shared: css`
20-
${shared}
19+
${shared}
2120
`,
2221
bootstrap: css`
23-
${bootstrap} ${bootstrapLight}
22+
${bootstrap} ${bootstrapLight}
2423
`,
2524
material: css`
26-
${materialLight}
25+
${materialLight}
2726
`,
2827
fluent: css`
29-
${fluentLight}
28+
${fluentLight}
3029
`,
3130
indigo: css`
32-
${indigoLight}
31+
${indigoLight}
3332
`,
3433
};
3534

3635
const dark = {
3736
shared: css`
38-
${shared}
37+
${shared}
3938
`,
4039
bootstrap: css`
41-
${bootstrapDark}
40+
${bootstrapDark}
4241
`,
4342
material: css`
44-
${materialDark}
43+
${materialDark}
4544
`,
4645
fluent: css`
47-
${fluentDark}
46+
${fluentDark}
4847
`,
4948
indigo: css`
50-
${indigoDark}
49+
${indigoDark}
5150
`,
5251
};
5352

0 commit comments

Comments
 (0)