From: Mark Otto Date: Wed, 28 Jun 2017 16:36:27 +0000 (-0700) Subject: move table variants to use sass map X-Git-Tag: v4.0.0-beta~115^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f232de9d794b75333899df2b2829d97c48179bc;p=thirdparty%2Fbootstrap.git move table variants to use sass map --- diff --git a/docs/4.0/content/tables.md b/docs/4.0/content/tables.md index 8d4fcfe64f..db05e8378c 100644 --- a/docs/4.0/content/tables.md +++ b/docs/4.0/content/tables.md @@ -438,19 +438,11 @@ Add `.table-sm` to make tables more compact by cutting cell padding in half. Use contextual classes to color table rows or individual cells. -| Class | Description | -| --- | --- | -| `.table-active` | Applies the hover color to a particular row or cell | -| `.table-success` | Indicates a successful or positive action | -| `.table-info` | Indicates a neutral informative change or action | -| `.table-warning` | Indicates a warning that might need attention | -| `.table-danger` | Indicates a dangerous or potentially negative action | -
- + @@ -458,59 +450,25 @@ Use contextual classes to color table rows or individual cells. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - + + {% for color in site.data.theme-colors %} + + - + {% endfor %}
#Type Column heading Column heading Column heading
1Column contentColumn contentColumn content
2Column contentColumn contentColumn content
3Column contentColumn contentColumn content
4Column contentColumn contentColumn content
5Column contentColumn contentColumn content
6Column contentColumn contentColumn content
7Active Column content Column content Column content
8Default Column content Column content Column content
9
{{ color.name | capitalize }} Column content Column content Column content
@@ -518,18 +476,14 @@ Use contextual classes to color table rows or individual cells. {% highlight html %} ... -... -... -... -... +{% for color in site.data.theme-colors %} +...{% endfor %} ... - ... - ... - ... - ... + {% for color in site.data.theme-colors %} + ...{% endfor %} {% endhighlight %} diff --git a/scss/_tables.scss b/scss/_tables.scss index 90a5e69bb9..8b1f551a0d 100644 --- a/scss/_tables.scss +++ b/scss/_tables.scss @@ -92,12 +92,9 @@ // Exact selectors below required to override `.table-striped` and prevent // inheritance to nested tables. -// Generate the contextual variants -@include table-row-variant(active, $table-active-bg); -@include table-row-variant(success, $state-success-bg); -@include table-row-variant(info, $state-info-bg); -@include table-row-variant(warning, $state-warning-bg); -@include table-row-variant(danger, $state-danger-bg); +@each $color, $value in $theme-colors { + @include table-row-variant($color, theme-color-level($color, -9)); +} // Inverse styles