File tree Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,19 @@ const hoverMixin = {
54
54
} ,
55
55
} ;
56
56
57
+ const hoverWhereMixin = {
58
+ '@media (hover: hover)' : {
59
+ '&:where(:hover)' : {
60
+ '@mixin-content' : { } ,
61
+ } ,
62
+ } ,
63
+ '@media (hover: none)' : {
64
+ '&:where(:active)' : {
65
+ '@mixin-content' : { } ,
66
+ } ,
67
+ } ,
68
+ } ;
69
+
57
70
const rtlMixin = {
58
71
'[dir="rtl"] &' : {
59
72
'@mixin-content' : { } ,
@@ -134,6 +147,7 @@ module.exports = () => {
134
147
'where-light-root' : rootColorSchemeMixin ( 'light' , 'where' ) ,
135
148
'where-dark-root' : rootColorSchemeMixin ( 'dark' , 'where' ) ,
136
149
hover : hoverMixin ,
150
+ 'where-hover' : hoverWhereMixin ,
137
151
rtl : rtlMixin ,
138
152
ltr : ltrMixin ,
139
153
'not-rtl' : notRtlMixin ,
Original file line number Diff line number Diff line change @@ -14,3 +14,18 @@ exports[`mixin-hover transforms hover mixin correctly 1`] = `
14
14
}
15
15
"
16
16
` ;
17
+
18
+ exports [` mixin-hover transforms where-hover mixin correctly 1` ] = `
19
+ "
20
+ @media (hover: hover) {
21
+ .demo :where (:hover ) {
22
+ color: orange
23
+ }
24
+ }
25
+ @media (hover: none) {
26
+ .demo :where (:active ) {
27
+ color: orange
28
+ }
29
+ }
30
+ "
31
+ ` ;
Original file line number Diff line number Diff line change @@ -8,9 +8,22 @@ const baseInput = `
8
8
}
9
9
` ;
10
10
11
+ const whereInput = `
12
+ .demo {
13
+ @mixin where-hover {
14
+ color: orange;
15
+ }
16
+ }
17
+ ` ;
18
+
11
19
describe ( 'mixin-hover' , ( ) => {
12
20
it ( 'transforms hover mixin correctly' , async ( ) => {
13
21
const res = await testTransform ( baseInput ) ;
14
22
expect ( res . css ) . toMatchSnapshot ( ) ;
15
23
} ) ;
24
+
25
+ it ( 'transforms where-hover mixin correctly' , async ( ) => {
26
+ const res = await testTransform ( whereInput ) ;
27
+ expect ( res . css ) . toMatchSnapshot ( ) ;
28
+ } ) ;
16
29
} ) ;
You can’t perform that action at this time.
0 commit comments