Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lets users remove hover styles on touch devices with one variable and modernizr #10968

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion less/badges.less
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

// Hover state, but only for links
a.badge {
&:hover,
@{hover-prefix} &:hover,
&:focus {
color: @badge-link-hover-color;
text-decoration: none;
Expand Down
2 changes: 1 addition & 1 deletion less/button-groups.less
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
position: relative;
float: left;
// Bring the "active" button to the front
&:hover,
@{hover-prefix} &:hover,
&:focus,
&:active,
&.active {
Expand Down
2 changes: 1 addition & 1 deletion less/carousel.less
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
}

// Hover/focus state
&:hover,
@{hover-prefix} &:hover,
&:focus {
color: @carousel-control-color;
text-decoration: none;
Expand Down
2 changes: 1 addition & 1 deletion less/close.less
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
text-shadow: @close-text-shadow;
.opacity(.2);

&:hover,
@{hover-prefix} &:hover,
&:focus {
color: @close-color;
text-decoration: none;
Expand Down
8 changes: 4 additions & 4 deletions less/dropdowns.less
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

// Hover/Focus state
.dropdown-menu > li > a {
&:hover,
@{hover-prefix} &:hover,
&:focus {
text-decoration: none;
color: @dropdown-link-hover-color;
Expand All @@ -84,7 +84,7 @@
// Active state
.dropdown-menu > .active > a {
&,
&:hover,
@{hover-prefix} &:hover,
&:focus {
color: @dropdown-link-active-color;
text-decoration: none;
Expand All @@ -99,14 +99,14 @@

.dropdown-menu > .disabled > a {
&,
&:hover,
@{hover-prefix} &:hover,
&:focus {
color: @dropdown-link-disabled-color;
}
}
// Nuke hover/focus effects
.dropdown-menu > .disabled > a {
&:hover,
@{hover-prefix} &:hover,
&:focus {
text-decoration: none;
background-color: transparent;
Expand Down
2 changes: 1 addition & 1 deletion less/input-groups.less
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
margin-left: -4px;
}
// Bring the "active" button to the front
&:hover,
@{hover-prefix} &:hover,
&:active {
z-index: 2;
}
Expand Down
2 changes: 1 addition & 1 deletion less/labels.less
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

// Add hover effects, but only for links
&[href] {
&:hover,
@{hover-prefix} &:hover,
&:focus {
color: @label-link-hover-color;
text-decoration: none;
Expand Down
4 changes: 2 additions & 2 deletions less/list-group.less
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
}

// Hover state
&:hover,
@{hover-prefix} &:hover,
&:focus {
text-decoration: none;
background-color: @list-group-hover-bg;
Expand All @@ -58,7 +58,7 @@

// Active class on item itself, not parent
&.active,
&.active:hover,
@{hover-prefix} &.active:hover,
&.active:focus {
z-index: 2; // Place active items above their siblings for proper border styling
color: @list-group-active-color;
Expand Down
14 changes: 7 additions & 7 deletions less/mixins.less
Original file line number Diff line number Diff line change
Expand Up @@ -438,10 +438,10 @@
// Hover states for `.table-hover`
// Note: this is not available for cells or rows within `thead` or `tfoot`.
.table-hover > tbody > tr {
> td.@{state}:hover,
> th.@{state}:hover,
&.@{state}:hover > td,
&.@{state}:hover > th {
@{hover-prefix} > td.@{state}:hover,
@{hover-prefix} > th.@{state}:hover,
@{hover-prefix} &.@{state}:hover > td,
@{hover-prefix} &.@{state}:hover > th {
background-color: darken(@background, 5%);
border-color: darken(@border, 5%);
}
Expand All @@ -457,7 +457,7 @@
background-color: @background;
border-color: @border;

&:hover,
@{hover-prefix} &:hover,
&:focus,
&:active,
&.active,
Expand All @@ -475,7 +475,7 @@
&[disabled],
fieldset[disabled] & {
&,
&:hover,
@{hover-prefix} &:hover,
&:focus,
&:active,
&.active {
Expand Down Expand Up @@ -523,7 +523,7 @@
.label-variant(@color) {
background-color: @color;
&[href] {
&:hover,
@{hover-prefix} &:hover,
&:focus {
background-color: darken(@color, 10%);
}
Expand Down
48 changes: 24 additions & 24 deletions less/navbar.less
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
padding: @navbar-padding-vertical @navbar-padding-horizontal;
font-size: @font-size-large;
line-height: @line-height-computed;
&:hover,
@{hover-prefix} &:hover,
&:focus {
text-decoration: none;
}
Expand Down Expand Up @@ -227,7 +227,7 @@
}
> li > a {
line-height: @line-height-computed;
&:hover,
@{hover-prefix} &:hover,
&:focus {
background-image: none;
}
Expand Down Expand Up @@ -356,7 +356,7 @@

.navbar-brand {
color: @navbar-default-brand-color;
&:hover,
@{hover-prefix} &:hover,
&:focus {
color: @navbar-default-brand-hover-color;
background-color: @navbar-default-brand-hover-bg;
Expand All @@ -371,23 +371,23 @@
> li > a {
color: @navbar-default-link-color;

&:hover,
@{hover-prefix} &:hover,
&:focus {
color: @navbar-default-link-hover-color;
background-color: @navbar-default-link-hover-bg;
}
}
> .active > a {
&,
&:hover,
@{hover-prefix} &:hover,
&:focus {
color: @navbar-default-link-active-color;
background-color: @navbar-default-link-active-bg;
}
}
> .disabled > a {
&,
&:hover,
@{hover-prefix} &:hover,
&:focus {
color: @navbar-default-link-disabled-color;
background-color: @navbar-default-link-disabled-bg;
Expand All @@ -397,7 +397,7 @@

.navbar-toggle {
border-color: @navbar-default-toggle-border-color;
&:hover,
@{hover-prefix} &:hover,
&:focus {
background-color: @navbar-default-toggle-hover-bg;
}
Expand All @@ -414,7 +414,7 @@
// Dropdown menu items and carets
.navbar-nav {
// Caret should match text color on hover
> .dropdown > a:hover .caret,
@{hover-prefix} > .dropdown > a:hover .caret,
> .dropdown > a:focus .caret {
border-top-color: @navbar-default-link-hover-color;
border-bottom-color: @navbar-default-link-hover-color;
Expand All @@ -423,7 +423,7 @@
// Remove background color from open dropdown
> .open > a {
&,
&:hover,
@{hover-prefix} &:hover,
&:focus {
background-color: @navbar-default-link-active-bg;
color: @navbar-default-link-active-color;
Expand All @@ -444,23 +444,23 @@
.open .dropdown-menu {
> li > a {
color: @navbar-default-link-color;
&:hover,
@{hover-prefix} &:hover,
&:focus {
color: @navbar-default-link-hover-color;
background-color: @navbar-default-link-hover-bg;
}
}
> .active > a {
&,
&:hover,
@{hover-prefix} &:hover,
&:focus {
color: @navbar-default-link-active-color;
background-color: @navbar-default-link-active-bg;
}
}
> .disabled > a {
&,
&:hover,
@{hover-prefix} &:hover,
&:focus {
color: @navbar-default-link-disabled-color;
background-color: @navbar-default-link-disabled-bg;
Expand All @@ -477,7 +477,7 @@

.navbar-link {
color: @navbar-default-link-color;
&:hover {
@{hover-prefix} &:hover {
color: @navbar-default-link-hover-color;
}
}
Expand All @@ -492,7 +492,7 @@

.navbar-brand {
color: @navbar-inverse-brand-color;
&:hover,
@{hover-prefix} &:hover,
&:focus {
color: @navbar-inverse-brand-hover-color;
background-color: @navbar-inverse-brand-hover-bg;
Expand All @@ -507,23 +507,23 @@
> li > a {
color: @navbar-inverse-link-color;

&:hover,
@{hover-prefix} &:hover,
&:focus {
color: @navbar-inverse-link-hover-color;
background-color: @navbar-inverse-link-hover-bg;
}
}
> .active > a {
&,
&:hover,
@{hover-prefix} &:hover,
&:focus {
color: @navbar-inverse-link-active-color;
background-color: @navbar-inverse-link-active-bg;
}
}
> .disabled > a {
&,
&:hover,
@{hover-prefix} &:hover,
&:focus {
color: @navbar-inverse-link-disabled-color;
background-color: @navbar-inverse-link-disabled-bg;
Expand All @@ -534,7 +534,7 @@
// Darken the responsive nav toggle
.navbar-toggle {
border-color: @navbar-inverse-toggle-border-color;
&:hover,
@{hover-prefix} &:hover,
&:focus {
background-color: @navbar-inverse-toggle-hover-bg;
}
Expand All @@ -552,7 +552,7 @@
.navbar-nav {
> .open > a {
&,
&:hover,
@{hover-prefix} &:hover,
&:focus {
background-color: @navbar-inverse-link-active-bg;
color: @navbar-inverse-link-active-color;
Expand All @@ -568,7 +568,7 @@
}
> .open > a {
&,
&:hover,
@{hover-prefix} &:hover,
&:focus {
.caret {
border-top-color: @navbar-inverse-link-active-color;
Expand All @@ -585,23 +585,23 @@
}
> li > a {
color: @navbar-inverse-link-color;
&:hover,
@{hover-prefix} &:hover,
&:focus {
color: @navbar-inverse-link-hover-color;
background-color: @navbar-inverse-link-hover-bg;
}
}
> .active > a {
&,
&:hover,
@{hover-prefix} &:hover,
&:focus {
color: @navbar-inverse-link-active-color;
background-color: @navbar-inverse-link-active-bg;
}
}
> .disabled > a {
&,
&:hover,
@{hover-prefix} &:hover,
&:focus {
color: @navbar-inverse-link-disabled-color;
background-color: @navbar-inverse-link-disabled-bg;
Expand All @@ -613,7 +613,7 @@

.navbar-link {
color: @navbar-inverse-link-color;
&:hover {
@{hover-prefix} &:hover {
color: @navbar-inverse-link-hover-color;
}
}
Expand Down
Loading