aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2013-08-14 14:24:06 -0700
committerMark Otto <[email protected]>2013-08-14 14:24:06 -0700
commite5e1270e57b3b726fffbd6aa883eeb1572844e9e (patch)
tree6dbcd8ce0b9fefbcebb574aa6f88829c02cea562
parent49932d60b49805934b54aa22c831aaf78fc22e30 (diff)
parentf7c8612f39ae28f8240d6eb0c23db9a1615fb6c3 (diff)
downloadbootstrap-e5e1270e57b3b726fffbd6aa883eeb1572844e9e.tar.xz
bootstrap-e5e1270e57b3b726fffbd6aa883eeb1572844e9e.zip
Merge branch '3.0.0-wip' of github.com:twbs/bootstrap into 3.0.0-wip
-rw-r--r--less/mixins.less29
-rw-r--r--less/tables.less50
2 files changed, 36 insertions, 43 deletions
diff --git a/less/mixins.less b/less/mixins.less
index 701ed2cc3..eb80823e5 100644
--- a/less/mixins.less
+++ b/less/mixins.less
@@ -360,6 +360,35 @@
}
}
+// Tables
+// -------------------------
+.table-row-variant(@state; @background; @border) {
+ // Exact selectors below required to override `.table-striped` and prevent
+ // inheritance to nested tables.
+ .table > thead > tr,
+ .table > tbody > tr,
+ .table > tfoot > tr {
+ > td.@{state},
+ > th.@{state},
+ &.@{state} > td,
+ &.@{state} > th {
+ background-color: @background;
+ border-color: @border;
+ }
+ }
+
+ // 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 {
+ background-color: darken(@background, 5%);
+ border-color: darken(@border, 5%);
+ }
+ }
+}
+
// Button variants
// -------------------------
// Easily pump out default styles, as well as :hover, :focus, :active,
diff --git a/less/tables.less b/less/tables.less
index b3c921dbb..05c091923 100644
--- a/less/tables.less
+++ b/less/tables.less
@@ -164,48 +164,12 @@ table {
&.active > th {
background-color: @table-bg-active;
}
- > td.success,
- > th.success,
- &.success > td,
- &.success > th {
- background-color: @state-success-bg;
- border-color: @state-success-border;
- }
- > td.danger,
- > th.danger,
- &.danger > td,
- &.danger > th {
- background-color: @state-danger-bg;
- border-color: @state-danger-border;
- }
- > td.warning,
- > th.warning,
- &.warning > td,
- &.warning > th {
- background-color: @state-warning-bg;
- border-color: @state-warning-border;
- }
}
-// Hover states for `.table-hover`
-// Note: this is not available for cells or rows within `thead` or `tfoot`.
-.table-hover > tbody > tr {
- > td.success:hover,
- > th.success:hover,
- &.success:hover > td {
- background-color: darken(@state-success-bg, 5%);
- border-color: darken(@state-success-border, 5%);
- }
- > td.danger:hover,
- > th.danger:hover,
- &.danger:hover > td {
- background-color: darken(@state-danger-bg, 5%);
- border-color: darken(@state-danger-border, 5%);
- }
- > td.warning:hover,
- > th.warning:hover,
- &.warning:hover > td {
- background-color: darken(@state-warning-bg, 5%);
- border-color: darken(@state-warning-border, 5%);
- }
-}
+// Contextual variants
+// -------------------
+.table-row-variant(success; @state-success-bg; @state-success-border);
+
+.table-row-variant(danger; @state-danger-bg; @state-danger-border);
+
+.table-row-variant(warning; @state-warning-bg; @state-warning-border);