Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dark mode #2223

Merged
merged 71 commits into from
Jan 2, 2024
Merged
Changes from 1 commit
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
34273ef
feat: dark mode
julien-deramond Sep 11, 2023
a6c063d
Dark mode: Navs Tabs (#2307)
hannahiss Oct 25, 2023
877fa75
Dark mode: modal (#2322)
louismaximepiton Oct 25, 2023
ca92d34
Dark mode: Switches (#2285)
louismaximepiton Oct 25, 2023
ee08290
Dark mode: Form select (#2286)
louismaximepiton Oct 25, 2023
942a3cd
Dark mode: Quantity selector (#2287)
louismaximepiton Oct 25, 2023
c6e3027
Dark mode: tarteaucitron (#2339)
louismaximepiton Oct 25, 2023
142b9e5
Dark mode: Close button (#2317)
louismaximepiton Oct 26, 2023
63c7c05
Dark mode: Form Validation (#2302)
louismaximepiton Oct 27, 2023
446511b
Dark mode: Back to top (#2329)
louismaximepiton Oct 27, 2023
3f03490
Dark mode: Popovers (#2325)
louismaximepiton Oct 27, 2023
79e5ef9
Dark mode: pagination (#2314)
louismaximepiton Oct 27, 2023
55b3357
Dark mode: Carousel (#2316)
louismaximepiton Oct 27, 2023
98b005e
Dark mode: Cards (#2318)
louismaximepiton Oct 27, 2023
58764c9
Dark mode: Algolia search modal (#2338)
louismaximepiton Oct 30, 2023
ba01403
Fix bundlewatch values
julien-deramond Oct 30, 2023
9aee957
Dark mode: Offcanvas (#2348)
louismaximepiton Oct 31, 2023
ee02130
Dark mode: Progress bars (#2326)
louismaximepiton Oct 31, 2023
55ce206
Move Progress to the right place
julien-deramond Oct 31, 2023
d4a9de3
Dark mode: Tooltips (#2352)
louismaximepiton Nov 3, 2023
a7dfe63
Dark mode: List group (#2321)
louismaximepiton Nov 3, 2023
71bb1eb
Fix QS after merge main
julien-deramond Nov 3, 2023
0de3e28
Fix bundlewatch values
julien-deramond Nov 3, 2023
ebb9b94
Dark mode: Navbar & Orange navbar (#2345)
louismaximepiton Nov 6, 2023
9da3743
Dark mode: Tables (#2349)
louismaximepiton Nov 6, 2023
a6b94d7
Dark mode: basic elements (#2355)
louismaximepiton Nov 7, 2023
54e034b
Dark mode: Footer (#2356)
louismaximepiton Nov 7, 2023
d0a8676
Dark mode: Title bars (#2350)
louismaximepiton Nov 8, 2023
b1e6e11
Dark mode: Dropdown variant (#2323)
louismaximepiton Nov 13, 2023
365975f
Dark mode: Utilities (bg, border, color) (#2362)
louismaximepiton Nov 13, 2023
4cfde88
Dark mode: Masonry example (#2369)
louismaximepiton Nov 13, 2023
db178f5
Dark mode: Grid example (#2368)
louismaximepiton Nov 13, 2023
c78e99e
Dark mode: change colors of doc callouts to be more emphasized (#2375)
louismaximepiton Nov 15, 2023
0f5f47a
Drop extra space in utilities colors doc
julien-deramond Nov 15, 2023
e6cf3f1
Tweak a bit the color mode switcher (#2381)
louismaximepiton Nov 15, 2023
884fb6f
Dark mode: Remove useless CSS since dropdown have been changed (#2377)
louismaximepiton Nov 15, 2023
ef3c320
Dark mode: Handle dark mode code highlights (#2378)
louismaximepiton Nov 15, 2023
d98388b
Dark mode: Download app example (#2367)
louismaximepiton Nov 16, 2023
9936e4d
Dark mode: handle orange in the doc (#2371)
louismaximepiton Nov 16, 2023
1b38248
Dark mode: Change functionnal colors in dark mode (#2370)
louismaximepiton Nov 16, 2023
11f23a1
Dark mode: fix toggle-buttons (#2365)
louismaximepiton Nov 20, 2023
a810e8f
Fix thumbnail hover design guidelines orange color
julien-deramond Nov 27, 2023
2b579ce
Dark mode: add badge in /dark-mode page (#2387)
julien-deramond Nov 28, 2023
c63d35a
Dark Mode: add placeholders to /dark-mode page (#2391)
louismaximepiton Nov 29, 2023
7101481
Dark mode: move placeholders in /dark-mode
julien-deramond Nov 29, 2023
06fba00
Dark mode: Auto color and bg-color with data-bs-theme (#2313)
julien-deramond Nov 29, 2023
36e391e
Fix bundlewatch values
julien-deramond Dec 13, 2023
0df0b4c
Dark mode: Color handling in the colors (#2382)
louismaximepiton Dec 13, 2023
925e7f8
Drop variables from dark-mode page
julien-deramond Dec 13, 2023
d6a98fb
Dark mode: fix black card in masonry example (#2408)
julien-deramond Dec 13, 2023
4983159
Dark mode: Spinner in buttons (#2410)
louismaximepiton Dec 13, 2023
43b5891
Dark mode: enhance Color Modes v5.3.0 explanation in migration guide …
julien-deramond Dec 14, 2023
85aebae
Dark mode: pagination hover color (#2405)
louismaximepiton Dec 14, 2023
8ebfc2c
Dark mode: Add some Sass variables to handle newly added CSS vars (#2…
louismaximepiton Dec 14, 2023
0946bfd
Dark mode: Fix `<select>` focus (#2404)
louismaximepiton Dec 15, 2023
24aa0e7
Dark mode: Handle properly dark variants (#2419)
louismaximepiton Dec 18, 2023
024bd98
Dark mode: Deprecate variables and CSS classes (#2424)
louismaximepiton Dec 18, 2023
264129e
Dark mode: Fix dropdown design (#2417)
louismaximepiton Dec 19, 2023
cca55d3
Dark mode: Local nav and nav underline fix (#2406)
louismaximepiton Dec 19, 2023
8f11402
Dark mode: Table fix (#2418)
louismaximepiton Dec 19, 2023
72648f0
Dark mode: Toasts (#2380)
louismaximepiton Dec 19, 2023
7a9903a
Dark mode: Navbar Color Schemes (#2412)
julien-deramond Dec 19, 2023
1cb8fe8
Dark mode: revert some changes linked to `main` temporary `.text-*` u…
julien-deramond Dec 20, 2023
8aee7c1
Dark mode: fix list group documentation (#2435)
julien-deramond Dec 21, 2023
3ef9030
Dark mode: Docs about background utility (#2411)
louismaximepiton Dec 21, 2023
5092296
Dark mode: Theme switcher control (#2425)
louismaximepiton Dec 27, 2023
3e296d0
Dark mode: drop bottom-right theme selector for Download page and For…
julien-deramond Dec 27, 2023
aca124d
Dark mode: add new navbar mode selector example (#2436)
julien-deramond Dec 27, 2023
8238943
Dark mode: rework Color Modes pages (#2442)
julien-deramond Dec 27, 2023
8d31874
Dark mode: add a warning callout to Orange's colors section (#2444)
julien-deramond Dec 27, 2023
6f8e992
Dark mode: migration guide (#2433)
julien-deramond Jan 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Dark mode: Docs about background utility (#2411)
Co-authored-by: Julien Déramond <julien.deramond@orange.com>
louismaximepiton and julien-deramond committed Jan 2, 2024

Verified

This commit was signed with the committer’s verified signature.
julien-deramond Julien Déramond
commit 3ef9030e6519889efb4c748f7b1c9f7aa3bd9627
74 changes: 37 additions & 37 deletions site/content/docs/5.3/utilities/background.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: docs
title: Background
description: Convey meaning through `background-color` and add decoration with gradients.
description: Convey meaning through `background-color`.
group: utilities
aliases:
- "/docs/utilities/background/"
@@ -14,57 +14,57 @@ toc: true

## Background color

Similar to the contextual text color classes, set the background of an element to any contextual class. Background utilities **do set `color`** to ensure contrasts.
Background utilities like `.bg-*` are generated from our original `$theme-colors` Sass map and respond to color modes.

{{< callout info >}}
Background utilities like `.bg-*` that generated from our original `$theme-colors` Sass map don't yet respond to color modes, however, any `.bg-*-subtle` utility will. This will be resolved in v6.
{{< /callout >}}
Similar to the contextual text color classes, set the background of an element to any contextual class. Background utilities **do not set `color`**, so depending on the cases you'll want to use:
* `.text-*` [color utilities]({{< docsref "/utilities/colors" >}}) when the background color remains the same in light and dark mode
* `.text-bg-*` [color & background helper]({{< docsref "/helpers/color-background" >}}) from our [theme colors]({{< docsref "/customize/color-theme#theming" >}})
* `[data-bs-theme]` [color mode attribute]({{< docsref "/customize/color-modes#example" >}}) when the element using a background utility contains complex sub-elements such as components that need to respond to color modes

{{< callout info >}}
In case you need to write over one of these background, prefer using our [color & background helper]({{< docsref "/helpers/color-background" >}}) when it exists.
{{< /callout >}}
{{< example >}}
{{< colors.inline >}}
{{- range (index $.Site.Data "theme-colors") }}
<div class="p-3 mb-2 fw-bold bg-{{ .name }}"><span class="text-bg-{{ .name }}">.bg-{{ .name }}</span></div>
{{- end -}}
{{< /colors.inline >}}
<div class="p-3 mb-2 fw-bold bg-body-secondary">.bg-body-secondary</div>
<div class="p-3 mb-2 fw-bold bg-body">.bg-body</div>
<div class="p-3 mb-2 fw-bold bg-black text-white">.bg-black</div>
<div class="p-3 mb-2 fw-bold bg-white text-black">.bg-white</div>
<div class="p-3 mb-2 fw-bold bg-transparent">.bg-transparent</div>
{{< /example >}}

Supporting background utilities are generated from our [supporting colors]({{< docsref "/customize/color-theme#supporting" >}}). Please note that their color value stays the same between light and dark mode.

<!-- Boosted mod: inconsistent background color & naming, showing only supporting color naming -->
{{< example >}}
<div class="p-3 mb-2 fw-bold bg-primary"><span class="text-bg-primary">.bg-primary</span></div>
<div class="p-3 mb-2 fw-bold bg-secondary"><span class="text-bg-secondary">.bg-secondary</span></div>
<div class="p-3 mb-2 fw-bold bg-success"><span class="text-bg-success">.bg-success</span></div>
<div class="p-3 mb-2 fw-bold bg-danger"><span class="text-bg-danger">.bg-danger</span></div>
<div class="p-3 mb-2 fw-bold bg-warning"><span class="text-bg-warning">.bg-warning</span></div>
<div class="p-3 mb-2 fw-bold bg-info"><span class="text-bg-info">.bg-info</span></div>
<div class="p-3 mb-2 fw-bold bg-supporting-green text-black">.bg-supporting-green</div>
<div class="p-3 mb-2 fw-bold bg-supporting-purple text-black">.bg-supporting-purple</div>
<div class="p-3 mb-2 fw-bold bg-supporting-yellow text-black">.bg-supporting-yellow</div>
<div class="p-3 mb-2 fw-bold bg-supporting-blue text-black">.bg-supporting-blue</div>
<div class="p-3 mb-2 fw-bold bg-supporting-pink text-black">.bg-supporting-pink</div>
<div class="p-3 mb-2 fw-bold bg-supporting-orange text-black">.bg-supporting-orange</div>
<div class="p-3 mb-2 fw-bold bg-light"><span class="text-bg-light">.bg-light</span></div>
<div class="p-3 mb-2 fw-bold bg-dark"><span class="text-bg-dark">.bg-dark</span></div>
<div class="p-3 mb-2 fw-bold bg-body-secondary">.bg-body-secondary</div>
<div class="p-3 mb-2 fw-bold bg-body-tertiary">.bg-body-tertiary</div>
<div class="p-3 mb-2 fw-bold bg-body">.bg-body</div>
<div class="p-3 mb-2 fw-bold bg-black text-white">.bg-black</div>
<div class="p-3 mb-2 fw-bold bg-white text-black">.bg-white</div>
<div class="p-3 mb-2 fw-bold bg-transparent">.bg-transparent</div>
{{< /example >}}

{{< callout info >}}
For each `.background-*` there is a matching `.background-*-subtle` utility. In Boosted, they have exactly the same value so we decided not to display them in the example above so that you don't hesitate on which class to use.
<details>
<summary>See list of Bootstrap-specific background color utilities</summary>
<br>

Here is a list of these extra classes:
{{< background-subtle.inline >}}
{{- range (index $.Site.Data "theme-colors") }}
- `.bg-{{ .name }}-subtle`
{{- end -}}
{{< /background-subtle.inline >}}
{{< /callout >}}
Another background utility is `.bg-body-tertiary` but doesn't have any matching color in our [grays colors]({{< docsref "/customize/color-theme#grays" >}}) so shouldn't be used for now.

{{< callout >}}
### Color naming
{{< example >}}
<p class="p-3 mb-2 fw-bold bg-body-tertiary">.bg-body-tertiary</p>
{{< /example >}}

Since [Orange brand distinguishes functional colors from supporting colors]({{< docsref "/customize/color-theme#theming" >}}) and Bootstrap doesn't, naming can be somewhat inconsistent.
Bootstrap's `background-color` utilities are supported in Boosted, but will result in our core `.bg-supporting-*` utilities—making `.bg-danger` inconsistent with `.btn-danger` color, for example.
{{< /callout >}}
In Bootstrap, for each `.bg-*` there is a matching `.bg-*-subtle` utility responding to color modes. In Boosted, subtle colors don't exist so these background utilities have exactly the same value and shouldn't be used. Prefer the regular `.bg-*` utilities instead.

{{< example >}}
{{< colors.inline >}}
{{- range (index $.Site.Data "theme-colors") }}
<div class="p-3 mb-2 fw-bold bg-{{ .name }}-subtle"><span class="text-bg-{{ .name }}">.bg-{{ .name }}-subtle</span></div>
{{- end -}}
{{< /colors.inline >}}
{{< /example >}}
</details>

<!-- Boosted mod: no background gradient -->