Skip to content

Commit 31c72cd

Browse files
authored
Merge pull request #344 from BeAPI/feature/defensive/hover
defensive css : hover mobile
2 parents 9fd53e0 + 73daeaa commit 31c72cd

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* The hover style will only work when the user is using a tool device like a mouse or a trackpad.
3+
* https://defensivecss.dev/tip/hover-media/
4+
*/
5+
@mixin hover-prevent-touch() {
6+
@media (hover: hover) {
7+
&:hover {
8+
@content;
9+
}
10+
}
11+
}

src/scss/02-tools/tools.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
@import "./m-editor-only";
2525
@import "./m-heading";
2626
@import "./m-hover";
27+
@import "./m-hover-prevent-touch";
2728
@import "./m-line-clamp";
2829
@import "./m-placeholder-media";
2930
@import "./m-radio-custom";

0 commit comments

Comments
 (0)