Skip to content

Commit

Permalink
Merge pull request twbs#12248 from twbs/bg-variant
Browse files Browse the repository at this point in the history
refactoring: add & use .bg-variant() mixin
  • Loading branch information
mdo committed Jan 18, 2014
2 parents 10a158f + 2115ac5 commit 032869a
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 32 deletions.
2 changes: 1 addition & 1 deletion dist/css/bootstrap-theme.css.map

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions dist/css/bootstrap.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/css/bootstrap.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/bootstrap.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/dist/css/bootstrap-theme.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/dist/css/bootstrap.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/dist/css/bootstrap.min.css

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion less/mixins.less
Original file line number Diff line number Diff line change
Expand Up @@ -577,11 +577,20 @@
}
}

// Contextual backgrounds
// -------------------------
.bg-variant(@color) {
background-color: @color;
a&:hover {
background-color: darken(@color, 10%);
}
}

// Typography
// -------------------------
.text-emphasis-variant(@color) {
color: @color;
&:hover {
a&:hover {
color: darken(@color, 10%);
}
}
Expand Down
25 changes: 5 additions & 20 deletions less/type.less
Original file line number Diff line number Diff line change
Expand Up @@ -114,34 +114,19 @@ cite { font-style: normal; }
// Given the contrast here, this is the only class to have its color inverted
// automatically.
color: #fff;
background-color: @brand-primary;
a&:hover {
background-color: darken(@brand-primary, 10%);
}
.bg-variant(@brand-primary);
}
.bg-success {
background-color: @state-success-bg;
a&:hover {
background-color: darken(@state-success-bg, 10%);
}
.bg-variant(@state-success-bg);
}
.bg-info {
background-color: @state-info-bg;
a&:hover {
background-color: darken(@state-info-bg, 10%);
}
.bg-variant(@state-info-bg);
}
.bg-warning {
background-color: @state-warning-bg;
a&:hover {
background-color: darken(@state-warning-bg, 10%);
}
.bg-variant(@state-warning-bg);
}
.bg-danger {
background-color: @state-danger-bg;
a&:hover {
background-color: darken(@state-danger-bg, 10%);
}
.bg-variant(@state-danger-bg);
}


Expand Down

0 comments on commit 032869a

Please sign in to comment.