mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-20 12:21:35 +02:00
add $use-hover-media-query to control @media (hover:hover) usage
This commit is contained in:
@@ -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.
|
||||||
|
@@ -1,28 +1,59 @@
|
|||||||
@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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user