Skip to content

Commit

Permalink
defensive css : hover mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric07 committed May 11, 2023
1 parent 365fbf0 commit 73daeaa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/scss/02-tools/_m-hover-prevent-touch.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* The hover style will only work when the user is using a tool device like a mouse or a trackpad.
* https://defensivecss.dev/tip/hover-media/
*/
@mixin hover-prevent-touch() {
@media (hover: hover) {
&:hover {
@content;
}
}
}
1 change: 1 addition & 0 deletions src/scss/02-tools/tools.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
@import "./m-editor-only";
@import "./m-heading";
@import "./m-hover";
@import "./m-hover-prevent-touch";
@import "./m-line-clamp";
@import "./m-placeholder-media";
@import "./m-radio-custom";
Expand Down

0 comments on commit 73daeaa

Please sign in to comment.