Skip to content

Commit

Permalink
WIP: New snippet examples (#36309)
Browse files Browse the repository at this point in the history
* Start work on some new snippet examples

* Update for dark mode, fixes

* Add images, update descriptions

* examples fixes
  • Loading branch information
mdo authored Feb 15, 2023
1 parent f256874 commit 2dc329d
Show file tree
Hide file tree
Showing 18 changed files with 507 additions and 6 deletions.
13 changes: 13 additions & 0 deletions site/content/docs/5.3/examples/badges/badges.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
.text-warning {
color: #997404 !important;
}
.text-info {
color: #087990 !important;
}
*/

.badge > a {
color: inherit;
}
149 changes: 149 additions & 0 deletions site/content/docs/5.3/examples/badges/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
---
layout: examples
title: Badges
extra_css:
- "badges.css"
body_class: ""
---

<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="x-circle-fill" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z"/>
</symbol>
</svg>

<div class="d-flex gap-2 justify-content-center py-5">
<span class="badge text-bg-primary rounded-pill">Primary</span>
<span class="badge text-bg-secondary rounded-pill">Secondary</span>
<span class="badge text-bg-success rounded-pill">Success</span>
<span class="badge text-bg-danger rounded-pill">Danger</span>
<span class="badge text-bg-warning rounded-pill">Warning</span>
<span class="badge text-bg-info rounded-pill">Info</span>
<span class="badge text-bg-light rounded-pill">Light</span>
<span class="badge text-bg-dark rounded-pill">Dark</span>
</div>

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

<div class="d-flex gap-2 justify-content-center py-5">
<span class="badge bg-primary-subtle text-primary-emphasis rounded-pill">Primary</span>
<span class="badge bg-secondary-subtle text-secondary-emphasis rounded-pill">Secondary</span>
<span class="badge bg-success-subtle text-success-emphasis rounded-pill">Success</span>
<span class="badge bg-danger-subtle text-danger-emphasis rounded-pill">Danger</span>
<span class="badge bg-warning-subtle text-warning-emphasis rounded-pill">Warning</span>
<span class="badge bg-info-subtle text-info-emphasis rounded-pill">Info</span>
<span class="badge bg-light-subtle text-light-emphasis rounded-pill">Light</span>
<span class="badge bg-dark-subtle text-dark-emphasis rounded-pill">Dark</span>
</div>

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

<div class="d-flex gap-2 justify-content-center py-5">
<span class="badge bg-primary-subtle border border-primary-subtle text-primary-emphasis rounded-pill">Primary</span>
<span class="badge bg-secondary-subtle border border-secondary-subtle text-secondary-emphasis rounded-pill">Secondary</span>
<span class="badge bg-success-subtle border border-success-subtle text-success-emphasis rounded-pill">Success</span>
<span class="badge bg-danger-subtle border border-danger-subtle text-danger-emphasis rounded-pill">Danger</span>
<span class="badge bg-warning-subtle border border-warning-subtle text-warning-emphasis rounded-pill">Warning</span>
<span class="badge bg-info-subtle border border-info-subtle text-info-emphasis rounded-pill">Info</span>
<span class="badge bg-light-subtle border border-light-subtle text-light-emphasis rounded-pill">Light</span>
<span class="badge bg-dark-subtle border border-dark-subtle text-dark-emphasis rounded-pill">Dark</span>
</div>

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

<div class="d-flex gap-2 justify-content-center py-5">
<span class="badge d-flex align-items-center p-1 pe-2 text-primary-emphasis bg-primary-subtle border border-primary-subtle rounded-pill">
<img class="rounded-circle me-1" width="24" height="24" src="https://github.com/mdo.png" alt="">Primary
</span>
<span class="badge d-flex align-items-center p-1 pe-2 text-secondary-emphasis bg-secondary-subtle border border-secondary-subtle rounded-pill">
<img class="rounded-circle me-1" width="24" height="24" src="https://github.com/mdo.png" alt="">Secondary
</span>
<span class="badge d-flex align-items-center p-1 pe-2 text-success-emphasis bg-success-subtle border border-success-subtle rounded-pill">
<img class="rounded-circle me-1" width="24" height="24" src="https://github.com/mdo.png" alt="">Success
</span>
<span class="badge d-flex align-items-center p-1 pe-2 text-danger-emphasis bg-danger-subtle border border-danger-subtle rounded-pill">
<img class="rounded-circle me-1" width="24" height="24" src="https://github.com/mdo.png" alt="">Danger
</span>
<span class="badge d-flex align-items-center p-1 pe-2 text-warning-emphasis bg-warning-subtle border border-warning-subtle rounded-pill">
<img class="rounded-circle me-1" width="24" height="24" src="https://github.com/mdo.png" alt="">Warning
</span>
<span class="badge d-flex align-items-center p-1 pe-2 text-info-emphasis bg-info-subtle border border-info-subtle rounded-pill">
<img class="rounded-circle me-1" width="24" height="24" src="https://github.com/mdo.png" alt="">Info
</span>
<span class="badge d-flex align-items-center p-1 pe-2 text-dark-emphasis bg-light-subtle border border-dark-subtle rounded-pill">
<img class="rounded-circle me-1" width="24" height="24" src="https://github.com/mdo.png" alt="">Light
</span>
<span class="badge d-flex align-items-center p-1 pe-2 text-dark-emphasis bg-dark-subtle border border-dark-subtle rounded-pill">
<img class="rounded-circle me-1" width="24" height="24" src="https://github.com/mdo.png" alt="">Dark
</span>
</div>

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

<div class="d-flex gap-2 justify-content-center py-5">
<span class="badge d-flex p-2 align-items-center text-bg-primary rounded-pill">
<span class="px-1">Primary</span>
<a href="#"><svg class="bi ms-1" width="16" height="16"><use xlink:href="#x-circle-fill"/></svg></a>
</span>
<span class="badge d-flex p-2 align-items-center text-primary-emphasis bg-primary-subtle rounded-pill">
<span class="px-1">Primary</span>
<a href="#"><svg class="bi ms-1" width="16" height="16"><use xlink:href="#x-circle-fill"/></svg></a>
</span>
<span class="badge d-flex p-2 align-items-center text-primary-emphasis bg-primary-subtle border border-primary-subtle rounded-pill">
<span class="px-1">Primary</span>
<a href="#"><svg class="bi ms-1" width="16" height="16"><use xlink:href="#x-circle-fill"/></svg></a>
</span>
</div>

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

<div class="d-flex gap-2 justify-content-center py-5">
<span class="badge d-flex align-items-center p-1 pe-2 text-primary-emphasis bg-primary-subtle border border-primary-subtle rounded-pill">
<img class="rounded-circle me-1" width="24" height="24" src="https://github.com/mdo.png" alt="">
Primary
<span class="vr mx-2"></span>
<a href="#"><svg class="bi" width="16" height="16"><use xlink:href="#x-circle-fill"/></svg></a>
</span>
<span class="badge d-flex align-items-center p-1 pe-2 text-secondary-emphasis bg-secondary-subtle border border-secondary-subtle rounded-pill">
<img class="rounded-circle me-1" width="24" height="24" src="https://github.com/mdo.png" alt="">
Secondary
<span class="vr mx-2"></span>
<a href="#"><svg class="bi" width="16" height="16"><use xlink:href="#x-circle-fill"/></svg></a>
</span>
<span class="badge d-flex align-items-center p-1 pe-2 text-success-emphasis bg-success-subtle border border-success-subtle rounded-pill">
<img class="rounded-circle me-1" width="24" height="24" src="https://github.com/mdo.png" alt="">
Success
<span class="vr mx-2"></span>
<a href="#"><svg class="bi" width="16" height="16"><use xlink:href="#x-circle-fill"/></svg></a>
</span>
<span class="badge d-flex align-items-center p-1 pe-2 text-danger-emphasis bg-danger-subtle border border-danger-subtle rounded-pill">
<img class="rounded-circle me-1" width="24" height="24" src="https://github.com/mdo.png" alt="">
Danger
<span class="vr mx-2"></span>
<a href="#"><svg class="bi" width="16" height="16"><use xlink:href="#x-circle-fill"/></svg></a>
</span>
<span class="badge d-flex align-items-center p-1 pe-2 text-warning-emphasis bg-warning-subtle border border-warning-subtle rounded-pill">
<img class="rounded-circle me-1" width="24" height="24" src="https://github.com/mdo.png" alt="">
Warning
<span class="vr mx-2"></span>
<a href="#"><svg class="bi" width="16" height="16"><use xlink:href="#x-circle-fill"/></svg></a>
</span>
<span class="badge d-flex align-items-center p-1 pe-2 text-info-emphasis bg-info-subtle border border-info-subtle rounded-pill">
<img class="rounded-circle me-1" width="24" height="24" src="https://github.com/mdo.png" alt="">
Info
<span class="vr mx-2"></span>
<a href="#"><svg class="bi" width="16" height="16"><use xlink:href="#x-circle-fill"/></svg></a>
</span>
<span class="badge d-flex align-items-center p-1 pe-2 text-light-emphasis bg-light-subtle border border-dark-subtle rounded-pill">
<img class="rounded-circle me-1" width="24" height="24" src="https://github.com/mdo.png" alt="">
Light
<span class="vr mx-2"></span>
<a href="#"><svg class="bi" width="16" height="16"><use xlink:href="#x-circle-fill"/></svg></a>
</span>
<span class="badge d-flex align-items-center p-1 pe-2 text-dark-emphasis bg-dark-subtle border border-dark-subtle rounded-pill">
<img class="rounded-circle me-1" width="24" height="24" src="https://github.com/mdo.png" alt="">
Dark
<span class="vr mx-2"></span>
<a href="#"><svg class="bi" width="16" height="16"><use xlink:href="#x-circle-fill"/></svg></a>
</span>
</div>
50 changes: 50 additions & 0 deletions site/content/docs/5.3/examples/breadcrumbs/breadcrumbs.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
.breadcrumb-chevron {
--bs-breadcrumb-divider: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236c757d'%3E%3Cpath fill-rule='evenodd' d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
gap: .5rem;
}
.breadcrumb-chevron .breadcrumb-item {
display: flex;
gap: inherit;
align-items: center;
padding-left: 0;
line-height: 1;
}
.breadcrumb-chevron .breadcrumb-item::before {
gap: inherit;
float: none;
width: 1rem;
height: 1rem;
}

.breadcrumb-custom .breadcrumb-item {
position: relative;
flex-grow: 1;
padding: .75rem 3rem;
}
.breadcrumb-custom .breadcrumb-item::before {
display: none;
}
.breadcrumb-custom .breadcrumb-item::after {
position: absolute;
top: 50%;
right: -25px;
z-index: 1;
display: inline-block;
width: 50px;
height: 50px;
margin-top: -25px;
content: "";
background-color: var(--bs-tertiary-bg);
border-top-right-radius: .5rem;
box-shadow: 1px -1px var(--bs-border-color);
transform: scale(.707) rotate(45deg);
}
.breadcrumb-custom .breadcrumb-item:first-child {
padding-left: 1.5rem;
}
.breadcrumb-custom .breadcrumb-item:last-child {
padding-right: 1.5rem;
}
.breadcrumb-custom .breadcrumb-item:last-child::after {
display: none;
}
101 changes: 101 additions & 0 deletions site/content/docs/5.3/examples/breadcrumbs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
---
layout: examples
title: Breadcrumbs
extra_css:
- "breadcrumbs.css"
body_class: ""
---

<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="arrow-right-short" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z"/>
</symbol>
<symbol id="chat-fill" viewBox="0 0 16 16">
<path d="M8 15c4.418 0 8-3.134 8-7s-3.582-7-8-7-8 3.134-8 7c0 1.76.743 3.37 1.97 4.6-.097 1.016-.417 2.13-.771 2.966-.079.186.074.394.273.362 2.256-.37 3.597-.938 4.18-1.234A9.06 9.06 0 0 0 8 15z"/>
</symbol>
<symbol id="house-door-fill" viewBox="0 0 16 16">
<path d="M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5z"/>
</symbol>
<symbol id="x-circle-fill" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z"/>
</symbol>
<symbol id="x-lg" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M13.854 2.146a.5.5 0 0 1 0 .708l-11 11a.5.5 0 0 1-.708-.708l11-11a.5.5 0 0 1 .708 0Z"/>
<path fill-rule="evenodd" d="M2.146 2.146a.5.5 0 0 0 0 .708l11 11a.5.5 0 0 0 .708-.708l-11-11a.5.5 0 0 0-.708 0Z"/>
</symbol>
</svg>

<div class="container my-5">
<nav aria-label="breadcrumb">
<ol class="breadcrumb p-3 bg-body-tertiary rounded-3">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item"><a href="#">Library</a></li>
<li class="breadcrumb-item active" aria-current="page">Data</li>
</ol>
</nav>
</div>

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

<div class="container my-5">
<nav aria-label="breadcrumb">
<ol class="breadcrumb p-3 bg-body-tertiary rounded-3">
<li class="breadcrumb-item">
<a class="link-body-emphasis" href="#">
<svg class="bi" width="16" height="16"><use xlink:href="#house-door-fill"></use></svg>
<span class="visually-hidden">Home</span>
</a>
</li>
<li class="breadcrumb-item">
<a class="link-body-emphasis fw-semibold text-decoration-none" href="#">Library</a>
</li>
<li class="breadcrumb-item active" aria-current="page">
Data
</li>
</ol>
</nav>
</div>

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

<div class="container my-5">
<nav aria-label="breadcrumb">
<ol class="breadcrumb breadcrumb-chevron p-3 bg-body-tertiary rounded-3">
<li class="breadcrumb-item">
<a class="link-body-emphasis" href="#">
<svg class="bi" width="16" height="16"><use xlink:href="#house-door-fill"></use></svg>
<span class="visually-hidden">Home</span>
</a>
</li>
<li class="breadcrumb-item">
<a class="link-body-emphasis fw-semibold text-decoration-none" href="#">Library</a>
</li>
<li class="breadcrumb-item active" aria-current="page">
Data
</li>
</ol>
</nav>
</div>

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

<div class="container my-5">
<nav aria-label="breadcrumb">
<ol class="breadcrumb breadcrumb-custom overflow-hidden text-center bg-body-tertiary border rounded-3">
<li class="breadcrumb-item">
<a class="link-body-emphasis fw-semibold text-decoration-none" href="#">
<svg class="bi" width="16" height="16"><use xlink:href="#house-door-fill"></use></svg>
Home
</a>
</li>
<li class="breadcrumb-item">
<a class="link-body-emphasis fw-semibold text-decoration-none" href="#">Library</a>
</li>
<li class="breadcrumb-item active" aria-current="page">
Data
</li>
</ol>
</nav>
</div>

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

0 comments on commit 2dc329d

Please sign in to comment.