Docs tweaks

- Simplify display headings example markup
- Simplify footer styles
- Remove z-indices hacks in the docs
- Remove redundant modal styling in docs
- Use `escape-svg()` to escape docs sidebar chevron
- Simplify sidebar chevron code
- Cleanup masthead css & fix column width between `md` & `lg`
- Easier to download logo's with the `download` attribute.
- Changed some color codes into variables
- Cleanup brands css
This commit is contained in:
Martijn Cuppens 2019-08-30 23:32:12 +03:00 committed by XhmikosR
parent d6945d5e8f
commit b6b96c174b
16 changed files with 43 additions and 155 deletions

View File

@ -12,7 +12,7 @@ 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. 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"> <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">
<img class="svg" src="/docs/{{< param docs_version >}}/assets/brand/bootstrap-solid.svg" alt="Bootstrap" width="144" height="144"> <img class="svg" src="/docs/{{< param docs_version >}}/assets/brand/bootstrap-solid.svg" alt="Bootstrap" width="144" height="144">
</div> </div>
@ -20,7 +20,7 @@ Use either the Bootstrap mark (a capital **B**) or the standard logo (just **Boo
<img class="svg" src="/docs/{{< param docs_version >}}/assets/brand/bootstrap-outline.svg" alt="Bootstrap" width="144" height="144"> <img class="svg" src="/docs/{{< param docs_version >}}/assets/brand/bootstrap-outline.svg" alt="Bootstrap" width="144" height="144">
</div> </div>
</div> </div>
<div class="bd-brand-logos"> <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">
<span class="h1">Bootstrap</span> <span class="h1">Bootstrap</span>
</div> </div>
@ -31,25 +31,25 @@ Use either the Bootstrap mark (a capital **B**) or the standard logo (just **Boo
## Download mark ## Download mark
Download the Bootstrap mark in one of three styles, each available as an SVG file. Right click, Save as. 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"> <div class="bd-brand-logos d-sm-flex text-center bg-light rounded overflow-hidden w-100 mb-3">
<div class="bd-brand-item"> <a href="/docs/{{< param docs_version >}}/assets/brand/bootstrap-solid.svg" download class="bd-brand-item" title="Download solid logo">
<img class="svg" src="/docs/{{< param docs_version >}}/assets/brand/bootstrap-solid.svg" alt="Bootstrap" width="144" height="144"> <img class="svg" src="/docs/{{< param docs_version >}}/assets/brand/bootstrap-solid.svg" alt="Bootstrap" width="144" height="144">
</div> </a>
<div class="bd-brand-item inverse"> <a href="/docs/{{< param docs_version >}}/assets/brand/bootstrap-outline.svg" download class="bd-brand-item inverse" title="Download outlined logo">
<img class="svg" src="/docs/{{< param docs_version >}}/assets/brand/bootstrap-outline.svg" alt="Bootstrap" width="144" height="144"> <img class="svg" src="/docs/{{< param docs_version >}}/assets/brand/bootstrap-outline.svg" alt="Bootstrap" width="144" height="144">
</div> </a>
<div class="bd-brand-item inverse"> <a href="/docs/{{< param docs_version >}}/assets/brand/bootstrap-punchout.svg" download class="bd-brand-item inverse" title="Download inverted logo">
<img class="svg" src="/docs/{{< param docs_version >}}/assets/brand/bootstrap-punchout.svg" alt="Bootstrap" width="144" height="144"> <img class="svg" src="/docs/{{< param docs_version >}}/assets/brand/bootstrap-punchout.svg" alt="Bootstrap" width="144" height="144">
</div> </a>
</div> </div>
## Name ## Name
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**. 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"> <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">
<span class="h3">Bootstrap</span> <span class="h3">Bootstrap</span>
<strong class="text-success">Right</strong> <strong class="text-success">Right</strong>
@ -68,11 +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. 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="bd-brand"> <div class="color-swatches">
<div class="color-swatches"> <div class="color-swatch bd-purple"></div>
<div class="color-swatch bd-purple"></div> <div class="color-swatch bd-purple-light"></div>
<div class="color-swatch bd-purple-light"></div> <div class="color-swatch bd-purple-lighter"></div>
<div class="color-swatch bd-purple-lighter"></div> <div class="color-swatch bd-gray"></div>
<div class="color-swatch bd-gray"></div>
</div>
</div> </div>

View File

@ -104,23 +104,11 @@ Use the included utility classes to recreate the small secondary heading text fr
Traditional heading elements are designed to work best in the meat of your page content. When you need a heading to stand out, consider using a **display heading**—a larger, slightly more opinionated heading style. Keep in mind these headings are not responsive by default, but it's possible to enable [responsive font sizes](#responsive-font-sizes). Traditional heading elements are designed to work best in the meat of your page content. When you need a heading to stand out, consider using a **display heading**—a larger, slightly more opinionated heading style. Keep in mind these headings are not responsive by default, but it's possible to enable [responsive font sizes](#responsive-font-sizes).
<div class="bd-example bd-example-type"> <div class="bd-example">
<table class="table"> <div class="display-1 pb-3 mb-3 border-bottom">Display 1</div>
<tbody> <div class="display-2 pb-3 mb-3 border-bottom">Display 2</div>
<tr> <div class="display-3 pb-3 mb-3 border-bottom">Display 3</div>
<td><span class="display-1">Display 1</span></td> <div class="display-4">Display 4</div>
</tr>
<tr>
<td><span class="display-2">Display 2</span></td>
</tr>
<tr>
<td><span class="display-3">Display 3</span></td>
</tr>
<tr>
<td><span class="display-4">Display 4</span></td>
</tr>
</tbody>
</table>
</div> </div>
{{< highlight html >}} {{< highlight html >}}

View File

@ -1,4 +1,4 @@
<footer class="bd-footer p-3 p-md-5 mt-5 text-muted"> <footer class="bd-footer p-3 p-md-5 mt-5 text-muted bg-light text-center text-sm-left">
<div class="container"> <div class="container">
<ul class="bd-footer-links"> <ul class="bd-footer-links">
<li><a href="{{ .Site.Params.repo }}">GitHub</a></li> <li><a href="{{ .Site.Params.repo }}">GitHub</a></li>

View File

@ -4,7 +4,7 @@
<div class="col-6 mx-auto col-md-4 order-md-2 col-lg-5"> <div class="col-6 mx-auto col-md-4 order-md-2 col-lg-5">
{{ partial "icons/bootstrap-stack.svg" (dict "class" "img-fluid mb-3 mb-md-0" "width" "512" "height" "430") }} {{ partial "icons/bootstrap-stack.svg" (dict "class" "img-fluid mb-3 mb-md-0" "width" "512" "height" "430") }}
</div> </div>
<div class="col-md-7 order-md-1 col-lg-6 text-center text-md-left"> <div class="col-md-8 order-md-1 col-lg-6 text-center text-md-left">
<h1 class="mb-3 bd-text-purple-bright">Bootstrap</h1> <h1 class="mb-3 bd-text-purple-bright">Bootstrap</h1>
<p class="lead lead-lg"> <p class="lead lead-lg">
Build responsive, mobile-first projects for the web with the worlds most popular open source front-end component library. Build responsive, mobile-first projects for the web with the worlds most popular open source front-end component library.

View File

@ -17,7 +17,7 @@
background-color: rgba(0, 0, 0, .05); background-color: rgba(0, 0, 0, .05);
a { a {
color: #333; color: $gray-800;
text-decoration: none; text-decoration: none;
} }
@ -35,5 +35,5 @@
.carbon-poweredby { .carbon-poweredby {
display: block; display: block;
margin-top: .75rem; margin-top: .75rem;
color: #777 !important; color: $gray-700 !important;
} }

View File

@ -128,7 +128,7 @@
padding: .75rem 1rem 0; padding: .75rem 1rem 0;
@include font-size(.75rem, true); @include font-size(.75rem, true);
line-height: 1 !important; line-height: 1 !important;
color: #767676 !important; color: $gray-600 !important;
border-top: 1px solid rgba(0, 0, 0, .1); border-top: 1px solid rgba(0, 0, 0, .1);
} }

View File

@ -4,13 +4,7 @@
// Logo series wrapper // Logo series wrapper
.bd-brand-logos { .bd-brand-logos {
display: table;
width: 100%;
margin-bottom: 1rem;
overflow: hidden;
color: $bd-purple; color: $bd-purple;
background-color: #f9f9f9;
@include border-radius();
.inverse { .inverse {
color: $white; color: $white;
@ -20,32 +14,18 @@
// Individual items // Individual items
.bd-brand-item { .bd-brand-item {
padding: 4rem 0; width: 100%;
text-align: center; padding: 4rem 1rem;
+ .bd-brand-item { + .bd-brand-item {
border-top: 1px solid $white; border-top: 1px solid $white;
} }
// Heading content within
h1,
h3 {
margin-top: 0;
margin-bottom: 0;
}
@include media-breakpoint-up(md) { @include media-breakpoint-up(md) {
display: table-cell;
width: 1%;
+ .bd-brand-item { + .bd-brand-item {
border-top: 0; border-top: 0;
border-left: 1px solid $white; border-left: 1px solid $white;
} }
h1 {
@include font-size(4rem);
}
} }
} }
@ -55,8 +35,8 @@
// //
.color-swatches { .color-swatches {
display: flex;
margin: 0 -5px; margin: 0 -5px;
overflow: hidden; // clearfix
// Docs colors // Docs colors
.bd-purple { .bd-purple {
@ -74,7 +54,6 @@
} }
.color-swatch { .color-swatch {
float: left;
width: 4rem; width: 4rem;
height: 4rem; height: 4rem;
margin-right: .25rem; margin-right: .25rem;

View File

@ -6,7 +6,7 @@
padding: 1.25rem; padding: 1.25rem;
margin-top: 1.25rem; margin-top: 1.25rem;
margin-bottom: 1.25rem; margin-bottom: 1.25rem;
border: 1px solid #eee; border: 1px solid $gray-200;
border-left-width: .25rem; border-left-width: .25rem;
@include border-radius(); @include border-radius();

View File

@ -24,13 +24,13 @@
display: block; display: block;
padding: .25rem .5rem; padding: .25rem .5rem;
@include font-size(.75em); @include font-size(.75em);
color: #818a91; color: $gray-800;
background-color: transparent; background-color: transparent;
border: 0; border: 0;
@include border-radius(); @include border-radius();
&:hover { &:hover {
color: $white; color: $white;
background-color: #027de7; background-color: $primary;
} }
} }

View File

@ -125,29 +125,6 @@
} }
} }
// Typography
.bd-example-type {
.table {
td {
padding: 1rem 0;
border-color: #eee;
}
tr:first-child td {
border-top: 0;
}
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin-top: 0;
margin-bottom: 0;
}
}
// Images // Images
.bd-example { .bd-example {
> svg + svg, > svg + svg,
@ -172,6 +149,7 @@
.bd-example > .list-group { .bd-example > .list-group {
max-width: 400px; max-width: 400px;
} }
.bd-example > [class*="list-group-horizontal"] { .bd-example > [class*="list-group-horizontal"] {
max-width: 100%; max-width: 100%;
} }
@ -183,6 +161,7 @@
position: static; position: static;
margin: -1rem -1rem 1rem; margin: -1rem -1rem 1rem;
} }
.fixed-bottom { .fixed-bottom {
position: static; position: static;
margin: 1rem -1rem -1rem; margin: 1rem -1rem -1rem;
@ -205,38 +184,13 @@
margin-bottom: .5rem; margin-bottom: .5rem;
} }
// Example modals
.modal {
z-index: 1072;
.tooltip,
.popover {
z-index: 1073;
}
}
.modal-backdrop {
z-index: 1071;
}
.bd-example-modal { .bd-example-modal {
background-color: #fafafa; background-color: #fafafa;
.modal { .modal {
position: relative; position: static;
top: auto;
right: auto;
bottom: auto;
left: auto;
z-index: 1;
display: block; display: block;
} }
.modal-dialog {
left: auto;
margin-right: auto;
margin-left: auto;
}
} }
// Tooltips // Tooltips
@ -308,6 +262,7 @@
background-color: transparent; background-color: transparent;
border: 0; border: 0;
} }
pre code { pre code {
@include font-size(inherit); @include font-size(inherit);
color: $gray-900; // Effectively the base text color color: $gray-900; // Effectively the base text color

View File

@ -4,8 +4,6 @@
.bd-footer { .bd-footer {
@include font-size(.875rem); @include font-size(.875rem);
text-align: center;
background-color: #f7f7f7;
a { a {
font-weight: 600; font-weight: 600;
@ -20,10 +18,6 @@
p { p {
margin-bottom: 0; margin-bottom: 0;
} }
@include media-breakpoint-up(sm) {
text-align: left;
}
} }
.bd-footer-links { .bd-footer-links {

View File

@ -1,8 +1,7 @@
// stylelint-disable declaration-no-important // stylelint-disable declaration-no-important
.bd-masthead { .bd-masthead {
position: relative; padding: 3rem 0;
padding: 3rem ($grid-gutter-width / 2);
background-image: linear-gradient(45deg, #fafafa, #f5f5f5); background-image: linear-gradient(45deg, #fafafa, #f5f5f5);
h1 { h1 {
@ -17,27 +16,10 @@
.btn { .btn {
padding: .8rem 2rem; padding: .8rem 2rem;
font-weight: 600; font-weight: 600;
@include font-size(1.25rem);
}
.carbonad {
margin-top: 0 !important;
margin-bottom: -3rem !important;
} }
@include media-breakpoint-up(sm) { @include media-breakpoint-up(sm) {
padding-top: 5rem; padding: 5rem 0;
padding-bottom: 5rem;
.carbonad {
margin-bottom: 0 !important;
}
}
@include media-breakpoint-up(md) {
.carbonad {
margin-top: 3rem !important;
}
} }
} }
@ -74,7 +56,3 @@
width: 6rem; width: 6rem;
margin: 2rem 0; margin: 2rem 0;
} }
.masthead-followup {
.bd-clipboard { display: none; }
}

View File

@ -40,14 +40,9 @@
.bd-sidenav-group { .bd-sidenav-group {
&.has-children .bd-sidenav-group-link::before { &.has-children .bd-sidenav-group-link::before {
display: inline-block; display: inline-block;
width: .875rem;
height: .875rem;
margin-right: .25rem; margin-right: .25rem;
content: ""; line-height: 0; // Align in the middle
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 14l6-6-6-6'/%3E%3C/svg%3E"); content: escape-svg($sidebar-colapse-icon);
background-repeat: no-repeat;
background-position: center center;
opacity: .5;
} }
&.active { &.active {

View File

@ -18,7 +18,7 @@
@supports (position: sticky) { @supports (position: sticky) {
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 1071; // over everything in bootstrap z-index: $zindex-sticky;
} }
} }
} }

View File

@ -3,7 +3,7 @@
.bd-toc nav { .bd-toc nav {
padding-top: .125em; padding-top: .125em;
padding-bottom: .125em; padding-bottom: .125em;
border-left: .25em solid #eee; border-left: .25em solid $gray-200;
> ul { > ul {
padding-left: .5rem; padding-left: .5rem;

View File

@ -10,6 +10,7 @@ $bd-info: #5bc0de;
$bd-warning: #f0ad4e; $bd-warning: #f0ad4e;
$bd-danger: #d9534f; $bd-danger: #d9534f;
$dropdown-active-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'><path fill='#292b2c' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/></svg>"); $dropdown-active-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'><path fill='#292b2c' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/></svg>");
$sidebar-colapse-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'><path fill='none' stroke='rgba(0,0,0,.5)' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 14l6-6-6-6'/></svg>");
// Enable responsive font sizes for font sizes defined in the docs // Enable responsive font sizes for font sizes defined in the docs
// The weird if test is made as a workaround to prevent a false fusv error. // The weird if test is made as a workaround to prevent a false fusv error.