Skip to content

Commit

Permalink
Docs: display examples based on the docs current color mode (#37562)
Browse files Browse the repository at this point in the history
* Docs: display examples based on the docs current color mode

* Fix _default/examples.html
  • Loading branch information
julien-deramond authored Dec 29, 2022
1 parent baf5d4c commit 8befabb
Show file tree
Hide file tree
Showing 27 changed files with 54 additions and 51 deletions.
2 changes: 1 addition & 1 deletion site/content/docs/5.3/examples/album-rtl/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ <h1 class="fw-light">مثال الألبوم</h1>
</div>
</section>

<div class="album py-5 bg-light">
<div class="album py-5 bg-body-tertiary">
<div class="container">

<div class="row row-cols-1 row-cols-sm-2 row-cols-md-3 g-3">
Expand Down
2 changes: 1 addition & 1 deletion site/content/docs/5.3/examples/album/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ <h1 class="fw-light">Album example</h1>
</div>
</section>

<div class="album py-5 bg-light">
<div class="album py-5 bg-body-tertiary">
<div class="container">

<div class="row row-cols-1 row-cols-sm-2 row-cols-md-3 g-3">
Expand Down
2 changes: 1 addition & 1 deletion site/content/docs/5.3/examples/blog-rtl/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ <h2 class="blog-post-title mb-1">ميزة جديدة</h2>

<div class="col-md-4">
<div class="position-sticky" style="top: 2rem;">
<div class="p-4 mb-3 bg-light rounded">
<div class="p-4 mb-3 bg-body-tertiary rounded">
<h4 class="fst-italic">حول</h4>
<p class="mb-0">أقبلت، فأقبلت معك الحياة بجميع صنوفها وألوانها: فالنبات ينبت، والأشجار تورق وتزهر، والهرة تموء، والقمري يسجع، والغنم يثغو، والبقر يخور، وكل أليف يدعو أليفه. كل شيء يشعر بالحياة وينسي هموم الحياة، ولا يذكر إلا سعادة الحياة، فإن كان الزمان جسدا فأنت روحه، وإن كان عمرا فأنت شبابه.</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion site/content/docs/5.3/examples/blog/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ <h2 class="blog-post-title mb-1">New feature</h2>

<div class="col-md-4">
<div class="position-sticky" style="top: 2rem;">
<div class="p-4 mb-3 bg-light rounded">
<div class="p-4 mb-3 bg-body-tertiary rounded">
<h4 class="fst-italic">About</h4>
<p class="mb-0">Customize this section to tell your visitors a little bit about your publication, writers, content, or something else entirely. Totally up to you.</p>
</div>
Expand Down
6 changes: 3 additions & 3 deletions site/content/docs/5.3/examples/cheatsheet-rtl/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- "../cheatsheet/cheatsheet.rtl.css"
extra_js:
- src: "../cheatsheet/cheatsheet.js"
body_class: "bg-light"
body_class: "bg-body-tertiary"
direction: rtl
---

Expand Down Expand Up @@ -1221,7 +1221,7 @@ <h3>شريط التنقل</h3>

<div>
{{< example show_markup="false" >}}
<nav class="navbar navbar-expand-lg bg-light">
<nav class="navbar navbar-expand-lg bg-body-tertiary">
<div class="container-fluid">
<a class="navbar-brand" href="#">
<img src="/docs/{{< param docs_version >}}/assets/brand/bootstrap-logo-white.svg" width="38" height="30" class="d-inline-block align-top" alt="Bootstrap" loading="lazy"
Expand Down Expand Up @@ -1434,7 +1434,7 @@ <h3>المخطوطة</h3>

<div>
<div class="bd-example">
<nav id="navbar-example2" class="navbar bg-light px-3">
<nav id="navbar-example2" class="navbar bg-body-tertiary px-3">
<a class="navbar-brand" href="#">شريط التنقل</a>
<ul class="nav nav-pills">
<li class="nav-item">
Expand Down
6 changes: 3 additions & 3 deletions site/content/docs/5.3/examples/cheatsheet/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- "cheatsheet.css"
extra_js:
- src: "cheatsheet.js"
body_class: "bg-light"
body_class: "bg-body-tertiary"
---

<header class="bd-header bg-dark py-3 d-flex align-items-stretch border-bottom border-dark">
Expand Down Expand Up @@ -1220,7 +1220,7 @@ <h3>Navbar</h3>

<div>
{{< example show_markup="false" >}}
<nav class="navbar navbar-expand-lg bg-light">
<nav class="navbar navbar-expand-lg bg-body-tertiary">
<div class="container-fluid">
<a class="navbar-brand" href="#">
<img src="/docs/{{< param docs_version >}}/assets/brand/bootstrap-logo-white.svg" width="38" height="30" class="d-inline-block align-top" alt="Bootstrap" loading="lazy"
Expand Down Expand Up @@ -1431,7 +1431,7 @@ <h3>Scrollspy</h3>

<div>
<div class="bd-example">
<nav id="navbar-example2" class="navbar bg-light px-3">
<nav id="navbar-example2" class="navbar bg-body-tertiary px-3">
<a class="navbar-brand" href="#">Navbar</a>
<ul class="nav nav-pills">
<li class="nav-item">
Expand Down
4 changes: 2 additions & 2 deletions site/content/docs/5.3/examples/checkout-rtl/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- "../checkout/checkout.css"
extra_js:
- src: "../checkout/checkout.js"
body_class: "bg-light"
body_class: "bg-body-tertiary"
---

<div class="container">
Expand Down Expand Up @@ -45,7 +45,7 @@ <h6 class="my-0">البند الثالث</h6>
</div>
<span class="text-muted">$5</span>
</li>
<li class="list-group-item d-flex justify-content-between bg-light">
<li class="list-group-item d-flex justify-content-between bg-body-tertiary">
<div class="text-success">
<h6 class="my-0">رمز ترويجي</h6>
<small>EXAMPLECODE</small>
Expand Down
4 changes: 2 additions & 2 deletions site/content/docs/5.3/examples/checkout/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- "checkout.css"
extra_js:
- src: "checkout.js"
body_class: "bg-light"
body_class: "bg-body-tertiary"
---

<div class="container">
Expand Down Expand Up @@ -44,7 +44,7 @@ <h6 class="my-0">Third item</h6>
</div>
<span class="text-muted">$5</span>
</li>
<li class="list-group-item d-flex justify-content-between bg-light">
<li class="list-group-item d-flex justify-content-between bg-body-tertiary">
<div class="text-success">
<h6 class="my-0">Promo code</h6>
<small>EXAMPLECODE</small>
Expand Down
2 changes: 1 addition & 1 deletion site/content/docs/5.3/examples/dashboard-rtl/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<div class="container-fluid">
<div class="row">
<nav id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block bg-light sidebar collapse">
<nav id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block bg-body-tertiary sidebar collapse">
<div class="position-sticky pt-3 sidebar-sticky">
<ul class="nav flex-column">
<li class="nav-item">
Expand Down
2 changes: 1 addition & 1 deletion site/content/docs/5.3/examples/dashboard/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<div class="container-fluid">
<div class="row">
<nav id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block bg-light sidebar collapse">
<nav id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block bg-body-tertiary sidebar collapse">
<div class="position-sticky pt-3 sidebar-sticky">
<ul class="nav flex-column">
<li class="nav-item">
Expand Down
2 changes: 1 addition & 1 deletion site/content/docs/5.3/examples/dropdowns/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

<div class="d-flex gap-5 justify-content-center">
<div class="dropdown-menu d-block position-static pt-0 mx-0 rounded-3 shadow overflow-hidden w-280px">
<form class="p-2 mb-2 bg-light border-bottom">
<form class="p-2 mb-2 bg-body-tertiary border-bottom">
<input type="search" class="form-control" autocomplete="false" placeholder="Type to filter...">
</form>
<ul class="list-unstyled mb-0">
Expand Down
6 changes: 3 additions & 3 deletions site/content/docs/5.3/examples/headers/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -194,18 +194,18 @@ <h1 class="visually-hidden">Headers examples</h1>

<div class="container-fluid pb-3">
<div class="d-grid gap-3" style="grid-template-columns: 1fr 2fr;">
<div class="bg-light border rounded-3">
<div class="bg-body-tertiary border rounded-3">
<br><br><br><br><br><br><br><br><br><br>
</div>
<div class="bg-light border rounded-3">
<div class="bg-body-tertiary border rounded-3">
<br><br><br><br><br><br><br><br><br><br>
</div>
</div>
</div>

<div class="b-example-divider"></div>

<nav class="py-2 bg-light border-bottom">
<nav class="py-2 bg-body-tertiary border-bottom">
<div class="container d-flex flex-wrap">
<ul class="nav me-auto">
<li class="nav-item"><a href="#" class="nav-link link-dark px-2 active" aria-current="page">Home</a></li>
Expand Down
2 changes: 1 addition & 1 deletion site/content/docs/5.3/examples/heroes/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ <h1 class="display-4 fw-bold lh-1 mb-3">Vertically centered hero sign-up form</h
<p class="col-lg-10 fs-4">Below is an example form built entirely with Bootstrap’s form controls. Each required form group has a validation state that can be triggered by attempting to submit the form without completing it.</p>
</div>
<div class="col-md-10 mx-auto col-lg-5">
<form class="p-4 p-md-5 border rounded-3 bg-light">
<form class="p-4 p-md-5 border rounded-3 bg-body-tertiary">
<div class="form-floating mb-3">
<input type="email" class="form-control" id="floatingInput" placeholder="name@example.com">
<label for="floatingInput">Email address</label>
Expand Down
4 changes: 2 additions & 2 deletions site/content/docs/5.3/examples/jumbotron/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</a>
</header>

<div class="p-5 mb-4 bg-light rounded-3">
<div class="p-5 mb-4 bg-body-tertiary rounded-3">
<div class="container-fluid py-5">
<h1 class="display-5 fw-bold">Custom jumbotron</h1>
<p class="col-md-8 fs-4">Using a series of utilities, you can create this jumbotron, just like the one in previous versions of Bootstrap. Check out the examples below for how you can remix and restyle it to your liking.</p>
Expand All @@ -30,7 +30,7 @@ <h2>Change the background</h2>
</div>
</div>
<div class="col-md-6">
<div class="h-100 p-5 bg-light border rounded-3">
<div class="h-100 p-5 bg-body-tertiary border rounded-3">
<h2>Add borders</h2>
<p>Or, keep it light and add a border for some added definition to the boundaries of your content. Be sure to look under the hood at the source HTML here as we've adjusted the alignment and sizing of both column's content for equal-height.</p>
<button class="btn btn-outline-secondary" type="button">Example button</button>
Expand Down
4 changes: 2 additions & 2 deletions site/content/docs/5.3/examples/list-groups/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ <h6 class="mb-0">Third heading</h6>
</small>
</span>
</label>
<label class="list-group-item d-flex gap-3 bg-light">
<input class="form-check-input form-check-input-placeholder bg-light flex-shrink-0 pe-none" disabled type="checkbox" value="" style="font-size: 1.375em;">
<label class="list-group-item d-flex gap-3 bg-body-tertiary">
<input class="form-check-input form-check-input-placeholder bg-body-tertiary flex-shrink-0 pe-none" disabled type="checkbox" value="" style="font-size: 1.375em;">
<span class="pt-1 form-checked-content">
<span contenteditable="true" class="w-100">Add new task...</span>
<small class="d-block text-muted">
Expand Down
2 changes: 1 addition & 1 deletion site/content/docs/5.3/examples/navbar-bottom/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
---

<main class="container">
<div class="bg-light p-5 rounded mt-3">
<div class="bg-body-tertiary p-5 rounded mt-3">
<h1>Bottom Navbar example</h1>
<p class="lead">This example is a quick exercise to illustrate how the bottom navbar works.</p>
<a class="btn btn-lg btn-primary" href="{{< docsref "/components/navbar" >}}" role="button">View navbar docs &raquo;</a>
Expand Down
2 changes: 1 addition & 1 deletion site/content/docs/5.3/examples/navbar-fixed/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</nav>

<main class="container">
<div class="bg-light p-5 rounded">
<div class="bg-body-tertiary p-5 rounded">
<h1>Navbar example</h1>
<p class="lead">This example is a quick exercise to illustrate how fixed to top navbar works. As you scroll, it will remain fixed to the top of your browser’s viewport.</p>
<a class="btn btn-lg btn-primary" href="{{< docsref "/components/navbar" >}}" role="button">View navbar docs &raquo;</a>
Expand Down
2 changes: 1 addition & 1 deletion site/content/docs/5.3/examples/navbar-static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</nav>

<main class="container">
<div class="bg-light p-5 rounded">
<div class="bg-body-tertiary p-5 rounded">
<h1>Navbar example</h1>
<p class="lead">This example is a quick exercise to illustrate how the top-aligned navbar works. As you scroll, this navbar remains in its original position and moves with the rest of the page.</p>
<a class="btn btn-lg btn-primary" href="{{< docsref "/components/navbar" >}}" role="button">View navbar docs &raquo;</a>
Expand Down
4 changes: 2 additions & 2 deletions site/content/docs/5.3/examples/navbars-offcanvas/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ <h5 class="offcanvas-title" id="offcanvasNavbarDarkLabel">Offcanvas</h5>
</div>
</nav>

<nav class="navbar bg-light" aria-label="Light offcanvas navbar">
<nav class="navbar bg-body-tertiary" aria-label="Light offcanvas navbar">
<div class="container-fluid">
<a class="navbar-brand" href="#">Light offcanvas navbar</a>
<button class="navbar-toggler" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasNavbarLight" aria-controls="offcanvasNavbarLight">
Expand Down Expand Up @@ -133,7 +133,7 @@ <h5 class="offcanvas-title" id="offcanvasNavbar2Label">Offcanvas</h5>
</nav>

<div class="container my-5">
<div class="bg-light p-5 rounded">
<div class="bg-body-tertiary p-5 rounded">
<div class="col-sm-8 py-5 mx-auto">
<h1 class="display-5 fw-normal">Navbar with offcanvas examples</h1>
<p class="fs-5">This example shows how responsive offcanvas menus work within the navbar. For positioning of navbars, checkout the <a href="{{< docsref "/examples/navbar-static" >}}">top</a> and <a href="{{< docsref "/examples/navbar-fixed" >}}">fixed top</a> examples.</p>
Expand Down
8 changes: 4 additions & 4 deletions site/content/docs/5.3/examples/navbars/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@
</nav>

<div class="container">
<nav class="navbar navbar-expand-lg bg-light rounded" aria-label="Eleventh navbar example">
<nav class="navbar navbar-expand-lg bg-body-tertiary rounded" aria-label="Eleventh navbar example">
<div class="container-fluid">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarsExample09" aria-controls="navbarsExample09" aria-expanded="false" aria-label="Toggle navigation">
Expand Down Expand Up @@ -370,7 +370,7 @@
</div>
</nav>

<nav class="navbar navbar-expand-lg bg-light rounded" aria-label="Twelfth navbar example">
<nav class="navbar navbar-expand-lg bg-body-tertiary rounded" aria-label="Twelfth navbar example">
<div class="container-fluid">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarsExample10" aria-controls="navbarsExample10" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
Expand Down Expand Up @@ -400,7 +400,7 @@
</div>
</nav>

<nav class="navbar navbar-expand-lg bg-light rounded" aria-label="Thirteenth navbar example">
<nav class="navbar navbar-expand-lg bg-body-tertiary rounded" aria-label="Thirteenth navbar example">
<div class="container-fluid">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarsExample11" aria-controls="navbarsExample11" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
Expand Down Expand Up @@ -435,7 +435,7 @@
</nav>

<div>
<div class="bg-light p-5 rounded">
<div class="bg-body-tertiaryp-5 rounded">
<div class="col-sm-8 mx-auto">
<h1>Navbar examples</h1>
<p>This example is a quick exercise to illustrate how the navbar and its contents work. Some navbars extend the width of the viewport, others are confined within a <code>.container</code>. For positioning of navbars, checkout the <a href="{{< docsref "/examples/navbar-static" >}}">top</a> and <a href="{{< docsref "/examples/navbar-fixed" >}}">fixed top</a> examples.</p>
Expand Down
2 changes: 1 addition & 1 deletion site/content/docs/5.3/examples/offcanvas-navbar/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- "offcanvas-navbar.css"
extra_js:
- src: "offcanvas-navbar.js"
body_class: "bg-light"
body_class: "bg-body-tertiary"
aliases: "/docs/5.3/examples/offcanvas/"
---

Expand Down
18 changes: 9 additions & 9 deletions site/content/docs/5.3/examples/product/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</header>

<main>
<div class="position-relative overflow-hidden p-3 p-md-5 m-md-3 text-center bg-light">
<div class="position-relative overflow-hidden p-3 p-md-5 m-md-3 text-center bg-body-tertiary">
<div class="col-md-5 p-lg-5 mx-auto my-5">
<h1 class="display-4 fw-normal">Punny headline</h1>
<p class="lead fw-normal">And an even wittier subheading to boot. Jumpstart your marketing efforts with this example based on Apple’s marketing pages.</p>
Expand All @@ -37,9 +37,9 @@ <h1 class="display-4 fw-normal">Punny headline</h1>
<h2 class="display-5">Another headline</h2>
<p class="lead">And an even wittier subheading.</p>
</div>
<div class="bg-light shadow-sm mx-auto" style="width: 80%; height: 300px; border-radius: 21px 21px 0 0;"></div>
<div class="bg-body-tertiary shadow-sm mx-auto" style="width: 80%; height: 300px; border-radius: 21px 21px 0 0;"></div>
</div>
<div class="bg-light me-md-3 pt-3 px-3 pt-md-5 px-md-5 text-center overflow-hidden">
<div class="bg-body-tertiary me-md-3 pt-3 px-3 pt-md-5 px-md-5 text-center overflow-hidden">
<div class="my-3 p-3">
<h2 class="display-5">Another headline</h2>
<p class="lead">And an even wittier subheading.</p>
Expand All @@ -49,7 +49,7 @@ <h2 class="display-5">Another headline</h2>
</div>

<div class="d-md-flex flex-md-equal w-100 my-md-3 ps-md-3">
<div class="bg-light me-md-3 pt-3 px-3 pt-md-5 px-md-5 text-center overflow-hidden">
<div class="bg-body-tertiary me-md-3 pt-3 px-3 pt-md-5 px-md-5 text-center overflow-hidden">
<div class="my-3 p-3">
<h2 class="display-5">Another headline</h2>
<p class="lead">And an even wittier subheading.</p>
Expand All @@ -61,19 +61,19 @@ <h2 class="display-5">Another headline</h2>
<h2 class="display-5">Another headline</h2>
<p class="lead">And an even wittier subheading.</p>
</div>
<div class="bg-light shadow-sm mx-auto" style="width: 80%; height: 300px; border-radius: 21px 21px 0 0;"></div>
<div class="bg-body-tertiary shadow-sm mx-auto" style="width: 80%; height: 300px; border-radius: 21px 21px 0 0;"></div>
</div>
</div>

<div class="d-md-flex flex-md-equal w-100 my-md-3 ps-md-3">
<div class="bg-light me-md-3 pt-3 px-3 pt-md-5 px-md-5 text-center overflow-hidden">
<div class="bg-body-tertiary me-md-3 pt-3 px-3 pt-md-5 px-md-5 text-center overflow-hidden">
<div class="my-3 p-3">
<h2 class="display-5">Another headline</h2>
<p class="lead">And an even wittier subheading.</p>
</div>
<div class="bg-body shadow-sm mx-auto" style="width: 80%; height: 300px; border-radius: 21px 21px 0 0;"></div>
</div>
<div class="bg-light me-md-3 pt-3 px-3 pt-md-5 px-md-5 text-center overflow-hidden">
<div class="bg-body-tertiary me-md-3 pt-3 px-3 pt-md-5 px-md-5 text-center overflow-hidden">
<div class="my-3 py-3">
<h2 class="display-5">Another headline</h2>
<p class="lead">And an even wittier subheading.</p>
Expand All @@ -83,14 +83,14 @@ <h2 class="display-5">Another headline</h2>
</div>

<div class="d-md-flex flex-md-equal w-100 my-md-3 ps-md-3">
<div class="bg-light me-md-3 pt-3 px-3 pt-md-5 px-md-5 text-center overflow-hidden">
<div class="bg-body-tertiary me-md-3 pt-3 px-3 pt-md-5 px-md-5 text-center overflow-hidden">
<div class="my-3 p-3">
<h2 class="display-5">Another headline</h2>
<p class="lead">And an even wittier subheading.</p>
</div>
<div class="bg-body shadow-sm mx-auto" style="width: 80%; height: 300px; border-radius: 21px 21px 0 0;"></div>
</div>
<div class="bg-light me-md-3 pt-3 px-3 pt-md-5 px-md-5 text-center overflow-hidden">
<div class="bg-body-tertiary me-md-3 pt-3 px-3 pt-md-5 px-md-5 text-center overflow-hidden">
<div class="my-3 py-3">
<h2 class="display-5">Another headline</h2>
<p class="lead">And an even wittier subheading.</p>
Expand Down
Loading

0 comments on commit 8befabb

Please sign in to comment.