diff --git a/site/_includes/icons/placeholder.svg b/site/_includes/icons/placeholder.svg new file mode 100644 index 0000000000..a6f835d8e8 --- /dev/null +++ b/site/_includes/icons/placeholder.svg @@ -0,0 +1,36 @@ +{%- if include.width -%} + {% assign width = include.width %} +{%- else -%} + {% assign width = '100%' %} +{%- endif -%} + +{%- if include.height -%} + {% assign height = include.height %} +{%- else -%} + {% assign height = 180 %} +{%- endif -%} + +{%- if include.text -%} + {% assign text = include.text %} +{%- else -%} + {% assign text = width | append: 'x' | append: height %} +{%- endif -%} + +{%- if include.class -%} + {% assign class = include.class| prepend: ' ' %} +{%- endif -%} + +{%- if include.color -%} + {% assign color = include.color %} +{%- else -%} + {% assign color = '#ddd' %} +{%- endif -%} + +{%- if include.background -%} + {% assign background = include.background %} +{%- else -%} + {% assign background = '#777' %} +{%- endif -%} + +{% if include.title %}{{ include.title }}{% endif %}{{ text }} +{{- '' -}} diff --git a/site/docs/4.1/assets/scss/_component-examples.scss b/site/docs/4.1/assets/scss/_component-examples.scss index 5bafcc4235..1235695b2c 100644 --- a/site/docs/4.1/assets/scss/_component-examples.scss +++ b/site/docs/4.1/assets/scss/_component-examples.scss @@ -212,8 +212,9 @@ } // Images -.bd-example > img { - + img { +.bd-example { + > svg + svg, + > img + img { margin-left: .5rem; } } diff --git a/site/docs/4.1/assets/scss/_placeholder-img.scss b/site/docs/4.1/assets/scss/_placeholder-img.scss new file mode 100644 index 0000000000..c1ac5fee82 --- /dev/null +++ b/site/docs/4.1/assets/scss/_placeholder-img.scss @@ -0,0 +1,14 @@ +// +// Placeholder svg used in the docs. +// + +.bd-placeholder-img { + font-size: 1.125rem; + text-anchor: middle; +} + +.bd-placeholder-img-lg { + @include media-breakpoint-up(md) { + font-size: 3.5rem; + } +} diff --git a/site/docs/4.1/assets/scss/docs.scss b/site/docs/4.1/assets/scss/docs.scss index 046521f7f2..4b6674ad02 100644 --- a/site/docs/4.1/assets/scss/docs.scss +++ b/site/docs/4.1/assets/scss/docs.scss @@ -44,6 +44,7 @@ @import "brand"; @import "colors"; @import "clipboard-js"; +@import "placeholder-img"; // Load docs dependencies @import "syntax"; diff --git a/site/docs/4.1/components/card.md b/site/docs/4.1/components/card.md index dfebf22973..3a090c6578 100644 --- a/site/docs/4.1/components/card.md +++ b/site/docs/4.1/components/card.md @@ -18,7 +18,7 @@ Below is an example of a basic card with mixed content and a fixed width. Cards {% capture example %}
- Card image cap + {% include icons/placeholder.svg width="100%" height="180" class="card-img-top" text="Image cap" title="Card image cap" %}
Card title

Some quick example text to build on the card title and make up the bulk of the card's content.

@@ -70,7 +70,7 @@ Subtitles are used by adding a `.card-subtitle` to a `` tag. If the `.card-t {% capture example %}
- Card image cap + {% include icons/placeholder.svg width="100%" height="180" class="card-img-top" text="Image cap" title="Card image cap" %}

Some quick example text to build on the card title and make up the bulk of the card's content.

@@ -113,7 +113,7 @@ Mix and match multiple content types to create the card you need, or throw every {% capture example %}
- Card image cap + {% include icons/placeholder.svg width="100%" height="180" class="card-img-top" text="Image cap" title="Card image cap" %}
Card title

Some quick example text to build on the card title and make up the bulk of the card's content.

@@ -358,7 +358,7 @@ Similar to headers and footers, cards can include top and bottom "image caps"— {% capture example %}
- Card image cap + {% include icons/placeholder.svg width="100%" height="180" class="card-img-top" text="Image cap" title="Card image cap" %}
Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

@@ -371,7 +371,7 @@ Similar to headers and footers, cards can include top and bottom "image caps"—

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

Last updated 3 mins ago

- Card image cap + {% include icons/placeholder.svg width="100%" height="180" class="card-img-bottom" text="Image cap" title="Card image cap" %}
{% endcapture %} {% include example.html content=example %} @@ -382,7 +382,7 @@ Turn an image into a card background and overlay your card's text. Depending on {% capture example %}
- Card image + {% include icons/placeholder.svg width="100%" height="270" class="bd-placeholder-img-lg card-img" text="Card image" title="Card image" %}
Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

@@ -462,7 +462,7 @@ Use card groups to render cards as a single, attached element with equal width a {% capture example %}
- Card image cap + {% include icons/placeholder.svg width="100%" height="180" class="card-img-top" text="Image cap" title="Card image cap" %}
Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

@@ -470,7 +470,7 @@ Use card groups to render cards as a single, attached element with equal width a
- Card image cap + {% include icons/placeholder.svg width="100%" height="180" class="card-img-top" text="Image cap" title="Card image cap" %}
Card title

This card has supporting text below as a natural lead-in to additional content.

@@ -478,7 +478,7 @@ Use card groups to render cards as a single, attached element with equal width a
- Card image cap + {% include icons/placeholder.svg width="100%" height="180" class="card-img-top" text="Image cap" title="Card image cap" %}
Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.

@@ -494,7 +494,7 @@ When using card groups with footers, their content will automatically line up. {% capture example %}
- Card image cap + {% include icons/placeholder.svg width="100%" height="180" class="card-img-top" text="Image cap" title="Card image cap" %}
Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

@@ -504,7 +504,7 @@ When using card groups with footers, their content will automatically line up.
- Card image cap + {% include icons/placeholder.svg width="100%" height="180" class="card-img-top" text="Image cap" title="Card image cap" %}
Card title

This card has supporting text below as a natural lead-in to additional content.

@@ -514,7 +514,7 @@ When using card groups with footers, their content will automatically line up.
- Card image cap + {% include icons/placeholder.svg width="100%" height="180" class="card-img-top" text="Image cap" title="Card image cap" %}
Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.

@@ -534,7 +534,7 @@ Need a set of equal width and height cards that aren't attached to one another? {% capture example %}
- Card image cap + {% include icons/placeholder.svg width="100%" height="200" class="card-img-top" text="Image cap" title="Card image cap" %}
Card title

This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

@@ -542,7 +542,7 @@ Need a set of equal width and height cards that aren't attached to one another?
- Card image cap + {% include icons/placeholder.svg width="100%" height="200" class="card-img-top" text="Image cap" title="Card image cap" %}
Card title

This card has supporting text below as a natural lead-in to additional content.

@@ -550,7 +550,7 @@ Need a set of equal width and height cards that aren't attached to one another?
- Card image cap + {% include icons/placeholder.svg width="100%" height="200" class="card-img-top" text="Image cap" title="Card image cap" %}
Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.

@@ -566,7 +566,7 @@ Just like with card groups, card footers in decks will automatically line up. {% capture example %}
- Card image cap + {% include icons/placeholder.svg width="100%" height="180" class="card-img-top" text="Image cap" title="Card image cap" %}
Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

@@ -576,7 +576,7 @@ Just like with card groups, card footers in decks will automatically line up.
- Card image cap + {% include icons/placeholder.svg width="100%" height="180" class="card-img-top" text="Image cap" title="Card image cap" %}
Card title

This card has supporting text below as a natural lead-in to additional content.

@@ -586,7 +586,7 @@ Just like with card groups, card footers in decks will automatically line up.
- Card image cap + {% include icons/placeholder.svg width="100%" height="180" class="card-img-top" text="Image cap" title="Card image cap" %}
Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.

@@ -608,7 +608,7 @@ Cards can be organized into [Masonry](https://masonry.desandro.com/)-like column {% capture example %}
- Card image cap + {% include icons/placeholder.svg width="100%" height="160" class="card-img-top" text="Image cap" title="Card image cap" %}
Card title that wraps to a new line

This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

@@ -625,7 +625,7 @@ Cards can be organized into [Masonry](https://masonry.desandro.com/)-like column
- Card image cap + {% include icons/placeholder.svg width="100%" height="160" class="card-img-top" text="Image cap" title="Card image cap" %}
Card title

This card has supporting text below as a natural lead-in to additional content.

@@ -650,7 +650,7 @@ Cards can be organized into [Masonry](https://masonry.desandro.com/)-like column
- Card image + {% include icons/placeholder.svg width="100%" height="260" class="card-img" text="Card image" title="Card image" %}
diff --git a/site/docs/4.1/components/carousel.md b/site/docs/4.1/components/carousel.md index 8ba5c07eaf..ce46c9078e 100644 --- a/site/docs/4.1/components/carousel.md +++ b/site/docs/4.1/components/carousel.md @@ -32,13 +32,13 @@ Here's a carousel with slides only. Note the presence of the `.d-block` and `.w- @@ -53,13 +53,13 @@ Adding in the previous and next controls: