@@ -43,6 +43,10 @@ testRule({
43
43
code : '.x { font: var(--text-display-shorthand); }' ,
44
44
description : 'CSS > Accepts font shorthand variables' ,
45
45
} ,
46
+ {
47
+ code : '.x { font-style: italic; }' ,
48
+ description : 'CSS > Ignores font-style property' ,
49
+ } ,
46
50
] ,
47
51
reject : [
48
52
// Font sizes
@@ -73,25 +77,15 @@ testRule({
73
77
endColumn : 23 ,
74
78
description : "CSS > Replaces '2.5rem' with 'var(--text-display-size)'." ,
75
79
} ,
76
- {
77
- code : '.x { font-size: 1.25rem; }' ,
78
- unfixable : true ,
79
- message : messages . rejected ( '1.25rem' , [ { name : '--text-title-size-medium' } , { name : '--text-subtitle-size' } ] ) ,
80
- line : 1 ,
81
- column : 17 ,
82
- endColumn : 24 ,
83
- description : "CSS > Suggests list of variables to replace '1.25rem' with." ,
84
- } ,
85
80
// Font weights
86
81
{
87
82
code : '.x { font-weight: 500; }' ,
88
- unfixable : true ,
89
- message : messages . rejected ( '500' , [ { name : '--base-text-weight-medium' } , { name : '--text-display-weight' } ] ) ,
83
+ fixed : '.x { font-weight: var(--base-text-weight-medium); }' ,
84
+ message : messages . rejected ( '500' , { name : '--base-text-weight-medium' } ) ,
90
85
line : 1 ,
91
86
column : 19 ,
92
87
endColumn : 22 ,
93
- description :
94
- "CSS > Errors on font-weight of 500 and suggests '--base-text-weight-medium' or '--text-display-weight'." ,
88
+ description : "CSS > Errors on font-weight of 500 and suggests '--base-text-weight-medium'." ,
95
89
} ,
96
90
{
97
91
code : '.x { font-weight: 100; }' ,
@@ -104,18 +98,12 @@ testRule({
104
98
} ,
105
99
{
106
100
code : '.x { font-weight: 800; }' ,
107
- unfixable : true ,
108
- message : messages . rejected ( '800' , [
109
- { name : '--base-text-weight-semibold' } ,
110
- { name : '--text-title-weight-large' } ,
111
- { name : '--text-title-weight-medium' } ,
112
- { name : '--text-title-weight-small' } ,
113
- ] ) ,
101
+ fixed : '.x { font-weight: var(--base-text-weight-semibold); }' ,
102
+ message : messages . rejected ( '800' , { name : '--base-text-weight-semibold' } ) ,
114
103
line : 1 ,
115
104
column : 19 ,
116
105
endColumn : 22 ,
117
- description :
118
- "CSS > Errors on font-weight greater than 600 and suggests '--base-text-weight-semibold', '--text-title-weight-large', '--text-title-weight-medium', or '--text-title-weight-small'." ,
106
+ description : "CSS > Errors on font-weight greater than 600 and suggests '--base-text-weight-semibold'." ,
119
107
} ,
120
108
{
121
109
code : '.x { font-weight: lighter; }' ,
@@ -128,50 +116,30 @@ testRule({
128
116
} ,
129
117
{
130
118
code : '.x { font-weight: bold; }' ,
131
- unfixable : true ,
132
- message : messages . rejected ( 'bold' , [
133
- { name : '--base-text-weight-semibold' } ,
134
- { name : '--text-title-weight-large' } ,
135
- { name : '--text-title-weight-medium' } ,
136
- { name : '--text-title-weight-small' } ,
137
- ] ) ,
119
+ fixed : '.x { font-weight: var(--base-text-weight-semibold); }' ,
120
+ message : messages . rejected ( 'bold' , { name : '--base-text-weight-semibold' } ) ,
138
121
line : 1 ,
139
122
column : 19 ,
140
123
endColumn : 23 ,
141
- description :
142
- "CSS > Errors on 'bold' font-weight keyword and suggests '--base-text-weight-semibold', '--text-title-weight-large', '--text-title-weight-medium', or '--text-title-weight-small'." ,
124
+ description : "CSS > Errors on 'bold' font-weight keyword and suggests '--base-text-weight-semibold'." ,
143
125
} ,
144
126
{
145
127
code : '.x { font-weight: bolder; }' ,
146
- unfixable : true ,
147
- message : messages . rejected ( 'bolder' , [
148
- { name : '--base-text-weight-semibold' } ,
149
- { name : '--text-title-weight-large' } ,
150
- { name : '--text-title-weight-medium' } ,
151
- { name : '--text-title-weight-small' } ,
152
- ] ) ,
128
+ fixed : '.x { font-weight: var(--base-text-weight-semibold); }' ,
129
+ message : messages . rejected ( 'bolder' , { name : '--base-text-weight-semibold' } ) ,
153
130
line : 1 ,
154
131
column : 19 ,
155
132
endColumn : 25 ,
156
- description :
157
- "CSS > Errors on 'bolder' font-weight keyword and suggests '--base-text-weight-semibold', '--text-title-weight-large', '--text-title-weight-medium', or '--text-title-weight-small'." ,
133
+ description : "CSS > Errors on 'bolder' font-weight keyword and suggests '--base-text-weight-semibold'." ,
158
134
} ,
159
135
{
160
136
code : '.x { font-weight: normal; }' ,
161
- unfixable : true ,
162
- message : messages . rejected ( 'normal' , [
163
- { name : '--base-text-weight-normal' } ,
164
- { name : '--text-subtitle-weight' } ,
165
- { name : '--text-body-weight' } ,
166
- { name : '--text-caption-weight' } ,
167
- { name : '--text-codeBlock-weight' } ,
168
- { name : '--text-codeInline-weight' } ,
169
- ] ) ,
137
+ fixed : '.x { font-weight: var(--base-text-weight-normal); }' ,
138
+ message : messages . rejected ( 'normal' , { name : '--base-text-weight-normal' } ) ,
170
139
line : 1 ,
171
140
column : 19 ,
172
141
endColumn : 25 ,
173
- description :
174
- "CSS > Errors on 'normal' font-weight keyword and suggests '--base-text-weight-normal', '--text-subtitle-weight', '--text-body-weight', '--text-caption-weight', '--text-codeBlock-weight' or '--text-codeInline-weight'." ,
142
+ description : "CSS > Errors on 'normal' font-weight keyword and suggests '--base-text-weight-normal'." ,
175
143
} ,
176
144
// Line heights
177
145
{
@@ -194,17 +162,12 @@ testRule({
194
162
} ,
195
163
{
196
164
code : '.x { line-height: 1.5; }' ,
197
- unfixable : true ,
198
- message : messages . rejected ( '1.5' , [
199
- { name : '--text-title-lineHeight-large' } ,
200
- { name : '--text-title-lineHeight-small' } ,
201
- { name : '--text-body-lineHeight-large' } ,
202
- ] ) ,
165
+ fixed : '.x { line-height: var(--text-title-lineHeight-large); }' ,
166
+ message : messages . rejected ( '1.5' , { name : '--text-title-lineHeight-large' } ) ,
203
167
line : 1 ,
204
168
column : 19 ,
205
169
endColumn : 22 ,
206
- description :
207
- "CSS > Errors on '1.5' line-height and suggests '--text-title-lineHeight-large', '--text-title-lineHeight-small', or '--text-body-lineHeight-large'." ,
170
+ description : "CSS > Errors on '1.5' line-height and suggests '--text-title-lineHeight-large'." ,
208
171
} ,
209
172
// Font family
210
173
{
0 commit comments