@@ -255,6 +255,16 @@ test('should allow transitive values within calc without spaces', async (t) => {
255
255
) ;
256
256
} ) ;
257
257
258
+ test ( 'should allow transitive values containing spaces, like CSS relative colors' , async ( t ) => {
259
+ await run (
260
+ t ,
261
+ '@value mixedColor: color-mix(in hsl, hsl(200 50 80), coral 80%);\n'
262
+ + '@value mixedColorA90: hsl(from mixedColor h s l / 90%);' ,
263
+ '@value mixedColor: color-mix(in hsl, hsl(200 50 80), coral 80%);\n'
264
+ + '@value mixedColorA90: hsl(from color-mix(in hsl, hsl(200 50 80), coral 80%) h s l / 90%);' ,
265
+ ) ;
266
+ } ) ;
267
+
258
268
test ( 'should replace inside custom properties' , async ( t ) => {
259
269
await run (
260
270
t ,
@@ -300,10 +310,10 @@ test('should allow custom-property-style names', async (t) => {
300
310
test ( 'should allow all colour types' , async ( t ) => {
301
311
await run (
302
312
t ,
303
- '@value named: red; @value hex3char #0f0; @value hex6char #00ff00; @value rgba rgba(34, 12, 64, 0.3); @value hsla hsla(220, 13.0%, 18.0%, 1);\n'
304
- + '.foo { color: named; background-color: hex3char; border-top-color: hex6char; border-bottom-color: rgba; outline-color: hsla; }' ,
305
- '@value named: red; @value hex3char #0f0; @value hex6char #00ff00; @value rgba rgba(34, 12, 64, 0.3); @value hsla hsla(220, 13.0%, 18.0%, 1);\n'
306
- + '.foo { color: red; background-color: #0f0; border-top-color: #00ff00; border-bottom-color: rgba(34, 12, 64, 0.3); outline-color: hsla(220, 13.0%, 18.0%, 1); }' ,
313
+ '@value named: red; @value hex3char #0f0; @value hex6char #00ff00; @value rgba rgba(34, 12, 64, 0.3); @value hsla hsla(220, 13.0%, 18.0%, 1); @value hsl hsl(264 100% 62% / 70%); \n'
314
+ + '.foo { color: named; background-color: hex3char; border-top-color: hex6char; border-bottom-color: rgba; outline-color: hsla; border-left-color: hsl; }' ,
315
+ '@value named: red; @value hex3char #0f0; @value hex6char #00ff00; @value rgba rgba(34, 12, 64, 0.3); @value hsla hsla(220, 13.0%, 18.0%, 1); @value hsl hsl(264 100% 62% / 70%); \n'
316
+ + '.foo { color: red; background-color: #0f0; border-top-color: #00ff00; border-bottom-color: rgba(34, 12, 64, 0.3); outline-color: hsla(220, 13.0%, 18.0%, 1); border-left-color: hsl(264 100% 62% / 70%); }' ,
307
317
) ;
308
318
} ) ;
309
319
0 commit comments