From 8a400acede7a6de50cf3e9493e6ecc192d99dd84 Mon Sep 17 00:00:00 2001 From: "louismaxime.piton" Date: Fri, 15 Dec 2023 10:57:29 +0100 Subject: [PATCH] Better the doc + add some variants --- scss/_variables.scss | 11 +++- site/content/docs/5.3/content/tables.md | 74 ++++++++++++++++++++----- 2 files changed, 68 insertions(+), 17 deletions(-) diff --git a/scss/_variables.scss b/scss/_variables.scss index bcc44af1b7..2021430d59 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -917,12 +917,19 @@ $table-group-separator-color: currentcolor !default; $table-caption-color: var(--#{$prefix}caption-color, var(--#{$prefix}emphasis-color)) !default; // Boosted mod: instead of `var(--#{$prefix}secondary-color)` $table-caption-padding-y: .75rem !default; // Boosted mod -// Boosted mod: no $table-bg-scale +$table-bg-scale: -60% !default; // scss-docs-end table-variables // scss-docs-start table-loop $table-variants: ( - "dark": $dark + "primary": shift-color($primary, $table-bg-scale), + "secondary": shift-color($secondary, $table-bg-scale), + "success": shift-color($success, $table-bg-scale), + "info": shift-color($info, $table-bg-scale), + "warning": shift-color($warning, $table-bg-scale), + "danger": shift-color($danger, $table-bg-scale), + "light": $light, + "dark": $dark, ) !default; // scss-docs-end table-loop diff --git a/site/content/docs/5.3/content/tables.md b/site/content/docs/5.3/content/tables.md index 6bc770bc16..645162c6dc 100644 --- a/site/content/docs/5.3/content/tables.md +++ b/site/content/docs/5.3/content/tables.md @@ -36,6 +36,15 @@ See [more information about the tables structures](https://a11y-guidelines.orang Use contextual class to color tables, table rows or individual cells. +{{< callout warning >}} +Boosted doesn't provide any branded variant. + +Darker tables are allowed so you may add `data-bs-theme="dark"` to the `.table` or any ancestor element to enable a component-specific color mode. [Learn more about our color modes]({{< docsref "/customize/color-modes" >}}). +{{< /callout >}} + +
+See Bootstrap's variants +
@@ -52,31 +61,45 @@ Use contextual class to color tables, table rows or individual cells. - - - - - + {{< table.inline >}} + {{- range (index $.Site.Data "theme-colors") }} + + + + + + {{- end -}} + {{< /table.inline >}}
Boosted table variants
Cell Cell
DarkCellCell
{{ .name | title }}CellCell
{{< highlight html >}} - -...
+{{< table.inline >}} +{{- range (index $.Site.Data "theme-colors") }} +...
+{{- end -}} +{{< /table.inline >}} - -... +{{< table.inline >}} +{{- range (index $.Site.Data "theme-colors") }} +... +{{- end -}} +{{< /table.inline >}} - - ... +{{< table.inline >}} +{{- range (index $.Site.Data "theme-colors") }} + ... +{{- end -}} +{{< /table.inline >}} {{< /highlight >}} {{< callout info >}} {{< partial "callouts/warning-color-assistive-technologies.md" >}} {{< /callout >}} +
## Accented tables @@ -96,13 +119,19 @@ Use .table-striped-columns to add zebra-striping to any table column. {{< table class="table table-striped-columns" caption="Boosted striped columns table" >}} -These classes can also be added to table variants: +These classes can also be added to table variants. + +
+See Bootstrap's examples +
+{{< table class="table table-dark table-striped" >}} -{{< table class="table table-dark table-striped" caption="Boosted dark striped rows table" >}} +{{< table class="table table-dark table-striped-columns" >}} -{{< table class="table table-dark table-striped-columns" caption="Boosted dark striped columns table" >}} +{{< table class="table table-success table-striped" >}} - +{{< table class="table table-success table-striped-columns" >}} +
### Hoverable rows @@ -110,13 +139,20 @@ Add `.table-hover` to enable a hover state on table rows within a ``. {{< table class="table table-hover" caption="Boosted hoverable table" >}} +
+See on Bootstrap variant {{< table class="table table-dark table-hover" caption="Boosted hoverable dark table" >}} +
These hoverable rows can also be combined with the striped rows variant: {{< table class="table table-striped table-hover" caption="Boosted hoverable striped table" >}} +
+See on Bootstrap variant +
{{< table class="table table-dark table-striped table-hover" caption="Boosted hoverable dark striped table" >}} +
### Active tables @@ -177,6 +213,9 @@ Highlight a table row or cell by adding a `.table-active` class. ``` +
+See on Bootstrap variant +
@@ -231,6 +270,7 @@ Highlight a table row or cell by adding a `.table-active` class.
Boosted dark table with an active row and cell
``` +
## How do the variants and accented tables work? @@ -258,7 +298,11 @@ To display basic tables, Orange Design System recommends using these compact tab {{< table class="table table-sm" caption="Boosted small table" >}} +
+See on Bootstrap variant +
{{< table class="table table-dark table-sm" caption="Boosted dark small table" >}} +
## Table group dividers