@@ -44,6 +44,12 @@ public void hslComma() throws Exception {
4444 color ("foreground: hsl(-270, 60%, 70%, 0.1)" , "foreground: hsl(-270, 60%, 70%, 0.1)" );
4545 color ("foreground: hsl(-270, 60%, 70%, 0.1)" , "foreground: hsl(-270, 60%, 70%, .1)" );
4646 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))" );
4753 }
4854
4955 /**
@@ -75,6 +81,12 @@ public void hslBlank() throws Exception {
7581 color ("foreground: hsl(-270 60% 70% / 10%)" , "foreground: hsl(-270 60% 70% / 10%)" );
7682
7783 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))" );
7890 }
7991
8092 /**
@@ -130,6 +142,12 @@ public void hslaComma() throws Exception {
130142 color ("foreground: hsla(-270, 60%, 70%, 0.1)" , "foreground: hsla(-270, 60%, 70%, 0.1)" );
131143 color ("foreground: hsla(-270, 60%, 70%, 0.1)" , "foreground: hsla(-270, 60%, 70%, .1)" );
132144 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))" );
133151 }
134152
135153 /**
@@ -161,6 +179,12 @@ public void hslaBlank() throws Exception {
161179 color ("foreground: hsla(-270 60% 70% / 10%)" , "foreground: hsla(-270 60% 70% / 10%)" );
162180
163181 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))" );
164188 }
165189
166190 /**
@@ -193,33 +217,33 @@ public void hslVariousErrors() throws Exception {
193217 color ("foreground: hsl(10, 20%, 30%, none)" , "foreground: hsl(10, 20%, 30%, none)" );
194218
195219 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> .)" ,
197221 "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> .)" ,
199223 "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> .)" ,
201225 "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> .)" ,
203227 "foreground: hsl(10 20% 30% / -none)" );
204228
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> .)" ,
206230 "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> .)" ,
208232 "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> .)" ,
210234 "foreground: hsl(10 20%)" );
211235
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> .)" ,
213237 "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> .)" ,
215239 "foreground: hsl(10, 20%, 30%/)" );
216240
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> .)" ,
218242 "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> .)" ,
220244 "foreground: hsl(10 20px 30)" );
221245
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> .)" ,
223247 "foreground: hsl('10', 20, 30,)" );
224248 }
225249}
0 commit comments