From 0f232de9d794b75333899df2b2829d97c48179bc Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Wed, 28 Jun 2017 09:36:27 -0700 Subject: [PATCH] move table variants to use sass map --- docs/4.0/content/tables.md | 70 +++++++------------------------------- scss/_tables.scss | 9 ++--- 2 files changed, 15 insertions(+), 64 deletions(-) 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 -- 2.47.2