Skip to content

Commit ab58c9e

Browse files
authored
themes(all): remove param from component themes (#15191)
1 parent d1feefe commit ab58c9e

File tree

24 files changed

+177
-41
lines changed

24 files changed

+177
-41
lines changed

projects/igniteui-angular/migrations/migration-collection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,11 @@
206206
"version": "18.2.3",
207207
"description": "Updates Ignite UI for Angular from v18.2.0 to v18.2.3",
208208
"factory": "./update-18_2_3"
209+
},
210+
"migration-42": {
211+
"version": "19.1.0",
212+
"description": "Updates Ignite UI for Angular from v18.2.3 to v19.1.0",
213+
"factory": "./update-19_1_0"
209214
}
210215
}
211216
}
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
{
2+
"$schema": "../../common/schema/theme-changes.schema.json",
3+
"changes": [
4+
{
5+
"name": "$elevations",
6+
"owner": "badge-theme",
7+
"remove": true,
8+
"type": "property"
9+
},
10+
{
11+
"name": "$elevations",
12+
"owner": "bottom-nav-theme",
13+
"remove": true,
14+
"type": "property"
15+
},
16+
{
17+
"name": "$elevations",
18+
"owner": "button-theme",
19+
"remove": true,
20+
"type": "property"
21+
},
22+
{
23+
"name": "$elevations",
24+
"owner": "card-theme",
25+
"remove": true,
26+
"type": "property"
27+
},
28+
{
29+
"name": "$elevations",
30+
"owner": "carousel-theme",
31+
"remove": true,
32+
"type": "property"
33+
},
34+
{
35+
"name": "$elevations",
36+
"owner": "chip-theme",
37+
"remove": true,
38+
"type": "property"
39+
},
40+
{
41+
"name": "$elevations",
42+
"owner": "column-actions-theme",
43+
"remove": true,
44+
"type": "property"
45+
},
46+
{
47+
"name": "$elevations",
48+
"owner": "dialog-theme",
49+
"remove": true,
50+
"type": "property"
51+
},
52+
{
53+
"name": "$elevations",
54+
"owner": "drop-down-theme",
55+
"remove": true,
56+
"type": "property"
57+
},
58+
{
59+
"name": "$elevations",
60+
"owner": "grid-toolbar-theme",
61+
"remove": true,
62+
"type": "property"
63+
},
64+
{
65+
"name": "$elevations",
66+
"owner": "grid-theme",
67+
"remove": true,
68+
"type": "property"
69+
},
70+
{
71+
"name": "$elevations",
72+
"owner": "icon-button-theme",
73+
"remove": true,
74+
"type": "property"
75+
},
76+
{
77+
"name": "$elevations",
78+
"owner": "input-group-theme",
79+
"remove": true,
80+
"type": "property"
81+
},
82+
{
83+
"name": "$elevations",
84+
"owner": "navbar-theme",
85+
"remove": true,
86+
"type": "property"
87+
},
88+
{
89+
"name": "$elevations",
90+
"owner": "navdrawer-theme",
91+
"remove": true,
92+
"type": "property"
93+
},
94+
{
95+
"name": "$elevations",
96+
"owner": "query-builder-theme",
97+
"remove": true,
98+
"type": "property"
99+
},
100+
{
101+
"name": "$elevations",
102+
"owner": "snackbar-theme",
103+
"remove": true,
104+
"type": "property"
105+
},
106+
{
107+
"name": "$elevations",
108+
"owner": "splitter-theme",
109+
"remove": true,
110+
"type": "property"
111+
},
112+
{
113+
"name": "$elevations",
114+
"owner": "time-picker-theme",
115+
"remove": true,
116+
"type": "property"
117+
}
118+
]
119+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import * as path from 'path';
2+
3+
import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
4+
import { setupTestTree } from '../common/setup.spec';
5+
6+
const version = '19.1.0';
7+
const themes = [
8+
'badge-theme', 'bottom-nav-theme', 'button-theme', 'card-theme', 'carousel-theme',
9+
'chip-theme', 'column-actions-theme', 'dialog-theme', 'drop-down-theme', 'grid-toolbar-theme',
10+
'grid-theme', 'icon-button-theme', 'input-group-theme', 'navbar-theme', 'navdrawer-theme',
11+
'query-builder-theme', 'snackbar-theme', 'splitter-theme', 'time-picker-theme'
12+
];
13+
const testFilePath = '/testSrc/appPrefix/component/${theme}.component.scss';
14+
15+
describe(`Update to ${version}`, () => {
16+
let appTree: UnitTestTree;
17+
const schematicRunner = new SchematicTestRunner('ig-migrate', path.join(__dirname, '../migration-collection.json'));
18+
19+
beforeEach(() => {
20+
appTree = setupTestTree();
21+
});
22+
23+
const migrationName = 'migration-42';
24+
25+
themes.forEach(theme => {
26+
it('should remove the $elevations property from all component themes', async () => {
27+
appTree.create(
28+
testFilePath,
29+
`$custom-${theme}: ${theme}($elevations: $my-elevations);`
30+
);
31+
32+
const tree = await schematicRunner.runSchematic(migrationName, {}, appTree);
33+
34+
expect(tree.readContent(testFilePath)).toEqual(
35+
`$custom-${theme}: ${theme}();`
36+
);
37+
});
38+
});
39+
});
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import type {
2+
Rule,
3+
SchematicContext,
4+
Tree
5+
} from '@angular-devkit/schematics';
6+
import { UpdateChanges } from '../common/UpdateChanges';
7+
8+
const version = '19.1.0';
9+
10+
export default (): Rule => async (host: Tree, context: SchematicContext) => {
11+
context.logger.info(`Applying migration for Ignite UI for Angular to version ${version}`);
12+
const update = new UpdateChanges(__dirname, host, context);
13+
update.applyChanges();
14+
};

projects/igniteui-angular/src/lib/core/styles/components/badge/_badge-theme.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
/// will be assigned automatically to a contrasting color.
1414
///
1515
/// @param {Map} $schema [$light-material-schema] - The schema used as basis for styling the component.
16-
/// @param {Map} $elevations [null] - The elevations (shadows) map to be used.
1716
/// @param {Color} $icon-color [null] - The icon color used.
1817
/// @param {Color} $text-color [null] - The text color used.
1918
/// @param {Color} $border-color [null] - The border color used.
@@ -29,7 +28,6 @@
2928
/// @include css-vars($my-badge-theme);
3029
@function badge-theme(
3130
$schema: $light-material-schema,
32-
$elevations: null,
3331
3432
$icon-color: null,
3533
$text-color: null,

projects/igniteui-angular/src/lib/core/styles/components/bottom-nav/_bottom-nav-theme.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
/// If only background color is specified,
1515
/// the label and icon colors will be assigned automatically to a contrasting color.
1616
/// @param {Map} $schema [$light-material-schema] - The schema used as basis for styling the component.
17-
/// @param {Map} $elevations [null] - The elevations (shadows) map to be used.
1817
/// @param {Color} $background [null] - The background color used for the toast.
1918
/// @param {Color} $label-color [null] - The label color used in idle state.
2019
/// @param {Color} $icon-color [null] - The icon color used in idle state.
@@ -31,7 +30,6 @@
3130
/// @include css-vars($my-bottom-nav-theme);
3231
@function bottom-nav-theme(
3332
$schema: $light-material-schema,
34-
$elevations: null,
3533
$background: null,
3634
$icon-color: null,
3735
$icon-selected-color: null,

projects/igniteui-angular/src/lib/core/styles/components/button-group/_button-group-theme.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
/// will be assigned automatically to a contrasting color.
1515
/// Does ___not___ apply for disabled state colors.
1616
/// @param {Map} $schema [$light-material-schema] - The schema used as basis for styling the component.
17-
/// @param {Map} $elevations [null] - The elevations (shadows) map to be used.
1817
///
1918
/// @param {box-shadow} $shadow [null] - The shadow to be applied for the button group.
2019
/// @param {Color} $item-text-color [null]- The text color for button group items.
@@ -69,7 +68,6 @@
6968
/// @include css-vars($my-button-group-theme);
7069
@function button-group-theme(
7170
$schema: $light-material-schema,
72-
$elevations: null,
7371
$shadow: null,
7472
7573
$item-text-color: null,

projects/igniteui-angular/src/lib/core/styles/components/button/_button-theme.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
/// will be assigned automatically to a contrasting color.
1616
/// Does ___not___ apply for disabled state colors.
1717
/// @param {Map} $schema [$light-material-schema] - The schema used as basis for styling the component.
18-
/// @param {Map} $elevations [$elevations] - The elevations (shadows) map to be used.
1918
/// @param {Color} $background [null] - The background color of the button.
2019
/// @param {Color} $foreground [null] - The text color of the button.
2120
/// @param {Color} $icon-color [null] - The icon color in the button.
@@ -57,7 +56,6 @@
5756
/// @include css-vars($my-button-theme);
5857
@function button-theme(
5958
$schema: $light-material-schema,
60-
$elevations: null,
6159
6260
$background: null,
6361
$foreground: null,

projects/igniteui-angular/src/lib/core/styles/components/card/_card-theme.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
///
1414
/// @param {Map} $schema [$light-material-schema] - The schema used as basis for styling the component.
15-
/// @param {Map} $elevations [$elevations] - The elevations (shadows) map to be used.
1615
/// @param {Color} $background [null] - The card background color.
1716
/// @param {Color} $outline-color [null] - The color of the outline for outlined type cards.
1817
/// @param {Color} $header-text-color [null] - The text color of the card title.
@@ -32,7 +31,6 @@
3231
/// @include css-vars($my-card-theme);
3332
@function card-theme(
3433
$schema: $light-material-schema,
35-
$elevations: null,
3634
3735
$border-radius: null,
3836
$background: null,

projects/igniteui-angular/src/lib/core/styles/components/carousel/_carousel-theme.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
////
1313

1414
/// @param {Map} $schema [$light-material-schema] - The schema used as basis for styling the component.
15-
/// @param {Map} $elevations [null] - The elevations (shadows) map to be used.
1615
/// @param {Color} $slide-background [null] - The slide background color.
1716
/// @param {Color} $button-background [null] - The previous/next buttons idle background color.
1817
/// @param {Color} $button-hover-background [null] - The previous/next buttons hover background color.
@@ -44,7 +43,6 @@
4443
/// @include css-vars($my-carousel-theme);
4544
@function carousel-theme(
4645
$schema: $light-material-schema,
47-
$elevations: null,
4846
4947
$border-radius: null,
5048
$button-shadow: null,

0 commit comments

Comments
 (0)