File tree 3 files changed +58
-0
lines changed
3 files changed +58
-0
lines changed Original file line number Diff line number Diff line change @@ -3884,6 +3884,8 @@ exports[`getVariants 1`] = `
3884
3884
" required" ,
3885
3885
" valid" ,
3886
3886
" invalid" ,
3887
+ " user-valid" ,
3888
+ " user-invalid" ,
3887
3889
" in-range" ,
3888
3890
" out-of-range" ,
3889
3891
" read-only" ,
@@ -3936,6 +3938,8 @@ exports[`getVariants 1`] = `
3936
3938
" required" ,
3937
3939
" valid" ,
3938
3940
" invalid" ,
3941
+ " user-valid" ,
3942
+ " user-invalid" ,
3939
3943
" in-range" ,
3940
3944
" out-of-range" ,
3941
3945
" read-only" ,
@@ -4162,6 +4166,20 @@ exports[`getVariants 1`] = `
4162
4166
" selectors" : [Function ],
4163
4167
" values" : [],
4164
4168
} ,
4169
+ {
4170
+ " hasDash" : true ,
4171
+ " isArbitrary" : false ,
4172
+ " name" : " user-valid" ,
4173
+ " selectors" : [Function ],
4174
+ " values" : [],
4175
+ } ,
4176
+ {
4177
+ " hasDash" : true ,
4178
+ " isArbitrary" : false ,
4179
+ " name" : " user-invalid" ,
4180
+ " selectors" : [Function ],
4181
+ " values" : [],
4182
+ } ,
4165
4183
{
4166
4184
" hasDash" : true ,
4167
4185
" isArbitrary" : false ,
@@ -4275,6 +4293,8 @@ exports[`getVariants 1`] = `
4275
4293
" required" ,
4276
4294
" valid" ,
4277
4295
" invalid" ,
4296
+ " user-valid" ,
4297
+ " user-invalid" ,
4278
4298
" in-range" ,
4279
4299
" out-of-range" ,
4280
4300
" read-only" ,
Original file line number Diff line number Diff line change @@ -490,6 +490,42 @@ test('invalid', async () => {
490
490
expect ( await run ( [ 'invalid/foo:flex' ] ) ) . toEqual ( '' )
491
491
} )
492
492
493
+ test ( 'user-valid' , async ( ) => {
494
+ expect ( await run ( [ 'user-valid:flex' , 'group-user-valid:flex' , 'peer-user-valid:flex' ] ) )
495
+ . toMatchInlineSnapshot ( `
496
+ ".group-user-valid\\:flex:is(:where(.group):user-valid *) {
497
+ display: flex;
498
+ }
499
+
500
+ .peer-user-valid\\:flex:is(:where(.peer):user-valid ~ *) {
501
+ display: flex;
502
+ }
503
+
504
+ .user-valid\\:flex:user-valid {
505
+ display: flex;
506
+ }"
507
+ ` )
508
+ expect ( await run ( [ 'user-valid/foo:flex' ] ) ) . toEqual ( '' )
509
+ } )
510
+
511
+ test ( 'user-invalid' , async ( ) => {
512
+ expect ( await run ( [ 'user-invalid:flex' , 'group-user-invalid:flex' , 'peer-user-invalid:flex' ] ) )
513
+ . toMatchInlineSnapshot ( `
514
+ ".group-user-invalid\\:flex:is(:where(.group):user-invalid *) {
515
+ display: flex;
516
+ }
517
+
518
+ .peer-user-invalid\\:flex:is(:where(.peer):user-invalid ~ *) {
519
+ display: flex;
520
+ }
521
+
522
+ .user-invalid\\:flex:user-invalid {
523
+ display: flex;
524
+ }"
525
+ ` )
526
+ expect ( await run ( [ 'invalid/foo:flex' ] ) ) . toEqual ( '' )
527
+ } )
528
+
493
529
test ( 'in-range' , async ( ) => {
494
530
expect ( await run ( [ 'in-range:flex' , 'group-in-range:flex' , 'peer-in-range:flex' ] ) )
495
531
. toMatchInlineSnapshot ( `
Original file line number Diff line number Diff line change @@ -438,6 +438,8 @@ export function createVariants(theme: Theme): Variants {
438
438
staticVariant ( 'required' , [ '&:required' ] )
439
439
staticVariant ( 'valid' , [ '&:valid' ] )
440
440
staticVariant ( 'invalid' , [ '&:invalid' ] )
441
+ staticVariant ( 'user-valid' , [ '&:user-valid' ] )
442
+ staticVariant ( 'user-invalid' , [ '&:user-invalid' ] )
441
443
staticVariant ( 'in-range' , [ '&:in-range' ] )
442
444
staticVariant ( 'out-of-range' , [ '&:out-of-range' ] )
443
445
staticVariant ( 'read-only' , [ '&:read-only' ] )
You can’t perform that action at this time.
0 commit comments