@@ -44,6 +44,12 @@ public void hslComma() throws Exception {
44
44
color ("foreground: hsl(-270, 60%, 70%, 0.1)" , "foreground: hsl(-270, 60%, 70%, 0.1)" );
45
45
color ("foreground: hsl(-270, 60%, 70%, 0.1)" , "foreground: hsl(-270, 60%, 70%, .1)" );
46
46
color ("foreground: hsl(-270, 60%, 70%, 10%)" , "foreground: hsl(-270, 60%, 70%, 10%)" );
47
+
48
+ // var
49
+ color ("foreground: hsl(var(--v-h), var(--v-s), var(--v-l), var(--v-alpha))" , "foreground: hsl(var(--v-h), var(--v-s), var(--v-l), var(--v-alpha))" );
50
+
51
+ // calc
52
+ color ("foreground: hsl(calc(270), calc(60%), calc(70%), calc(0.1))" , "foreground: hsl(calc(270), calc(60%), calc(70%), calc(0.1))" );
47
53
}
48
54
49
55
/**
@@ -75,6 +81,12 @@ public void hslBlank() throws Exception {
75
81
color ("foreground: hsl(-270 60% 70% / 10%)" , "foreground: hsl(-270 60% 70% / 10%)" );
76
82
77
83
color ("foreground: hsl(-270 60% 70% / none)" , "foreground: hsl(-270 60% 70% / none)" );
84
+
85
+ // var
86
+ color ("foreground: hsl(var(--v-h) var(--v-s) var(--v-l) / var(--v-alpha))" , "foreground: hsl(var(--v-h) var(--v-s) var(--v-l) / var(--v-alpha))" );
87
+
88
+ // calc
89
+ color ("foreground: hsl(calc(270) calc(60%) calc(70%) / calc(0.1))" , "foreground: hsl(calc(270) calc(60%) calc(70%) / calc(0.1))" );
78
90
}
79
91
80
92
/**
@@ -130,6 +142,12 @@ public void hslaComma() throws Exception {
130
142
color ("foreground: hsla(-270, 60%, 70%, 0.1)" , "foreground: hsla(-270, 60%, 70%, 0.1)" );
131
143
color ("foreground: hsla(-270, 60%, 70%, 0.1)" , "foreground: hsla(-270, 60%, 70%, .1)" );
132
144
color ("foreground: hsla(-270, 60%, 70%, 10%)" , "foreground: hsla(-270, 60%, 70%, 10%)" );
145
+
146
+ // var
147
+ color ("foreground: hsla(var(--v-h), var(--v-s), var(--v-l), var(--v-alpha))" , "foreground: hsla(var(--v-h), var(--v-s), var(--v-l), var(--v-alpha))" );
148
+
149
+ // calc
150
+ color ("foreground: hsla(calc(270), calc(60%), calc(70%), calc(0.1))" , "foreground: hsla(calc(270), calc(60%), calc(70%), calc(0.1))" );
133
151
}
134
152
135
153
/**
@@ -161,6 +179,12 @@ public void hslaBlank() throws Exception {
161
179
color ("foreground: hsla(-270 60% 70% / 10%)" , "foreground: hsla(-270 60% 70% / 10%)" );
162
180
163
181
color ("foreground: hsla(-270 60% 70% / none)" , "foreground: hsla(-270 60% 70% / none)" );
182
+
183
+ // var
184
+ color ("foreground: hsla(var(--v-h) var(--v-s) var(--v-l) / var(--v-alpha))" , "foreground: hsla(var(--v-h) var(--v-s) var(--v-l) / var(--v-alpha))" );
185
+
186
+ // calc
187
+ color ("foreground: hsla(calc(270) calc(60%) calc(70%) / calc(0.1))" , "foreground: hsla(calc(270) calc(60%) calc(70%) / calc(0.1))" );
164
188
}
165
189
166
190
/**
@@ -193,33 +217,33 @@ public void hslVariousErrors() throws Exception {
193
217
color ("foreground: hsl(10, 20%, 30%, none)" , "foreground: hsl(10, 20%, 30%, none)" );
194
218
195
219
color (1 , "Error in expression. (Invalid token \" -none\" . Was expecting one of: <S>, <NUMBER>, \" none\" , \" from\" , \" -\" , \" +\" , "
196
- + "<ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <ANGLE_TURN>.)" ,
220
+ + "<ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <ANGLE_TURN>, <FUNCTION_CALC>, <FUNCTION_VAR> .)" ,
197
221
"foreground: hsl(-none 20% 30%)" );
198
- color (1 , "Error in expression. (Invalid token \" -none\" . Was expecting one of: <S>, \" none\" , \" -\" , \" +\" , \" ,\" , <PERCENTAGE>.)" ,
222
+ color (1 , "Error in expression. (Invalid token \" -none\" . Was expecting one of: <S>, \" none\" , \" -\" , \" +\" , \" ,\" , <PERCENTAGE>, <FUNCTION_CALC>, <FUNCTION_VAR> .)" ,
199
223
"foreground: hsl(10 -none 30%)" );
200
- color (1 , "Error in expression. (Invalid token \" -none\" . Was expecting one of: <S>, \" none\" , \" -\" , \" +\" , \" ,\" , <PERCENTAGE>.)" ,
224
+ color (1 , "Error in expression. (Invalid token \" -none\" . Was expecting one of: <S>, \" none\" , \" -\" , \" +\" , \" ,\" , <PERCENTAGE>, <FUNCTION_CALC>, <FUNCTION_VAR> .)" ,
201
225
"foreground: hsl(10 20% -none)" );
202
- color (1 , "Error in expression. (Invalid token \" -none\" . Was expecting one of: <S>, <NUMBER>, \" none\" , \" -\" , \" +\" , <PERCENTAGE>.)" ,
226
+ color (1 , "Error in expression. (Invalid token \" -none\" . Was expecting one of: <S>, <NUMBER>, \" none\" , \" -\" , \" +\" , <PERCENTAGE>, <FUNCTION_CALC>, <FUNCTION_VAR> .)" ,
203
227
"foreground: hsl(10 20% 30% / -none)" );
204
228
205
- color (1 , "Error in expression. (Invalid token \" )\" . Was expecting one of: <S>, <NUMBER>, \" none\" , \" from\" , \" -\" , \" +\" , <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <ANGLE_TURN>.)" ,
229
+ color (1 , "Error in expression. (Invalid token \" )\" . Was expecting one of: <S>, <NUMBER>, \" none\" , \" from\" , \" -\" , \" +\" , <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <ANGLE_TURN>, <FUNCTION_CALC>, <FUNCTION_VAR> .)" ,
206
230
"foreground: hsl()" );
207
- color (1 , "Error in expression. (Invalid token \" )\" . Was expecting one of: <S>, \" none\" , \" -\" , \" +\" , \" ,\" , <PERCENTAGE>.)" ,
231
+ color (1 , "Error in expression. (Invalid token \" )\" . Was expecting one of: <S>, \" none\" , \" -\" , \" +\" , \" ,\" , <PERCENTAGE>, <FUNCTION_CALC>, <FUNCTION_VAR> .)" ,
208
232
"foreground: hsl(10)" );
209
- color (1 , "Error in expression. (Invalid token \" )\" . Was expecting one of: <S>, \" none\" , \" -\" , \" +\" , \" ,\" , <PERCENTAGE>.)" ,
233
+ color (1 , "Error in expression. (Invalid token \" )\" . Was expecting one of: <S>, \" none\" , \" -\" , \" +\" , \" ,\" , <PERCENTAGE>, <FUNCTION_CALC>, <FUNCTION_VAR> .)" ,
210
234
"foreground: hsl(10 20%)" );
211
235
212
- color (1 , "Error in expression. (Invalid token \" )\" . Was expecting one of: <S>, <NUMBER>, \" none\" , \" -\" , \" +\" , <PERCENTAGE>.)" ,
236
+ color (1 , "Error in expression. (Invalid token \" )\" . Was expecting one of: <S>, <NUMBER>, \" none\" , \" -\" , \" +\" , <PERCENTAGE>, <FUNCTION_CALC>, <FUNCTION_VAR> .)" ,
213
237
"foreground: hsl(10, 20%, 30%,)" );
214
- color (1 , "Error in expression. (Invalid token \" )\" . Was expecting one of: <S>, <NUMBER>, \" none\" , \" -\" , \" +\" , <PERCENTAGE>.)" ,
238
+ color (1 , "Error in expression. (Invalid token \" )\" . Was expecting one of: <S>, <NUMBER>, \" none\" , \" -\" , \" +\" , <PERCENTAGE>, <FUNCTION_CALC>, <FUNCTION_VAR> .)" ,
215
239
"foreground: hsl(10, 20%, 30%/)" );
216
240
217
- color (1 , "Error in expression. (Invalid token \" 20\" . Was expecting one of: <S>, \" none\" , \" -\" , \" +\" , <PERCENTAGE>.)" ,
241
+ color (1 , "Error in expression. (Invalid token \" 20\" . Was expecting one of: <S>, \" none\" , \" -\" , \" +\" , <PERCENTAGE>, <FUNCTION_CALC>, <FUNCTION_VAR> .)" ,
218
242
"foreground: hsl(10, 20px, 30)" );
219
- color (1 , "Error in expression. (Invalid token \" 20\" . Was expecting one of: <S>, \" none\" , \" -\" , \" +\" , \" ,\" , <PERCENTAGE>.)" ,
243
+ color (1 , "Error in expression. (Invalid token \" 20\" . Was expecting one of: <S>, \" none\" , \" -\" , \" +\" , \" ,\" , <PERCENTAGE>, <FUNCTION_CALC>, <FUNCTION_VAR> .)" ,
220
244
"foreground: hsl(10 20px 30)" );
221
245
222
- color (1 , "Error in expression. (Invalid token \" 10\" . Was expecting one of: <S>, <NUMBER>, \" none\" , \" from\" , \" -\" , \" +\" , <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <ANGLE_TURN>.)" ,
246
+ color (1 , "Error in expression. (Invalid token \" 10\" . Was expecting one of: <S>, <NUMBER>, \" none\" , \" from\" , \" -\" , \" +\" , <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <ANGLE_TURN>, <FUNCTION_CALC>, <FUNCTION_VAR> .)" ,
223
247
"foreground: hsl('10', 20, 30,)" );
224
248
}
225
249
}
0 commit comments