Skip to content

Commit 1289310

Browse files
amysortommalerba
authored andcommitted
fix(material/schematics): improve sass comment adding logic
- Refactor the code to be more reusable - Mark comments with TODO(mdc-migration)
1 parent f231404 commit 1289310

39 files changed

+233
-200
lines changed

integration/mdc-migration/golden/src/app/components/autocomplete/autocomplete.component.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.mat-mdc-autocomplete { padding: 16px; }
22

3-
/* TODO: The following rule targets internal classes of autocomplete that may no longer apply for the MDC version. */
4-
3+
/* TODO(mdc-migration): The following rule targets internal classes of autocomplete that may no longer apply for the MDC version. */
54
::ng-deep .mat-autocomplete-panel {
65
background-color: lavenderblush;
76
}

integration/mdc-migration/golden/src/app/components/button/button.component.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
}
44

55

6-
/* TODO: The following rule targets internal classes of button that may no longer apply for the MDC version. */
7-
6+
/* TODO(mdc-migration): The following rule targets internal classes of button that may no longer apply for the MDC version. */
87
::ng-deep .mat-button-wrapper{ color: darkblue; }

integration/mdc-migration/golden/src/app/components/card/card.component.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
padding-left: 24px;
66
}
77

8-
/* TODO: The following rule targets internal classes of card that may no longer apply for the MDC version. */
9-
8+
/* TODO(mdc-migration): The following rule targets internal classes of card that may no longer apply for the MDC version. */
109
.mat-card-flat {
1110
margin: 4px;
1211
}

integration/mdc-migration/golden/src/app/components/checkbox/checkbox.component.scss

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
padding-right: 16px;
33
}
44

5-
/* TODO: The following rule targets internal classes of checkbox that may no longer apply for the MDC version. */
6-
5+
/* TODO(mdc-migration): The following rule targets internal classes of checkbox that may no longer apply for the MDC version. */
76
::ng-deep .mat-checkbox-disabled .mat-checkbox-label {
87
color: slategray;
98
}
10-
/* TODO: The following rule targets internal classes of checkbox that may no longer apply for the MDC version. */
11-
9+
/* TODO(mdc-migration): The following rule targets internal classes of checkbox that may no longer apply for the MDC version. */
1210
.mat-checkbox-label { font-size: 16px; }

integration/mdc-migration/golden/src/app/components/chips/chips.component.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.mat-mdc-chip {
22
background-color: lavender;
3-
/* TODO: The following rule targets internal classes of chips that may no longer apply for the MDC version. */
4-
3+
/* TODO(mdc-migration): The following rule targets internal classes of chips that may no longer apply for the MDC version. */
54
.mat-chip-avatar {
65
outline: 1px solid black;
76
}

integration/mdc-migration/golden/src/app/components/form-field/form-field.component.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
}
88

99

10-
/* TODO: The following rule targets internal classes of form-field that may no longer apply for the MDC version. */
11-
10+
/* TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version. */
1211
.mat-mdc-form-field
1312
.mat-form-field-wrapper {
1413
padding: 16px;

integration/mdc-migration/golden/src/app/components/input/input.component.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
}
44

55

6-
/* TODO: The following rule targets internal classes of input that may no longer apply for the MDC version. */
7-
6+
/* TODO(mdc-migration): The following rule targets internal classes of input that may no longer apply for the MDC version. */
87
.mat-input-server {
98
color: red;
109
}

integration/mdc-migration/golden/src/app/components/list/list.component.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
color: darkblue;
55
}
66

7-
/* TODO: The following rule targets internal classes of list that may no longer apply for the MDC version. */
8-
7+
/* TODO(mdc-migration): The following rule targets internal classes of list that may no longer apply for the MDC version. */
98
.mat-list-item-content {
109
padding: 8px;
1110
}

integration/mdc-migration/golden/src/app/components/menu/menu.component.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@
77
}
88

99

10-
/* TODO: The following rule targets internal classes of menu that may no longer apply for the MDC version. */
11-
10+
/* TODO(mdc-migration): The following rule targets internal classes of menu that may no longer apply for the MDC version. */
1211
.mat-mdc-menu-item .mat-menu-submenu-icon { padding: 12px; }

integration/mdc-migration/golden/src/app/components/paginator/paginator.component.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
justify-content: flex-start;
77
}
88

9-
/* TODO: The following rule targets internal classes of paginator that may no longer apply for the MDC version. */
10-
9+
/* TODO(mdc-migration): The following rule targets internal classes of paginator that may no longer apply for the MDC version. */
1110
.mat-paginator-increment {
1211
padding: 4px;
1312
}

integration/mdc-migration/golden/src/app/components/progress-bar/progress-bar.component.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.mat-mdc-progress-bar {
22
width: 50%;
3-
/* TODO: The following rule targets internal classes of progress-bar that may no longer apply for the MDC version. */
4-
3+
/* TODO(mdc-migration): The following rule targets internal classes of progress-bar that may no longer apply for the MDC version. */
54
.mat-progress-bar-buffer {
65
background-color: red;
76
}

integration/mdc-migration/golden/src/app/components/radio/radio.component.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.mat-mdc-radio-button { padding: 16px; }
22

3-
/* TODO: The following rule targets internal classes of radio that may no longer apply for the MDC version. */
4-
3+
/* TODO(mdc-migration): The following rule targets internal classes of radio that may no longer apply for the MDC version. */
54
.mat-radio-container {
65
padding: 16px;
76
}

integration/mdc-migration/golden/src/app/components/select/select.component.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
padding: 4px;
33
}
44

5-
/* TODO: The following rule targets internal classes of select that may no longer apply for the MDC version. */
6-
5+
/* TODO(mdc-migration): The following rule targets internal classes of select that may no longer apply for the MDC version. */
76
.select-example ::ng-deep.mat-select-value {
87
color: darkblue;
98
}

integration/mdc-migration/golden/src/app/components/slide-toggle/slide-toggle.component.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
}
44

55

6-
/* TODO: The following rule targets internal classes of slide-toggle that may no longer apply for the MDC version. */
7-
6+
/* TODO(mdc-migration): The following rule targets internal classes of slide-toggle that may no longer apply for the MDC version. */
87
.mat-checked .mat-slide-toggle-thumb { color: darkblue; }

integration/mdc-migration/golden/src/app/components/slider/slider.component.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22
width: 50%;
33
}
44

5-
/* TODO: The following rule targets internal classes of slider that may no longer apply for the MDC version. */
6-
5+
/* TODO(mdc-migration): The following rule targets internal classes of slider that may no longer apply for the MDC version. */
76
.mat-slider-thumb { background-color: transparent; }

integration/mdc-migration/golden/src/app/components/tabs/tabs.component.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
.mat-mdc-tab-body {
88
padding: 12px;
99
}
10-
/* TODO: The following rule targets internal classes of tabs that may no longer apply for the MDC version. */
11-
10+
/* TODO(mdc-migration): The following rule targets internal classes of tabs that may no longer apply for the MDC version. */
1211
.mat-tab-label-content {
1312
color: darkblue;
1413
}

integration/mdc-migration/golden/src/app/components/tooltip/tooltip.component.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
}
99
}
1010

11-
/* TODO: The following rule targets internal classes of tooltip that may no longer apply for the MDC version. */
12-
11+
/* TODO(mdc-migration): The following rule targets internal classes of tooltip that may no longer apply for the MDC version. */
1312
.mat-tooltip-handset {
1413
font-size: 12px;
1514
}

src/material/schematics/ng-generate/mdc-migration/rules/components/autocomplete/autocomplete-styles.spec.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,7 @@ describe('autocomplete styles', () => {
150150
}
151151
`,
152152
`
153-
/* TODO: The following rule targets internal classes of autocomplete that may no longer apply for the MDC version. */
154-
153+
/* TODO(mdc-migration): The following rule targets internal classes of autocomplete that may no longer apply for the MDC version. */
155154
.mat-autocomplete-panel {
156155
background-color: red;
157156
}
@@ -168,8 +167,7 @@ describe('autocomplete styles', () => {
168167
}
169168
`,
170169
`
171-
/* TODO: The following rule targets internal classes of autocomplete that may no longer apply for the MDC version. */
172-
170+
/* TODO(mdc-migration): The following rule targets internal classes of autocomplete that may no longer apply for the MDC version. */
173171
.some-class
174172
.mat-autocomplete-panel {
175173
background-color: red;
@@ -186,8 +184,7 @@ describe('autocomplete styles', () => {
186184
}
187185
`,
188186
`
189-
/* TODO: The following rule targets internal classes of autocomplete that may no longer apply for the MDC version. */
190-
187+
/* TODO(mdc-migration): The following rule targets internal classes of autocomplete that may no longer apply for the MDC version. */
191188
.mat-mdc-autocomplete.some-class, .mat-autocomplete-panel {
192189
padding: 16px;
193190
}

src/material/schematics/ng-generate/mdc-migration/rules/components/button/button-styles.spec.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,7 @@ describe('button styles', () => {
213213
}
214214
`,
215215
`
216-
/* TODO: The following rule targets internal classes of button that may no longer apply for the MDC version. */
217-
216+
/* TODO(mdc-migration): The following rule targets internal classes of button that may no longer apply for the MDC version. */
218217
.mat-button-focus-overlay {
219218
background-color: transparent;
220219
}
@@ -246,8 +245,7 @@ describe('button styles', () => {
246245
}
247246
`,
248247
`
249-
/* TODO: The following rule targets internal classes of button that may no longer apply for the MDC version. */
250-
248+
/* TODO(mdc-migration): The following rule targets internal classes of button that may no longer apply for the MDC version. */
251249
.some-class
252250
.mat-button-focus-overlay {
253251
background-color: transparent;
@@ -264,8 +262,7 @@ describe('button styles', () => {
264262
}
265263
`,
266264
`
267-
/* TODO: The following rule targets internal classes of button that may no longer apply for the MDC version. */
268-
265+
/* TODO(mdc-migration): The following rule targets internal classes of button that may no longer apply for the MDC version. */
269266
.mat-mdc-fab.some-class, .mat-button-focus-overlay {
270267
background-color: transparent;
271268
}

src/material/schematics/ng-generate/mdc-migration/rules/components/card/card-styles.spec.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,7 @@ describe('card styles', () => {
176176
}
177177
`,
178178
`
179-
/* TODO: The following rule targets internal classes of card that may no longer apply for the MDC version. */
180-
179+
/* TODO(mdc-migration): The following rule targets internal classes of card that may no longer apply for the MDC version. */
181180
.mat-card-flat {
182181
margin: 4px;
183182
}
@@ -194,8 +193,7 @@ describe('card styles', () => {
194193
}
195194
`,
196195
`
197-
/* TODO: The following rule targets internal classes of card that may no longer apply for the MDC version. */
198-
196+
/* TODO(mdc-migration): The following rule targets internal classes of card that may no longer apply for the MDC version. */
199197
.some-class
200198
.mat-card-flat {
201199
margin: 4px;
@@ -212,8 +210,7 @@ describe('card styles', () => {
212210
}
213211
`,
214212
`
215-
/* TODO: The following rule targets internal classes of card that may no longer apply for the MDC version. */
216-
213+
/* TODO(mdc-migration): The following rule targets internal classes of card that may no longer apply for the MDC version. */
217214
.mat-mdc-card.some-class, .mat-card-flat {
218215
margin: 4px;
219216
}

src/material/schematics/ng-generate/mdc-migration/rules/components/checkbox/checkbox-styles.spec.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@ describe('checkbox styles', () => {
120120
}
121121
`,
122122
`
123-
/* TODO: The following rule targets internal classes of checkbox that may no longer apply for the MDC version. */
124-
123+
/* TODO(mdc-migration): The following rule targets internal classes of checkbox that may no longer apply for the MDC version. */
125124
.mat-checkbox-label {
126125
font-size: 16px;
127126
}
@@ -138,8 +137,7 @@ describe('checkbox styles', () => {
138137
}
139138
`,
140139
`
141-
/* TODO: The following rule targets internal classes of checkbox that may no longer apply for the MDC version. */
142-
140+
/* TODO(mdc-migration): The following rule targets internal classes of checkbox that may no longer apply for the MDC version. */
143141
.some-class
144142
.mat-checkbox-label {
145143
font-size: 16px;
@@ -156,8 +154,7 @@ describe('checkbox styles', () => {
156154
}
157155
`,
158156
`
159-
/* TODO: The following rule targets internal classes of checkbox that may no longer apply for the MDC version. */
160-
157+
/* TODO(mdc-migration): The following rule targets internal classes of checkbox that may no longer apply for the MDC version. */
161158
.mat-mdc-checkbox.some-class, .mat-checkbox-label {
162159
background-color: transparent;
163160
}

src/material/schematics/ng-generate/mdc-migration/rules/components/chips/chips-styles.spec.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,7 @@ describe('chips styles', () => {
171171
}
172172
`,
173173
`
174-
/* TODO: The following rule targets internal classes of chips that may no longer apply for the MDC version. */
175-
174+
/* TODO(mdc-migration): The following rule targets internal classes of chips that may no longer apply for the MDC version. */
176175
.mat-chip-avatar {
177176
border-radius: 4px;
178177
}
@@ -204,8 +203,7 @@ describe('chips styles', () => {
204203
}
205204
`,
206205
`
207-
/* TODO: The following rule targets internal classes of chips that may no longer apply for the MDC version. */
208-
206+
/* TODO(mdc-migration): The following rule targets internal classes of chips that may no longer apply for the MDC version. */
209207
.some-class
210208
.mat-chip-avatar {
211209
border-radius: 4px;
@@ -222,8 +220,7 @@ describe('chips styles', () => {
222220
}
223221
`,
224222
`
225-
/* TODO: The following rule targets internal classes of chips that may no longer apply for the MDC version. */
226-
223+
/* TODO(mdc-migration): The following rule targets internal classes of chips that may no longer apply for the MDC version. */
227224
.mat-mdc-chip.some-class, .mat-chip-avatar {
228225
border-radius: 4px;
229226
}

src/material/schematics/ng-generate/mdc-migration/rules/components/dialog/dialog-styles.spec.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,7 @@ describe('dialog styles', () => {
171171
}
172172
`,
173173
`
174-
/* TODO: The following rule targets internal classes of dialog that may no longer apply for the MDC version. */
175-
174+
/* TODO(mdc-migration): The following rule targets internal classes of dialog that may no longer apply for the MDC version. */
176175
.mat-dialog-close {
177176
font-size: 24px;
178177
}
@@ -189,8 +188,7 @@ describe('dialog styles', () => {
189188
}
190189
`,
191190
`
192-
/* TODO: The following rule targets internal classes of dialog that may no longer apply for the MDC version. */
193-
191+
/* TODO(mdc-migration): The following rule targets internal classes of dialog that may no longer apply for the MDC version. */
194192
.some-class
195193
.mat-dialog-close {
196194
font-size: 24px;
@@ -207,8 +205,7 @@ describe('dialog styles', () => {
207205
}
208206
`,
209207
`
210-
/* TODO: The following rule targets internal classes of dialog that may no longer apply for the MDC version. */
211-
208+
/* TODO(mdc-migration): The following rule targets internal classes of dialog that may no longer apply for the MDC version. */
212209
.mat-mdc-dialog.some-class, .mat-dialog-close {
213210
font-size: 24px;
214211
}

src/material/schematics/ng-generate/mdc-migration/rules/components/form-field/form-field-styles.spec.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,7 @@ describe('form-field styles', () => {
171171
}
172172
`,
173173
`
174-
/* TODO: The following rule targets internal classes of form-field that may no longer apply for the MDC version. */
175-
174+
/* TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version. */
176175
.mat-form-field-wrapper {
177176
padding: 16px;
178177
}
@@ -189,8 +188,7 @@ describe('form-field styles', () => {
189188
}
190189
`,
191190
`
192-
/* TODO: The following rule targets internal classes of form-field that may no longer apply for the MDC version. */
193-
191+
/* TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version. */
194192
.some-class
195193
.mat-form-field-wrapper {
196194
padding: 16px;
@@ -207,8 +205,7 @@ describe('form-field styles', () => {
207205
}
208206
`,
209207
`
210-
/* TODO: The following rule targets internal classes of form-field that may no longer apply for the MDC version. */
211-
208+
/* TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version. */
212209
.mat-mdc-form-field.some-class, .mat-form-field-wrapper {
213210
padding: 16px;
214211
}

0 commit comments

Comments
 (0)