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; ...@@ -50,6 +50,8 @@ $enable-transitions: true !default;
$spacer: 1rem !default; $spacer: 1rem !default;
$border-width: .075rem !default; $border-width: .075rem !default;
$use-hover-media-query: false !default;
//== Typography //== Typography
// //
//## Font, line-height, and color for body text, headings, and more. //## Font, line-height, and color for body text, headings, and more.
......
@mixin hover { @mixin hover {
@if $use-hover-media-query {
// See Media Queries Level 4: http://drafts.csswg.org/mediaqueries/#hover // See Media Queries Level 4: http://drafts.csswg.org/mediaqueries/#hover
// Currently shimmed by https://github.com/cvrebert/mq4-hover-hover-shim // Currently shimmed by https://github.com/cvrebert/mq4-hover-hover-shim
@media (hover: hover) { @media (hover: hover) {
&:hover { @content } &:hover { @content }
} }
}
@else {
&:hover { @content }
}
} }
@mixin hover-focus { @mixin hover-focus {
@if $use-hover-media-query {
&:focus { @content } &:focus { @content }
@include hover { @content } @include hover { @content }
}
@else {
&:focus,
&:hover {
@content
}
}
} }
@mixin plain-hover-focus { @mixin plain-hover-focus {
@if $use-hover-media-query {
&, &,
&:focus { &:focus {
@content @content
} }
@include hover { @content } @include hover { @content }
}
@else {
&,
&:focus,
&:hover {
@content
}
}
} }
@mixin hover-focus-active { @mixin hover-focus-active {
@if $use-hover-media-query {
&:focus, &:focus,
&:active { &:active {
@content @content
} }
@include hover { @content } @include hover { @content }
}
@else {
&:focus,
&:active,
&: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