]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Apply utilities in docs styles (#30866)
authorGaël Poupard <ffoodd@users.noreply.github.com>
Tue, 26 May 2020 16:02:19 +0000 (18:02 +0200)
committerGitHub <noreply@github.com>
Tue, 26 May 2020 16:02:19 +0000 (19:02 +0300)
* docs(theming): apply utilities where possible

* Update docs-sidebar.html

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
16 files changed:
site/assets/scss/_brand.scss
site/assets/scss/_colors.scss
site/assets/scss/_content.scss
site/assets/scss/_footer.scss
site/assets/scss/_masthead.scss
site/assets/scss/_navbar.scss
site/assets/scss/_sidebar.scss
site/assets/scss/_subnav.scss
site/content/docs/5.0/about/brand.md
site/layouts/_default/docs.html
site/layouts/_default/single.html
site/layouts/partials/docs-navbar.html
site/layouts/partials/docs-sidebar.html
site/layouts/partials/docs-subnav.html
site/layouts/partials/footer.html
site/layouts/partials/home/masthead-followup.html

index be6aa91ffbabbe0478881129a8ce0599d928f121..1585e4f7a2065990858b2cb3d3daa9c62991accc 100644 (file)
@@ -14,7 +14,6 @@
 
 // Individual items
 .bd-brand-item {
-  width: 100%;
   padding: 4rem 1rem;
 
   + .bd-brand-item {
@@ -35,7 +34,6 @@
 //
 
 .color-swatches {
-  display: flex;
   margin: 0 -5px;
 
   // Docs colors
@@ -56,9 +54,6 @@
 .color-swatch {
   width: 4rem;
   height: 4rem;
-  margin-right: .25rem;
-  margin-left: .25rem;
-  @include border-radius();
 
   @include media-breakpoint-up(md) {
     width: 6rem;
index 751ce3c763347091ec96123479922d60de19fef9..a71a8973b804b090c9485317cf26a68ac4c02115 100644 (file)
 .bd-gray-800 { color: color-contrast($gray-800); background-color: $gray-800; }
 .bd-gray-900 { color: color-contrast($gray-900); background-color: $gray-900; }
 
-.bd-white { color: color-yiq($white); background-color: $white; }
-.bd-black { color: color-yiq($black); background-color: $black; }
+.bd-white { color: color-contrast($white); background-color: $white; }
+.bd-black { color: color-contrast($black); background-color: $black; }
index 4ba926c907614feb937067ff3d379867d348a646..4e744895fd8e1bbad97adb58f8281ffb02cfb564 100644 (file)
@@ -3,8 +3,6 @@
 //
 
 .bd-content {
-  order: 1;
-
   // Offset for the sticky header
   > [id] {
     @include media-breakpoint-up(md) {
index 0d9bf454a3acc54f4c3509173d33906a35916d26..48ad349de0dd5aec84562901f04e0284c258b1c8 100644 (file)
       color: $link-color;
     }
   }
-
-  p {
-    margin-bottom: 0;
-  }
-}
-
-.bd-footer-links {
-  padding-left: 0;
-  margin-bottom: 1rem;
-
-  li {
-    display: inline-block;
-
-    + li {
-      margin-left: 1rem;
-    }
-  }
 }
index f70b4b837c2d8329f5e36c967834fd40b72ab2f7..e524f271af27a866245dfee2e77c9ab1b77494b6 100644 (file)
@@ -28,8 +28,6 @@
 .home-icon {
   width: 6rem;
   height: 6rem;
-  padding: 1.5rem;
-  color: $white;
   @include border-radius(25%);
   box-shadow: 0 .25rem .5rem rgba(0, 0, 0, .15), inset 0 -1px 0 rgba(0, 0, 0, .15);
 }
index c8e1a2d309aca918a87f5c5626324d652539c76f..54d0c425c7e468342a09a57232f24ff2489f09a3 100644 (file)
@@ -5,10 +5,8 @@
   @include media-breakpoint-down(md) {
     .navbar-nav-scroll {
       width: 100%;
-      margin-top: .25rem;
 
       .navbar-nav {
-        padding: .5rem 0;
         margin: -.5rem 0;
         overflow-x: auto;
         white-space: nowrap;
@@ -34,9 +32,7 @@
   }
 
   .navbar-nav-svg {
-    display: inline-block;
     width: 1rem;
     height: 1rem;
-    vertical-align: text-top;
   }
 }
index 4e9e0846c27fa08683e3e021e99067d24c8fce08..be871354d0a36a2ae590780fc8db14436572fee6 100644 (file)
   }
 
   a {
-    display: inline-flex;
-    align-items: center;
     padding: .1875rem .5rem;
     margin-top: .125rem;
     color: rgba($black, .65);
     text-decoration: if($link-decoration == none, null, none);
-    @include border-radius(.25rem);
 
     &:hover,
     &:focus {
@@ -57,7 +54,6 @@
     // Adjust font size and font weights in submenu
     + ul {
       @include font-size(.875rem);
-      font-weight: 400;
     }
   }
 
index fac919e22f274adf8af241d9c53e7c898c00c011..e3ce8ba14ceb6d4ba995da88b39319e325f406fd 100644 (file)
@@ -26,8 +26,6 @@
 }
 
 .bd-search {
-  position: relative; // To contain the Algolia search
-
   @include media-breakpoint-down(sm) {
     width: 100%;
   }
@@ -37,7 +35,3 @@
     box-shadow: 0 0 0 3px rgba($bd-purple-bright, .25);
   }
 }
-
-.bd-search-docs-toggle {
-  color: $gray-900;
-}
index e087f804bd6b40508ee55b5e7ccb330e713020fe..290f92e3ff2a21c1c19eb8221df57e02274be751 100644 (file)
@@ -13,18 +13,18 @@ Have a need for Bootstrap's brand resources? Great! We have only a few guideline
 Use either the Bootstrap mark (a capital **B**) or the standard logo (just **Bootstrap**). It should always appear in San Francisco Display Semibold. **Do not use the Twitter bird** in association with Bootstrap.
 
 <div class="bd-brand-logos d-sm-flex text-center bg-light rounded overflow-hidden w-100 mb-3">
-  <div class="bd-brand-item">
+  <div class="bd-brand-item w-100">
     <img src="/docs/{{< param docs_version >}}/assets/brand/bootstrap-solid.svg" alt="Bootstrap" width="144" height="144" loading="lazy">
   </div>
-  <div class="bd-brand-item inverse">
+  <div class="bd-brand-item w-100 inverse">
     <img src="/docs/{{< param docs_version >}}/assets/brand/bootstrap-outline.svg" alt="Bootstrap" width="144" height="144" loading="lazy">
   </div>
 </div>
 <div class="bd-brand-logos d-sm-flex text-center bg-light rounded overflow-hidden w-100 mb-3">
-  <div class="bd-brand-item">
+  <div class="bd-brand-item w-100">
     <span class="h1">Bootstrap</span>
   </div>
-  <div class="bd-brand-item inverse">
+  <div class="bd-brand-item w-100 inverse">
     <span class="h1">Bootstrap</span>
   </div>
 </div>
@@ -34,13 +34,13 @@ Use either the Bootstrap mark (a capital **B**) or the standard logo (just **Boo
 Download the Bootstrap mark in one of three styles, each available as an SVG file. **Click to download the logos**.
 
 <div class="bd-brand-logos d-sm-flex text-center bg-light rounded overflow-hidden w-100 mb-3">
-  <a href="/docs/{{< param docs_version >}}/assets/brand/bootstrap-solid.svg" download class="bd-brand-item" title="Download solid logo">
+  <a href="/docs/{{< param docs_version >}}/assets/brand/bootstrap-solid.svg" download class="bd-brand-item w-100" title="Download solid logo">
     <img src="/docs/{{< param docs_version >}}/assets/brand/bootstrap-solid.svg" alt="Bootstrap" width="144" height="144" loading="lazy">
   </a>
-  <a href="/docs/{{< param docs_version >}}/assets/brand/bootstrap-outline.svg" download class="bd-brand-item inverse" title="Download outlined logo">
+  <a href="/docs/{{< param docs_version >}}/assets/brand/bootstrap-outline.svg" download class="bd-brand-item w-100 inverse" title="Download outlined logo">
     <img src="/docs/{{< param docs_version >}}/assets/brand/bootstrap-outline.svg" alt="Bootstrap" width="144" height="144" loading="lazy">
   </a>
-  <a href="/docs/{{< param docs_version >}}/assets/brand/bootstrap-punchout.svg" download class="bd-brand-item inverse" title="Download inverted logo">
+  <a href="/docs/{{< param docs_version >}}/assets/brand/bootstrap-punchout.svg" download class="bd-brand-item w-100 inverse" title="Download inverted logo">
     <img src="/docs/{{< param docs_version >}}/assets/brand/bootstrap-punchout.svg" alt="Bootstrap" width="144" height="144" loading="lazy">
   </a>
 </div>
@@ -50,15 +50,15 @@ Download the Bootstrap mark in one of three styles, each available as an SVG fil
 The project and framework should always be referred to as **Bootstrap**. No Twitter before it, no capital _s_, and no abbreviations except for one, a capital **B**.
 
 <div class="bd-brand-logos d-sm-flex text-center bg-light rounded overflow-hidden w-100 mb-3">
-  <div class="bd-brand-item">
+  <div class="bd-brand-item w-100">
     <span class="h3">Bootstrap</span>
     <strong class="text-success">Right</strong>
   </div>
-  <div class="bd-brand-item">
+  <div class="bd-brand-item w-100">
     <span class="h3 text-muted">BootStrap</span>
     <strong class="text-warning">Wrong</strong>
   </div>
-  <div class="bd-brand-item">
+  <div class="bd-brand-item w-100">
     <span class="h3 text-muted">Twitter Bootstrap</span>
     <strong class="text-warning">Wrong</strong>
   </div>
@@ -68,9 +68,9 @@ The project and framework should always be referred to as **Bootstrap**. No Twit
 
 Our docs and branding use a handful of primary colors to differentiate what *is* Bootstrap from what *is in* Bootstrap. In other words, if it's purple, it's representative of Bootstrap.
 
-<div class="color-swatches">
-  <div class="color-swatch bd-purple"></div>
-  <div class="color-swatch bd-purple-light"></div>
-  <div class="color-swatch bd-purple-lighter"></div>
-  <div class="color-swatch bd-gray"></div>
+<div class="color-swatches d-flex">
+  <div class="color-swatch bd-purple rounded mx-1"></div>
+  <div class="color-swatch bd-purple-light rounded mx-1"></div>
+  <div class="color-swatch bd-purple-lighter rounded mx-1"></div>
+  <div class="color-swatch bd-gray rounded mx-1"></div>
 </div>
index 41757d423a9192c5ca4e1e5b04392f0460cd97ae..01890869afcadfd378690c10980e88c1f201236f 100644 (file)
@@ -27,7 +27,7 @@
         </div>
       {{ end }}
 
-      <main class="bd-content pl-lg-4">
+      <main class="bd-content order-1 pl-lg-4">
         {{ if .Page.Params.sections }}
           <div class="row g-3">
             {{ range .Page.Params.sections }}
index 8ffbda50b766c511659a71e3e7fe1bca93af208f..0ce75ce282efe1200dc8efb1db7a0ed9271105d2 100644 (file)
@@ -20,7 +20,7 @@
       </div>
     </header>
 
-    <main class="bd-content py-5" id="content">
+    <main class="bd-content order-1 py-5" id="content">
       <div class="container">
         {{ .Content }}
       </div>
index 4965adecc6f4156b2837742a6c3c30242a90ba96..410008494572bf62a7d9364401dbae9766965695 100644 (file)
@@ -4,8 +4,8 @@
       {{ partial "icons/bootstrap-logo-solid.svg" (dict "class" "d-block" "width" "32" "height" "32") }}
     </a>
 
-    <div class="navbar-nav-scroll order-3 order-md-0 d-flex justify-content-center justify-content-md-start">
-      <ul class="navbar-nav bd-navbar-nav flex-row">
+    <div class="navbar-nav-scroll order-3 order-md-0 d-flex justify-content-center justify-content-md-start mt-1 mt-md-0">
+      <ul class="navbar-nav bd-navbar-nav flex-row py-2 py-md-0">
         <li class="nav-item">
           <a class="nav-link{{ if .IsHome }} active" aria-current="page{{ end }}" href="/" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Bootstrap');">Home</a>
         </li>
     <ul class="navbar-nav ml-sm-auto">
       <li class="nav-item">
         <a class="nav-link px-1 mx-1 py-2" href="{{ .Site.Params.github_org }}" target="_blank" rel="noopener" aria-label="GitHub">
-          {{ partial "icons/github.svg" (dict "class" "navbar-nav-svg" "width" "36" "height" "36") }}
+          {{ partial "icons/github.svg" (dict "class" "navbar-nav-svg d-inline-block align-text-top" "width" "36" "height" "36") }}
         </a>
       </li>
       <li class="nav-item">
         <a class="nav-link px-1 mx-1 py-2" href="https://twitter.com/{{ .Site.Params.twitter }}" target="_blank" rel="noopener" aria-label="Twitter">
-          {{ partial "icons/twitter.svg" (dict "class" "navbar-nav-svg" "width" "36" "height" "36") }}
+          {{ partial "icons/twitter.svg" (dict "class" "navbar-nav-svg d-inline-block align-text-top" "width" "36" "height" "36") }}
         </a>
       </li>
       <li class="nav-item">
         <a class="nav-link px-1 mx-1 py-2" href="{{ .Site.Params.slack }}" target="_blank" rel="noopener" aria-label="Slack">
-          {{ partial "icons/slack.svg" (dict "class" "navbar-nav-svg" "width" "36" "height" "36") }}
+          {{ partial "icons/slack.svg" (dict "class" "navbar-nav-svg d-inline-block align-text-top" "width" "36" "height" "36") }}
         </a>
       </li>
       <li class="nav-item">
         <a class="nav-link px-1 mx-1 py-2" href="{{ .Site.Params.opencollective }}" target="_blank" rel="noopener" aria-label="Open Collective">
-          {{ partial "icons/opencollective.svg" (dict "class" "navbar-nav-svg" "width" "36" "height" "36") }}
+          {{ partial "icons/opencollective.svg" (dict "class" "navbar-nav-svg d-inline-block align-text-top" "width" "36" "height" "36") }}
         </a>
       </li>
     </ul>
index 23e9bbad36c9a90c070803693fe8929ecc85a65e..6a665b826b772b8dea3544475bdf1a01c1d08ffc 100644 (file)
     {{- $is_active_group := eq $.Page.Params.group $group_slug }}
 
     <li class="my-1{{ if $is_active_group }} active{{ end }}">
-      <a class="{{ if not $is_active_group }}collapsed{{ end }}" data-toggle="collapse" href="#{{ $group_slug }}-collapse" role="button" aria-expanded="{{ $is_active_group }}"{{ if $is_active_group }} aria-current="true"{{ end }}>
+      <a class="d-inline-flex align-items-center rounded{{ if not $is_active_group }} collapsed{{ end }}" data-toggle="collapse" href="#{{ $group_slug }}-collapse" role="button" aria-expanded="{{ $is_active_group }}"{{ if $is_active_group }} aria-current="true"{{ end }}>
         {{ $group.title }}
       </a>
 
       {{- if $group.pages }}
-      <ul class="list-unstyled mb-2 collapse{{ if $is_active_group }} show{{ end }}" id="{{ $group_slug }}-collapse">
+      <ul class="list-unstyled font-weight-normal mb-2 collapse{{ if $is_active_group }} show{{ end }}" id="{{ $group_slug }}-collapse">
         {{- range $doc := $group.pages -}}
           {{- $doc_slug := $doc.title | urlize -}}
           {{- $is_active := and $is_active_group (eq $page_slug $doc_slug) -}}
           {{- $href := printf "/docs/%s/%s/%s/" $.Site.Params.docs_version $group_slug $doc_slug }}
-          <li><a href="{{ $href }}"{{ if $is_active }} class="active" aria-current="page"{{ end }}>{{ $doc.title }}</a></li>
+          <li><a href="{{ $href }}" class="d-inline-flex align-items-center rounded{{ if $is_active }} active{{ end }}"{{ if $is_active }} aria-current="page"{{ end }}>{{ $doc.title }}</a></li>
         {{- end }}
       </ul>
       {{- end }}
@@ -35,7 +35,7 @@
 
     <li class="my-3 mx-4 border-top"></li>
     <li{{ if eq $page_slug "migration" }} class="active"{{ end }}>
-      <a href="/docs/{{ $.Site.Params.docs_version }}/migration/">
+      <a href="/docs/{{ $.Site.Params.docs_version }}/migration/" class="d-inline-flex align-items-center rounded">
         Migration
       </a>
     </li>
index 6d60640ef1f61cce33ac568e1274c6b526bfce95..bb082cccdb486d4a15c1aa3fa082552485aacf72 100644 (file)
@@ -1,6 +1,6 @@
 <nav class="bd-subnavbar pt-2 pb-3 pb-md-2" aria-label="Secondary navigation">
   <div class="container-xl d-flex align-items-md-center flex-wrap">
-    <form class="bd-search mb-2 mb-md-0 mr-auto">
+    <form class="bd-search position-relative mb-2 mb-md-0 mr-auto">
       <input type="search" class="form-control" id="search-input" placeholder="Search docs..." aria-label="Search docs for..." autocomplete="off" data-docs-version="{{ .Site.Params.docs_version }}">
     </form>
 
index 8c650a5d0cc3858fd2397cc3bc790d58d4fa0a2c..2076c426e4281243c963204f629c12b86ed8d7d3 100644 (file)
@@ -1,12 +1,12 @@
 <footer class="bd-footer p-3 p-md-5 mt-5 bg-light text-center text-sm-left">
   <div class="container">
-    <ul class="bd-footer-links">
-      <li><a href="{{ .Site.Params.github_org }}">GitHub</a></li>
-      <li><a href="https://twitter.com/{{ .Site.Params.twitter }}">Twitter</a></li>
-      <li><a href="/docs/{{ .Site.Params.docs_version }}/examples/">Examples</a></li>
-      <li><a href="/docs/{{ .Site.Params.docs_version }}/about/overview/">About</a></li>
+    <ul class="bd-footer-links pl-0 mb-3">
+      <li class="d-inline-block"><a href="{{ .Site.Params.github_org }}">GitHub</a></li>
+      <li class="d-inline-block ml-3"><a href="https://twitter.com/{{ .Site.Params.twitter }}">Twitter</a></li>
+      <li class="d-inline-block ml-3"><a href="/docs/{{ .Site.Params.docs_version }}/examples/">Examples</a></li>
+      <li class="d-inline-block ml-3"><a href="/docs/{{ .Site.Params.docs_version }}/about/overview/">About</a></li>
     </ul>
-    <p>Designed and built with all the love in the world by the <a href="/docs/{{ .Site.Params.docs_version }}/about/team/">Bootstrap team</a> with the help of <a href="{{ .Site.Params.repo }}/graphs/contributors">our contributors</a>.</p>
-    <p>Currently v{{ .Site.Params.current_version }}. Code licensed <a href="{{ .Site.Params.repo }}/blob/master/LICENSE" target="_blank" rel="license noopener">MIT</a>, docs <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank" rel="license noopener">CC BY 3.0</a>.</p>
+    <p class="mb-0">Designed and built with all the love in the world by the <a href="/docs/{{ .Site.Params.docs_version }}/about/team/">Bootstrap team</a> with the help of <a href="{{ .Site.Params.repo }}/graphs/contributors">our contributors</a>.</p>
+    <p class="mb-0">Currently v{{ .Site.Params.current_version }}. Code licensed <a href="{{ .Site.Params.repo }}/blob/master/LICENSE" target="_blank" rel="license noopener">MIT</a>, docs <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank" rel="license noopener">CC BY 3.0</a>.</p>
   </div>
 </footer>
index 0c8f26063a5f0e6176ed00e43032e240c138ec28..13d42a282e73f780a40621fbf417267e830de3ed 100644 (file)
@@ -1,7 +1,7 @@
 {{ "<!-- Icons by Bytesize https://github.com/danklammer/bytesize-icons -->" | safeHTML }}
 
 <div class="container py-3 my-3 py-md-5 my-md-5 text-center">
-  <div class="home-icon home-icon-blue mx-auto mb-3">
+  <div class="home-icon home-icon-blue text-white p-4 mx-auto mb-3">
     {{ partial "icons/import.svg" (dict "width" "48" "height" "48") }}
   </div>
   <h2 class="display-4">Installation</h2>
@@ -16,7 +16,7 @@
 </div>
 
 <div class="container py-3 my-3 py-md-5 my-md-5 text-center">
-  <div class="home-icon home-icon-purple mx-auto mb-3">
+  <div class="home-icon home-icon-purple text-white p-4 mx-auto mb-3">
     {{ partial "icons/download.svg" (dict "width" "48" "height" "48") }}
   </div>
   <h2 class="display-4">BootstrapCDN</h2>
@@ -35,7 +35,7 @@
 </div>
 
 <div class="container py-3 my-3 py-md-5 my-md-5 text-center">
-  <div class="home-icon home-icon-yellow mx-auto mb-3">
+  <div class="home-icon home-icon-yellow text-white p-4 mx-auto mb-3">
     {{ partial "icons/lightning.svg" (dict "width" "48" "height" "48") }}
   </div>
   <h2 class="display-4">Official Themes</h2>