Commit fd13e33a authored by Chris Rebert's avatar Chris Rebert

add $use-hover-media-query to control @media (hover:hover) usage

parent eaaaa005
......@@ -50,6 +50,8 @@ $enable-transitions: true !default;
$spacer: 1rem !default;
$border-width: .075rem !default;
$use-hover-media-query: false !default;
//== Typography
//
//## Font, line-height, and color for body text, headings, and more.
......
@mixin hover {
// See Media Queries Level 4: http://drafts.csswg.org/mediaqueries/#hover
// Currently shimmed by https://github.com/cvrebert/mq4-hover-hover-shim
@media (hover: hover) {
@if $use-hover-media-query {
// See Media Queries Level 4: http://drafts.csswg.org/mediaqueries/#hover
// Currently shimmed by https://github.com/cvrebert/mq4-hover-hover-shim
@media (hover: hover) {
&:hover { @content }
}
}
@else {
&:hover { @content }
}
}
@mixin hover-focus {
&:focus { @content }
@include hover { @content }
@if $use-hover-media-query {
&:focus { @content }
@include hover { @content }
}
@else {
&:focus,
&:hover {
@content
}
}
}
@mixin plain-hover-focus {
&,
&:focus {
@content
@if $use-hover-media-query {
&,
&:focus {
@content
}
@include hover { @content }
}
@else {
&,
&:focus,
&:hover {
@content
}
}
@include hover { @content }
}
@mixin hover-focus-active {
&:focus,
&:active {
@content
@if $use-hover-media-query {
&:focus,
&:active {
@content
}
@include hover { @content }
}
@else {
&:focus,
&:active,
&:hover {
@content
}
}
@include hover { @content }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment