Skip to content
Browse files

Merge pull request #12969 from ZDroid/badge-mixin

Improve badges mixinability
  • Loading branch information...
2 parents d223623 + 0f3b176 commit 538b3ca06f068237e05ac66fce7f4d60d2b5a98f @mdo mdo committed Mar 7, 2014
Showing with 19 additions and 19 deletions.
  1. +18 −18 less/badges.less
  2. +1 −1 less/labels.less
View
36 less/badges.less
@@ -3,7 +3,7 @@
// --------------------------------------------------
-// Base classes
+// Base class
.badge {
display: inline-block;
min-width: 10px;
@@ -32,24 +32,24 @@
top: 0;
padding: 1px 5px;
}
-}
-// Hover state, but only for links
-a.badge {
- &:hover,
- &:focus {
- color: @badge-link-hover-color;
- text-decoration: none;
- cursor: pointer;
+ // Hover state, but only for links
+ a& {
+ &:hover,
+ &:focus {
+ color: @badge-link-hover-color;
+ text-decoration: none;
+ cursor: pointer;
+ }
}
-}
-// Account for counters in navs
-a.list-group-item.active > .badge,
-.nav-pills > .active > a > .badge {
- color: @badge-active-color;
- background-color: @badge-active-bg;
-}
-.nav-pills > li > a > .badge {
- margin-left: 3px;
+ // Account for badges in navs
+ a.list-group-item.active > &,
+ .nav-pills > .active > a > & {
+ color: @badge-active-color;
+ background-color: @badge-active-bg;
+ }
+ .nav-pills > li > a > & {
+ margin-left: 3px;
+ }
}
View
2 less/labels.less
@@ -15,7 +15,7 @@
border-radius: .25em;
// Add hover effects, but only for links
- &[href] {
+ a& {
&:hover,
&:focus {
color: @label-link-hover-color;

0 comments on commit 538b3ca

Please sign in to comment.
Something went wrong with that request. Please try again.