Compare commits
74 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d75bc53bee | |||
| 9734c1786d | |||
| f50f38b83a | |||
| 47c75b8492 | |||
| 26c86ba875 | |||
| 099b02b36a | |||
| 4b8a2c936e | |||
| 956ec2df51 | |||
| ae069ffb35 | |||
| 934beb1b66 | |||
| 6d3345b24c | |||
| 2acf59d89b | |||
| cb4fa22950 | |||
| e52e3b1c95 | |||
| 3b9a4167ac | |||
| c96c0ec523 | |||
| 68afc56295 | |||
| 89fbf03410 | |||
| 1eccc810f0 | |||
| b850fcbe49 | |||
| 9203712669 | |||
| e392fc500e | |||
| c082695742 | |||
| f0dc676ba1 | |||
| e8fdc4f614 | |||
| caaa9150d3 | |||
| 67a58f8a3c | |||
| e519be94a2 | |||
| b711671231 | |||
| 2254aeef28 | |||
| 45439923aa | |||
| c985f821a7 | |||
| 86ffedb026 | |||
| 117a248faa | |||
| 3ec3e20440 | |||
| 307c625244 | |||
| 0c36327a99 | |||
| 1c0f359d30 | |||
| 1e4df1c651 | |||
| 876bf4afa7 | |||
| 6ee8cfd964 | |||
| fc44fd852e | |||
| b934bb4850 | |||
| c4cb9ce2ed | |||
| 7c23d46ef6 | |||
| 1ead2c96c5 | |||
| 3bee7c15d4 | |||
| 99cd78e8ff | |||
| b9e39c649c | |||
| f96aa4cbc0 | |||
| b02d5ed72f | |||
| 64b340c37f | |||
| 9566444580 | |||
| c5074c7c18 | |||
| 879d1d15dc | |||
| 7d12ff7b3b | |||
| 9fce97c4b2 | |||
| aecf990fc5 | |||
| 8c975a4f0d | |||
| f4296c71dc | |||
| 0593c2769b | |||
| 56ee1e3c40 | |||
| 69e276e813 | |||
| 777f4c031f | |||
| b851a994bd | |||
| 094fb64680 | |||
| 6997db4d71 | |||
| e6eb77a442 | |||
| d83f33af3a | |||
| a70e06ab71 | |||
| bd4aa6f8bb | |||
| b6f7ec7ddd | |||
| f63e5494b0 | |||
| 6f1783df08 |
@@ -22,12 +22,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
with:
|
||||
node-version: "${{ env.NODE }}"
|
||||
cache: npm
|
||||
|
||||
@@ -20,12 +20,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
with:
|
||||
node-version: "${{ env.NODE }}"
|
||||
cache: npm
|
||||
|
||||
@@ -22,11 +22,11 @@ jobs:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Compress Images
|
||||
uses: calibreapp/image-actions@1.1.0
|
||||
uses: calibreapp/image-actions@737ceeaeed61e17b8d358358a303f1b8d177b779 # v1.1.0
|
||||
with:
|
||||
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -24,21 +24,21 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v3
|
||||
uses: github/codeql-action/init@96f518a34f7a870018057716cc4d7a5c014bd61c # v3.29.10
|
||||
with:
|
||||
config-file: ./.github/codeql/codeql-config.yml
|
||||
languages: "javascript"
|
||||
queries: +security-and-quality
|
||||
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v3
|
||||
uses: github/codeql-action/autobuild@96f518a34f7a870018057716cc4d7a5c014bd61c # v3.29.10
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v3
|
||||
uses: github/codeql-action/analyze@96f518a34f7a870018057716cc4d7a5c014bd61c # v3.29.10
|
||||
with:
|
||||
category: "/language:javascript"
|
||||
|
||||
@@ -23,12 +23,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Run cspell
|
||||
uses: streetsidesoftware/cspell-action@v7
|
||||
uses: streetsidesoftware/cspell-action@dcd03dc3e8a59ec2e360d0c62db517baa0b4bb6d # v7.2.0
|
||||
with:
|
||||
config: ".cspell.json"
|
||||
files: "**/*.{md,mdx}"
|
||||
|
||||
@@ -20,12 +20,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
with:
|
||||
node-version: "${{ env.NODE }}"
|
||||
cache: npm
|
||||
|
||||
@@ -20,12 +20,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
with:
|
||||
node-version: "${{ env.NODE }}"
|
||||
cache: npm
|
||||
@@ -42,9 +42,9 @@ jobs:
|
||||
run: npm run docs-vnu
|
||||
|
||||
- name: Run linkinator
|
||||
uses: JustinBeckwith/linkinator-action@v1
|
||||
uses: JustinBeckwith/linkinator-action@3d5ba091319fa7b0ac14703761eebb7d100e6f6d # v1.11.0
|
||||
with:
|
||||
paths: _site
|
||||
recurse: true
|
||||
verbosity: error
|
||||
skip: "^(?!http://localhost)"
|
||||
skip: "^http://localhost"
|
||||
|
||||
@@ -17,7 +17,7 @@ jobs:
|
||||
if: github.repository == 'twbs/bootstrap'
|
||||
steps:
|
||||
- name: awaiting reply
|
||||
uses: actions-cool/issues-helper@v3
|
||||
uses: actions-cool/issues-helper@50068f49b7b2b3857270ead65e2d02e4459b022c # v3.6.2
|
||||
with:
|
||||
actions: "close-issues"
|
||||
labels: "awaiting-reply"
|
||||
|
||||
@@ -18,7 +18,7 @@ jobs:
|
||||
steps:
|
||||
- name: awaiting reply
|
||||
if: github.event.label.name == 'needs-example'
|
||||
uses: actions-cool/issues-helper@v3
|
||||
uses: actions-cool/issues-helper@50068f49b7b2b3857270ead65e2d02e4459b022c # v3.6.2
|
||||
with:
|
||||
actions: "create-comment"
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -25,12 +25,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
with:
|
||||
node-version: ${{ env.NODE }}
|
||||
cache: npm
|
||||
@@ -45,7 +45,7 @@ jobs:
|
||||
run: npm run js-test
|
||||
|
||||
- name: Run Coveralls
|
||||
uses: coverallsapp/github-action@v2
|
||||
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
|
||||
if: ${{ !github.event.repository.fork }}
|
||||
with:
|
||||
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
|
||||
@@ -20,12 +20,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
with:
|
||||
node-version: "${{ env.NODE }}"
|
||||
cache: npm
|
||||
|
||||
@@ -20,12 +20,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
with:
|
||||
node-version: "${{ env.NODE }}"
|
||||
|
||||
|
||||
@@ -18,6 +18,6 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'twbs/bootstrap'
|
||||
steps:
|
||||
- uses: release-drafter/release-drafter@v6
|
||||
- uses: release-drafter/release-drafter@b1476f6e6eb133afa41ed8589daba6dc69b4d3f5 # v6.1.0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
# This workflow uses actions that are not certified by GitHub. They are provided
|
||||
# by a third-party and are governed by separate terms of service, privacy
|
||||
# policy, and support documentation.
|
||||
|
||||
name: Scorecard supply-chain security
|
||||
on:
|
||||
# For Branch-Protection check. Only the default branch is supported. See
|
||||
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
|
||||
branch_protection_rule:
|
||||
# To guarantee Maintained check is occasionally updated. See
|
||||
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
|
||||
schedule:
|
||||
- cron: '27 12 * * 2'
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
|
||||
# Declare default permissions as read only.
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
analysis:
|
||||
name: Scorecard analysis
|
||||
runs-on: ubuntu-latest
|
||||
# `publish_results: true` only works when run from the default branch. conditional can be removed if disabled.
|
||||
if: github.event.repository.default_branch == github.ref_name || github.event_name == 'pull_request'
|
||||
permissions:
|
||||
# Needed to upload the results to code-scanning dashboard.
|
||||
security-events: write
|
||||
# Needed to publish results and get a badge (see publish_results below).
|
||||
id-token: write
|
||||
# Uncomment the permissions below if installing in a private repository.
|
||||
# contents: read
|
||||
# actions: read
|
||||
|
||||
steps:
|
||||
- name: "Checkout code"
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: "Run analysis"
|
||||
uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
|
||||
with:
|
||||
results_file: results.sarif
|
||||
results_format: sarif
|
||||
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
|
||||
# - you want to enable the Branch-Protection check on a *public* repository, or
|
||||
# - you are installing Scorecard on a *private* repository
|
||||
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
|
||||
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
|
||||
|
||||
# Public repositories:
|
||||
# - Publish results to OpenSSF REST API for easy access by consumers
|
||||
# - Allows the repository to include the Scorecard badge.
|
||||
# - See https://github.com/ossf/scorecard-action#publishing-results.
|
||||
# For private repositories:
|
||||
# - `publish_results` will always be set to `false`, regardless
|
||||
# of the value entered here.
|
||||
publish_results: true
|
||||
|
||||
# (Optional) Uncomment file_mode if you have a .gitattributes with files marked export-ignore
|
||||
# file_mode: git
|
||||
|
||||
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
|
||||
# format to the repository Actions tab.
|
||||
- name: "Upload artifact"
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: SARIF file
|
||||
path: results.sarif
|
||||
retention-days: 5
|
||||
|
||||
# Upload the results to GitHub's code scanning dashboard (optional).
|
||||
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
|
||||
- name: "Upload to code-scanning"
|
||||
uses: github/codeql-action/upload-sarif@96f518a34f7a870018057716cc4d7a5c014bd61c # v3.29.10
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
@@ -70,6 +70,7 @@ Read the [Getting started page](https://getbootstrap.com/docs/5.3/getting-starte
|
||||
[](https://github.com/twbs/bootstrap/blob/main/dist/css/bootstrap.min.css)
|
||||
[](https://github.com/twbs/bootstrap/blob/main/dist/js/bootstrap.min.js)
|
||||
[](https://github.com/twbs/bootstrap/blob/main/dist/js/bootstrap.min.js)
|
||||

|
||||
[](#backers)
|
||||
[](#sponsors)
|
||||
|
||||
@@ -151,7 +152,7 @@ Documentation search is powered by [Algolia's DocSearch](https://docsearch.algol
|
||||
1. Run `npm install` to install the Node.js dependencies, including Astro (the site builder).
|
||||
2. Run `npm run test` (or a specific npm script) to rebuild distributed CSS and JavaScript files, as well as our docs assets.
|
||||
3. From the root `/bootstrap` directory, run `npm run docs-serve` in the command line.
|
||||
4. Open `http://localhost:9001/` in your browser, and voilà.
|
||||
4. Open <http://localhost:9001> in your browser, and voilà.
|
||||
|
||||
Learn more about using Astro by reading its [documentation](https://docs.astro.build/en/getting-started/).
|
||||
|
||||
|
||||
+31
-55
@@ -18,6 +18,9 @@ fi
|
||||
# Branch name to create
|
||||
NEW_BRANCH="gh-pages-${BRANCH_SUFFIX}"
|
||||
|
||||
# Get the current docs version from config
|
||||
DOCS_VERSION=$(node -p "require('js-yaml').load(require('fs').readFileSync('config.yml', 'utf8')).docs_version")
|
||||
|
||||
# Function to print colored messages
|
||||
print_success() {
|
||||
echo -e "${GREEN}✓ $1${NC}"
|
||||
@@ -89,66 +92,39 @@ fi
|
||||
print_success "Pulled latest changes from origin/gh-pages"
|
||||
|
||||
# Step 4: Create a new branch for the update
|
||||
print_info "Checking if branch ${NEW_BRANCH} exists and deleting it if it does…"
|
||||
if git show-ref --verify --quiet refs/heads/${NEW_BRANCH}; then
|
||||
execute "git branch -D ${NEW_BRANCH}"
|
||||
else
|
||||
print_info "Branch ${NEW_BRANCH} does not exist, proceeding with creation…"
|
||||
fi
|
||||
print_info "Creating new branch ${NEW_BRANCH}…"
|
||||
execute "git checkout -b ${NEW_BRANCH}"
|
||||
|
||||
# Step 5: Move root files
|
||||
print_info "Moving root files from temporary location…"
|
||||
ROOT_FILES=("404.html" "CNAME" "apple-touch-icon.png" "favicon.ico" "index.html" "robots.txt" "sitemap-0.xml" "sitemap-index.xml" "sw.js")
|
||||
for file in "${ROOT_FILES[@]}"; do
|
||||
if [ -f "/tmp/_site/$file" ]; then
|
||||
execute "mv /tmp/_site/$file ."
|
||||
else
|
||||
print_warning "File /tmp/_site/$file not found. Skipping."
|
||||
fi
|
||||
done
|
||||
# Step 5: Move all root-level files from Astro build
|
||||
find /tmp/_site -maxdepth 1 -type f -exec mv {} . \;
|
||||
|
||||
# Step 6: Move directories with cleanup
|
||||
print_info "Moving directories from temporary location…"
|
||||
DIRS=("about" "components" "docsref" "examples" "getting-started" "migration")
|
||||
for dir in "${DIRS[@]}"; do
|
||||
if [ -d "/tmp/_site/$dir" ]; then
|
||||
if [ -d "$dir" ]; then
|
||||
execute "rm -rf $dir"
|
||||
# Step 6: Move all top-level directories except 'docs' (which needs special handling)
|
||||
find /tmp/_site -maxdepth 1 -type d ! -name "_site" ! -name "docs" -exec sh -c 'dir=$(basename "$1"); rm -rf "$dir"; mv "$1" .' _ {} \;
|
||||
|
||||
# Step 7: Handle docs directory specially
|
||||
if [ -d "/tmp/_site/docs" ]; then
|
||||
# Replace only the current version's docs
|
||||
if [ -d "docs/$DOCS_VERSION" ]; then
|
||||
rm -rf "docs/$DOCS_VERSION"
|
||||
fi
|
||||
mv "/tmp/_site/docs/$DOCS_VERSION" "docs/"
|
||||
|
||||
# Handle docs root files
|
||||
find /tmp/_site/docs -maxdepth 1 -type f -exec mv {} docs/ \;
|
||||
|
||||
# Handle special docs directories (getting-started, versions)
|
||||
for special_dir in getting-started versions; do
|
||||
if [ -d "/tmp/_site/docs/$special_dir" ]; then
|
||||
rm -rf "docs/$special_dir"
|
||||
mv "/tmp/_site/docs/$special_dir" "docs/"
|
||||
fi
|
||||
execute "mv /tmp/_site/$dir ."
|
||||
else
|
||||
print_warning "Directory /tmp/_site/$dir not found. Skipping."
|
||||
fi
|
||||
done
|
||||
|
||||
# Step 7: Handle special doc directories
|
||||
print_info "Handling special documentation directories…"
|
||||
SPECIAL_DOCS=("docs/getting-started" "docs/versions")
|
||||
for dir in "${SPECIAL_DOCS[@]}"; do
|
||||
if [ -d "/tmp/_site/$dir" ]; then
|
||||
if [ -d "$dir" ]; then
|
||||
execute "rm -rf $dir"
|
||||
fi
|
||||
# Make sure parent directory exists
|
||||
parent_dir=$(dirname "$dir")
|
||||
mkdir -p "$parent_dir"
|
||||
execute "mv /tmp/_site/$dir $parent_dir/"
|
||||
else
|
||||
print_warning "Directory /tmp/_site/$dir not found. Skipping."
|
||||
fi
|
||||
done
|
||||
|
||||
# Step 8: Move docs index.html
|
||||
if [ -f "/tmp/_site/docs/index.html" ]; then
|
||||
execute "mv /tmp/_site/docs/index.html docs/index.html"
|
||||
else
|
||||
print_warning "File /tmp/_site/docs/index.html not found. Skipping."
|
||||
fi
|
||||
|
||||
# Step 9: Handle docs/5.3
|
||||
if [ -d "/tmp/_site/docs/5.3" ]; then
|
||||
if [ -d "docs/5.3" ]; then
|
||||
execute "rm -rf docs/5.3"
|
||||
fi
|
||||
execute "mv /tmp/_site/docs/5.3 docs/"
|
||||
else
|
||||
print_warning "Directory /tmp/_site/docs/5.3 not found. Skipping."
|
||||
done
|
||||
fi
|
||||
|
||||
# Clean up remaining files in /tmp/_site if any
|
||||
|
||||
+22
-3
@@ -11,6 +11,7 @@ import fs from 'node:fs/promises'
|
||||
import path from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import sh from 'shelljs'
|
||||
import { format } from 'prettier'
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
||||
|
||||
@@ -83,7 +84,9 @@ for (const file of staticJsFiles) {
|
||||
sh.rm(`${distFolder}/index.html`)
|
||||
|
||||
// get all examples' HTML files
|
||||
for (const file of sh.find(`${distFolder}/**/*.html`)) {
|
||||
const htmlFiles = sh.find(`${distFolder}/**/*.html`)
|
||||
|
||||
const formatPromises = htmlFiles.map(async file => {
|
||||
const fileContents = sh.cat(file)
|
||||
.toString()
|
||||
.replace(new RegExp(`"/docs/${versionShort}/`, 'g'), '"../')
|
||||
@@ -91,8 +94,24 @@ for (const file of sh.find(`${distFolder}/**/*.html`)) {
|
||||
.replace(/(<link href="\.\.\/[^"]*"[^>]*) integrity="[^"]*"/g, '$1')
|
||||
.replace(/<link[^>]*href="\.\.\/assets\/img\/favicons\/[^"]*"[^>]*>/g, '')
|
||||
.replace(/(<script src="\.\.\/[^"]*"[^>]*) integrity="[^"]*"/g, '$1')
|
||||
new sh.ShellString(fileContents).to(file)
|
||||
}
|
||||
|
||||
let formattedHTML
|
||||
try {
|
||||
formattedHTML = await format(fileContents, {
|
||||
parser: 'html',
|
||||
filepath: file
|
||||
})
|
||||
} catch (error) {
|
||||
console.error(`\nError formatting ${file}:`)
|
||||
console.error(`Message: ${error.message}`)
|
||||
console.error('\nSkipping formatting for this file...\n')
|
||||
formattedHTML = fileContents
|
||||
}
|
||||
|
||||
new sh.ShellString(formattedHTML).to(file)
|
||||
})
|
||||
|
||||
await Promise.all(formatPromises)
|
||||
|
||||
// create the zip file
|
||||
sh.exec(`zip -qr9 "${distFolder}.zip" "${distFolder}"`)
|
||||
|
||||
Generated
+964
-966
File diff suppressed because it is too large
Load Diff
+21
-21
@@ -100,43 +100,43 @@
|
||||
"watch-css-test": "nodemon --watch scss/ --ext scss,js --exec \"npm run css-test\"",
|
||||
"watch-js-main": "nodemon --watch js/src/ --ext js --exec \"npm-run-all js-lint js-compile\"",
|
||||
"watch-js-docs": "nodemon --watch site/src/assets/ --ext js --exec \"npm run js-lint\"",
|
||||
"astro-dev": "astro dev --root site",
|
||||
"astro-dev": "astro dev --root site --port 9001",
|
||||
"astro-build": "astro build --root site && rm -rf _site && cp -r site/dist _site",
|
||||
"astro-preview": "astro preview --root site"
|
||||
"astro-preview": "astro preview --root site --port 9001"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@popperjs/core": "^2.11.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@astrojs/check": "^0.9.4",
|
||||
"@astrojs/markdown-remark": "^6.3.2",
|
||||
"@astrojs/mdx": "^4.3.0",
|
||||
"@astrojs/markdown-remark": "^6.3.6",
|
||||
"@astrojs/mdx": "^4.3.4",
|
||||
"@astrojs/prism": "^3.3.0",
|
||||
"@astrojs/sitemap": "^3.4.1",
|
||||
"@babel/cli": "^7.27.2",
|
||||
"@babel/core": "^7.27.4",
|
||||
"@babel/preset-env": "^7.27.2",
|
||||
"@astrojs/sitemap": "^3.5.0",
|
||||
"@babel/cli": "^7.28.3",
|
||||
"@babel/core": "^7.28.3",
|
||||
"@babel/preset-env": "^7.28.3",
|
||||
"@docsearch/js": "^3.9.0",
|
||||
"@popperjs/core": "^2.11.8",
|
||||
"@rollup/plugin-babel": "^6.0.4",
|
||||
"@rollup/plugin-commonjs": "^28.0.3",
|
||||
"@rollup/plugin-commonjs": "^28.0.6",
|
||||
"@rollup/plugin-node-resolve": "^16.0.1",
|
||||
"@rollup/plugin-replace": "^6.0.2",
|
||||
"@stackblitz/sdk": "^1.11.0",
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/mime": "^4.0.0",
|
||||
"@types/prismjs": "^1.26.5",
|
||||
"astro": "^5.9.2",
|
||||
"astro": "^5.13.2",
|
||||
"astro-auto-import": "^0.4.4",
|
||||
"autoprefixer": "^10.4.21",
|
||||
"bundlewatch": "^0.4.1",
|
||||
"clean-css-cli": "^5.6.3",
|
||||
"clipboard": "^2.0.11",
|
||||
"cross-env": "^7.0.3",
|
||||
"cross-env": "^10.0.0",
|
||||
"eslint": "8.57.1",
|
||||
"eslint-config-xo": "0.45.0",
|
||||
"eslint-plugin-html": "^8.1.3",
|
||||
"eslint-plugin-import": "^2.31.0",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-markdown": "^5.1.0",
|
||||
"eslint-plugin-unicorn": "56.0.1",
|
||||
"find-unused-sass-variables": "^6.1.0",
|
||||
@@ -146,7 +146,7 @@
|
||||
"htmlparser2": "^10.0.0",
|
||||
"image-size": "^2.0.2",
|
||||
"ip": "^2.0.1",
|
||||
"jasmine": "^5.8.0",
|
||||
"jasmine": "^5.9.0",
|
||||
"jquery": "^3.7.1",
|
||||
"js-yaml": "^4.1.0",
|
||||
"karma": "^6.4.4",
|
||||
@@ -162,25 +162,25 @@
|
||||
"mime": "^4.0.7",
|
||||
"nodemon": "^3.1.10",
|
||||
"npm-run-all2": "^8.0.4",
|
||||
"postcss": "^8.5.4",
|
||||
"postcss": "^8.5.6",
|
||||
"postcss-cli": "^11.0.1",
|
||||
"prettier": "^3.5.3",
|
||||
"prettier": "^3.6.2",
|
||||
"prettier-plugin-astro": "^0.14.1",
|
||||
"rehype-autolink-headings": "^7.1.0",
|
||||
"remark": "^15.0.1",
|
||||
"remark-html": "^16.0.1",
|
||||
"rollup": "^4.42.0",
|
||||
"rollup": "^4.46.3",
|
||||
"rollup-plugin-istanbul": "^5.0.0",
|
||||
"rtlcss": "^4.3.0",
|
||||
"sass": "1.78.0",
|
||||
"sass-true": "^8.1.0",
|
||||
"sass-true": "^9.0.0",
|
||||
"shelljs": "^0.10.0",
|
||||
"stylelint": "^16.20.0",
|
||||
"stylelint-config-twbs-bootstrap": "^16.0.0",
|
||||
"terser": "^5.42.0",
|
||||
"stylelint": "^16.23.1",
|
||||
"stylelint-config-twbs-bootstrap": "^16.1.0",
|
||||
"terser": "^5.43.1",
|
||||
"unist-util-visit": "^5.0.0",
|
||||
"vnu-jar": "24.10.17",
|
||||
"zod": "^3.25.57"
|
||||
"zod": "^4.0.17"
|
||||
},
|
||||
"files": [
|
||||
"dist/{css,js}/*.{css,js,map}",
|
||||
|
||||
@@ -157,7 +157,7 @@ $_luminance-list: .0008 .001 .0011 .0013 .0015 .0017 .002 .0022 .0025 .0027 .003
|
||||
|
||||
@each $color in $foregrounds {
|
||||
$contrast-ratio: contrast-ratio($background, $color);
|
||||
@if $contrast-ratio > $min-contrast-ratio {
|
||||
@if $contrast-ratio >= $min-contrast-ratio {
|
||||
@return $color;
|
||||
} @else if $contrast-ratio > $max-ratio {
|
||||
$max-ratio: $contrast-ratio;
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
|
||||
.progress-stacked > .progress {
|
||||
overflow: visible;
|
||||
@include transition(var(--#{$prefix}progress-bar-transition));
|
||||
}
|
||||
|
||||
.progress-stacked > .progress > .progress-bar {
|
||||
|
||||
@@ -534,6 +534,12 @@ legend {
|
||||
[type="search"] {
|
||||
-webkit-appearance: textfield; // 1
|
||||
outline-offset: -2px; // 2
|
||||
|
||||
// 3. Better affordance and consistent appearance for search cancel button
|
||||
&::-webkit-search-cancel-button {
|
||||
cursor: pointer;
|
||||
filter: grayscale(1);
|
||||
}
|
||||
}
|
||||
|
||||
// 1. A few input types should stay LTR
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
.spinner-grow,
|
||||
.spinner-border {
|
||||
display: inline-block;
|
||||
flex-shrink: 0;
|
||||
width: var(--#{$prefix}spinner-width);
|
||||
height: var(--#{$prefix}spinner-height);
|
||||
vertical-align: var(--#{$prefix}spinner-vertical-align);
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
@import "../../functions";
|
||||
@import "../../variables";
|
||||
@import "../../variables-dark";
|
||||
@import "../../maps";
|
||||
@import "../../mixins";
|
||||
|
||||
@include describe("color-contrast function") {
|
||||
@include it("should return a color when contrast ratio equals minimum requirement (WCAG 2.1 compliance)") {
|
||||
// Test case: Background color that produces contrast ratio close to 4.5:1
|
||||
// This tests the WCAG 2.1 requirement that contrast should be "at least 4.5:1" (>= 4.5)
|
||||
// rather than "strictly greater than 4.5:1" (> 4.5)
|
||||
|
||||
// #777777 produces 4.4776:1 contrast ratio with white text
|
||||
// Since this is below the 4.5:1 threshold, it should return the highest available contrast color
|
||||
$test-background: #777;
|
||||
$result: color-contrast($test-background);
|
||||
|
||||
@include assert-equal($result, $black, "Should return black (highest available contrast) for background with 4.4776:1 contrast ratio (below threshold)");
|
||||
}
|
||||
|
||||
@include it("should return a color when contrast ratio is above minimum requirement") {
|
||||
// Test case: Background color that produces contrast ratio above 4.5:1
|
||||
// #767676 produces 4.5415:1 contrast ratio with white text
|
||||
$test-background: #767676;
|
||||
$result: color-contrast($test-background);
|
||||
|
||||
@include assert-equal($result, $white, "Should return white for background with 4.5415:1 contrast ratio (above threshold)");
|
||||
}
|
||||
|
||||
@include it("should return a color when contrast ratio is below minimum requirement") {
|
||||
// Test case: Background color that produces contrast ratio below 4.5:1
|
||||
// #787878 produces 4.4155:1 contrast ratio with white text
|
||||
$test-background: #787878;
|
||||
$result: color-contrast($test-background);
|
||||
|
||||
// Should return the color with the highest available contrast ratio
|
||||
@include assert-equal($result, $black, "Should return black (highest available contrast) for background with 4.4155:1 contrast ratio (below threshold)");
|
||||
}
|
||||
|
||||
@include it("should handle edge case with very light background") {
|
||||
// Test case: Very light background that should return dark text
|
||||
$test-background: #f8f9fa; // Very light gray
|
||||
$result: color-contrast($test-background);
|
||||
|
||||
@include assert-equal($result, $color-contrast-dark, "Should return dark text for very light background");
|
||||
}
|
||||
|
||||
@include it("should handle edge case with very dark background") {
|
||||
// Test case: Very dark background that should return light text
|
||||
$test-background: #212529; // Very dark gray
|
||||
$result: color-contrast($test-background);
|
||||
|
||||
@include assert-equal($result, $color-contrast-light, "Should return light text for very dark background");
|
||||
}
|
||||
|
||||
@include it("should work with custom minimum contrast ratio") {
|
||||
// Test case: Using a custom minimum contrast ratio
|
||||
$test-background: #666;
|
||||
$result: color-contrast($test-background, $color-contrast-dark, $color-contrast-light, 3);
|
||||
|
||||
@include assert-equal($result, $white, "Should return white when using custom minimum contrast ratio of 3.0");
|
||||
}
|
||||
|
||||
@include it("should test contrast ratio calculation accuracy") {
|
||||
// Test case: Verify that contrast-ratio function works correctly
|
||||
$background: #767676;
|
||||
$foreground: $white;
|
||||
$ratio: contrast-ratio($background, $foreground);
|
||||
// Bootstrap's implementation calculates this as ~4.5415, not exactly 4.5, due to its luminance math.
|
||||
// We use 4.54 as the threshold for this test to match the actual implementation.
|
||||
@include assert-true($ratio >= 4.54 and $ratio <= 4.55, "Contrast ratio should be approximately 4.54:1 (Bootstrap's math)");
|
||||
}
|
||||
|
||||
@include it("should test luminance calculation") {
|
||||
// Test case: Verify luminance function works correctly
|
||||
$white-luminance: luminance($white);
|
||||
$black-luminance: luminance($black);
|
||||
|
||||
@include assert-equal($white-luminance, 1, "White should have luminance of 1");
|
||||
@include assert-equal($black-luminance, 0, "Black should have luminance of 0");
|
||||
}
|
||||
|
||||
@include it("should handle rgba colors correctly") {
|
||||
// Test case: Test with rgba colors
|
||||
$test-background: rgba(118, 118, 118, 1); // Same as #767676
|
||||
$result: color-contrast($test-background);
|
||||
|
||||
@include assert-equal($result, $white, "Should handle rgba colors correctly");
|
||||
}
|
||||
|
||||
@include it("should test the WCAG 2.1 boundary condition with color below threshold") {
|
||||
// Test case: Background color that produces contrast ratio below 4.5:1
|
||||
// #787878 produces 4.4155:1 contrast ratio with white
|
||||
$test-background: #787878; // Produces 4.4155:1 contrast ratio
|
||||
$contrast-ratio: contrast-ratio($test-background, $white);
|
||||
|
||||
// Verify the contrast ratio is below 4.5:1
|
||||
@include assert-true($contrast-ratio < 4.5, "Contrast ratio should be below 4.5:1 threshold");
|
||||
|
||||
// The color-contrast function should return the color with highest available contrast
|
||||
$result: color-contrast($test-background);
|
||||
@include assert-equal($result, $black, "color-contrast should return black (highest available contrast) for below-threshold ratio");
|
||||
}
|
||||
|
||||
@include it("should test the WCAG 2.1 boundary condition with color at threshold") {
|
||||
// Test case: Background color that produces contrast ratio close to 4.5:1
|
||||
// #777777 produces 4.4776:1 contrast ratio with white
|
||||
$test-background: #777; // Produces 4.4776:1 contrast ratio
|
||||
$contrast-ratio: contrast-ratio($test-background, $white);
|
||||
|
||||
// Verify the contrast ratio is below 4.5:1 threshold
|
||||
@include assert-true($contrast-ratio < 4.5, "Contrast ratio is below threshold, function should handle gracefully");
|
||||
}
|
||||
|
||||
@include it("should demonstrate the difference between > and >= operators") {
|
||||
// Test case: Demonstrates the difference between > and >= operators
|
||||
// Uses #767676 with a custom minimum contrast ratio that matches its actual ratio (4.5415)
|
||||
// With > 4.5415: should return black (fallback to highest available)
|
||||
// With >= 4.5415: should return white (meets threshold)
|
||||
|
||||
$test-background: #767676; // Produces 4.5415:1 contrast ratio
|
||||
$actual-ratio: contrast-ratio($test-background, $white);
|
||||
|
||||
// Test with a custom minimum that matches the actual ratio
|
||||
$result: color-contrast($test-background, $color-contrast-dark, $color-contrast-light, $actual-ratio);
|
||||
|
||||
// Should return white when using >= implementation
|
||||
@include assert-equal($result, $white, "color-contrast should return white when using exact ratio as threshold (>= implementation)");
|
||||
}
|
||||
|
||||
@include it("should test additional working colors above threshold") {
|
||||
// Test case: Background color that produces contrast ratio well above 4.5:1
|
||||
// #757575 produces 4.6047:1 contrast ratio with white text
|
||||
$test-background: #757575; // Produces 4.6047:1 contrast ratio
|
||||
$result: color-contrast($test-background);
|
||||
|
||||
@include assert-equal($result, $white, "Should return white for background with 4.6047:1 contrast ratio (well above threshold)");
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ const isDev = process.env.NODE_ENV === 'development'
|
||||
|
||||
const site = isDev
|
||||
? // In development mode, use the local dev server.
|
||||
'http://localhost:4321'
|
||||
'http://localhost:9001'
|
||||
: process.env.DEPLOY_PRIME_URL !== undefined
|
||||
? // If deploying on Netlify, use the `DEPLOY_PRIME_URL` environment variable.
|
||||
process.env.DEPLOY_PRIME_URL
|
||||
|
||||
@@ -1209,8 +1209,7 @@ import Placeholder from "@shortcodes/Placeholder.astro"
|
||||
<nav class="navbar navbar-expand-lg bg-body-tertiary">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="#">
|
||||
<img src=${getVersionedDocsPath('/assets/brand/bootstrap-logo-white.svg')} width="38" height="30" class="d-inline-block align-top" alt="Bootstrap" loading="lazy"
|
||||
style="filter: invert(1) grayscale(100%) brightness(200%);">
|
||||
<img src="${getVersionedDocsPath('/assets/brand/bootstrap-logo-white.svg')}" width="38" height="30" class="d-inline-block align-top" alt="Bootstrap" loading="lazy" style="filter: invert(1) grayscale(100%) brightness(200%);">
|
||||
</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="تبديل التنقل">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
@@ -1249,7 +1248,7 @@ import Placeholder from "@shortcodes/Placeholder.astro"
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-primary mt-5">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="#">
|
||||
<img src=${getVersionedDocsPath('/assets/brand/bootstrap-logo-white.svg')} width="38" height="30" class="d-inline-block align-top" alt="Bootstrap" loading="lazy">
|
||||
<img src="${getVersionedDocsPath('/assets/brand/bootstrap-logo-white.svg')}" width="38" height="30" class="d-inline-block align-top" alt="Bootstrap" loading="lazy">
|
||||
</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent2" aria-controls="navbarSupportedContent2" aria-expanded="false" aria-label="تبديل التنقل">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
@@ -1418,41 +1417,41 @@ import Placeholder from "@shortcodes/Placeholder.astro"
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="bd-example">
|
||||
<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">
|
||||
<a class="nav-link" href="#fat"><bdi lang="en" dir="ltr">@fat</bdi></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#mdo"><bdi lang="en" dir="ltr">@mdo</bdi></a>
|
||||
</li>
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">قائمة منسدلة</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a class="dropdown-item" href="#one">واحد</a></li>
|
||||
<li><a class="dropdown-item" href="#two">اثنان</a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item" href="#three">ثلاثة</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div data-bs-spy="scroll" data-bs-target="#navbar-example2" data-bs-offset="0" class="scrollspy-example position-relative mt-2 overflow-auto">
|
||||
<h4 id="fat"><bdi lang="en" dir="ltr">@fat</bdi></h4>
|
||||
<p>محتوى لتوضيح كيف تعمل المخطوطة. ببساطة، المخطوطة عبارة عن منشور طويل يحتوي على عدة أقسام، ولديه شريط تنقل يسهل الوصول إلى هذه الأقسام الفرعية.</p>
|
||||
<h4 id="mdo"><bdi lang="en" dir="ltr">@mdo</bdi></h4>
|
||||
<p>بصرف النظر عن تحسيننا جدوى المكيّفات أو عدم تحسينها، فإن الطلب على الطاقة سيزداد. وطبقاً لما جاء في مقالة معهد ماساشوستس للتكنولوجيا، السالف ذكره، ثمَّة أمر يجب عدم إغفاله، وهو كيف أن هذا الطلب سيضغط على نظم توفير الطاقة الحالية. إذ لا بد من إعادة تأهيل كل شبكات الكهرباء، وتوسيعها لتلبية طلب الطاقة في زمن الذروة، خلال موجات الحرارة المتزايدة. فحين يكون الحر شديداً يجنح الناس إلى البقاء في الداخل، وإلى زيادة تشغيل المكيّفات، سعياً إلى جو لطيف وهم يستخدمون أدوات وأجهزة مختلفة أخرى.</p>
|
||||
<h4 id="one">واحد</h4>
|
||||
<p>وكل هذه الأمور المتزامنة من تشغيل الأجهزة، يزيد الضغط على شبكات الطاقة، كما أسلفنا. لكن مجرد زيادة سعة الشبكة ليس كافياً. إذ لا بد من تطوير الشبكات الذكية التي تستخدم الجسّاسات، ونظم المراقبة، والبرامج الإلكترونية، لتحديد متى يكون الشاغلون في المبنى، ومتى يكون ثمَّة حاجة إلى الطاقة، ومتى تكون الحرارة منخفضة، وبذلك يخرج الناس، فلا يستخدمون كثيراً من الكهرباء.</p>
|
||||
<h4 id="two">اثنان</h4>
|
||||
<p>مع الأسف، كل هذه الحلول المبتكرة مكلِّفة، وهذا ما يجعلها عديمة الجدوى في نظر بعض الشركات الخاصة والمواطن المتقشّف. إن بعض الأفراد الواعين بيئياً يبذلون قصارى جهدهم في تقليص استهلاكهم من الطاقة، ويعون جيداً أهمية أجهزة التكييف المجدية والأرفق بالبيئة. ولكن جهات كثيرة لن تتحرّك لمجرد حافز سلامة المناخ ووقف هدر الطاقة، ما دامت لا تحركها حوافز قانونية. وعلى الحكومات أن تُقدِم عند الاهتمام بالتغيّر المناخي، على وضع التشريعات المناسبة. فبالنظم والحوافز والدعم، يمكن دفع الشركات إلى اعتماد الحلول الأجدى في مكاتبها.</p>
|
||||
<h4 id="three">ثلاثة</h4>
|
||||
<p>وكما يتبيّن لنا، من عدد الحلول الملطِّفة للمشكلة، ومن تنوّعها، وهي الحلول التي أسلفنا الحديث عنها، فإن التكنولوجيا التي نحتاج إليها من أجل معالجة هذه التحديات، هي في مدى قدرتنا، لكنها ربما تتطلّب بعض التحسين، ودعماً استثمارياً أكبر!</p>
|
||||
<p>ولا مانع من إضافة محتوى آخر ليس تحت أي قسم معين.</p>
|
||||
</div>
|
||||
<Example showMarkup={false} code={`
|
||||
<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">
|
||||
<a class="nav-link" href="#fat"><bdi lang="en" dir="ltr">@fat</bdi></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#mdo"><bdi lang="en" dir="ltr">@mdo</bdi></a>
|
||||
</li>
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">قائمة منسدلة</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a class="dropdown-item" href="#one">واحد</a></li>
|
||||
<li><a class="dropdown-item" href="#two">اثنان</a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item" href="#three">ثلاثة</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div data-bs-spy="scroll" data-bs-target="#navbar-example2" data-bs-offset="0" class="scrollspy-example position-relative mt-2 overflow-auto">
|
||||
<h4 id="fat"><bdi lang="en" dir="ltr">@fat</bdi></h4>
|
||||
<p>محتوى لتوضيح كيف تعمل المخطوطة. ببساطة، المخطوطة عبارة عن منشور طويل يحتوي على عدة أقسام، ولديه شريط تنقل يسهل الوصول إلى هذه الأقسام الفرعية.</p>
|
||||
<h4 id="mdo"><bdi lang="en" dir="ltr">@mdo</bdi></h4>
|
||||
<p>بصرف النظر عن تحسيننا جدوى المكيّفات أو عدم تحسينها، فإن الطلب على الطاقة سيزداد. وطبقاً لما جاء في مقالة معهد ماساشوستس للتكنولوجيا، السالف ذكره، ثمَّة أمر يجب عدم إغفاله، وهو كيف أن هذا الطلب سيضغط على نظم توفير الطاقة الحالية. إذ لا بد من إعادة تأهيل كل شبكات الكهرباء، وتوسيعها لتلبية طلب الطاقة في زمن الذروة، خلال موجات الحرارة المتزايدة. فحين يكون الحر شديداً يجنح الناس إلى البقاء في الداخل، وإلى زيادة تشغيل المكيّفات، سعياً إلى جو لطيف وهم يستخدمون أدوات وأجهزة مختلفة أخرى.</p>
|
||||
<h4 id="one">واحد</h4>
|
||||
<p>وكل هذه الأمور المتزامنة من تشغيل الأجهزة، يزيد الضغط على شبكات الطاقة، كما أسلفنا. لكن مجرد زيادة سعة الشبكة ليس كافياً. إذ لا بد من تطوير الشبكات الذكية التي تستخدم الجسّاسات، ونظم المراقبة، والبرامج الإلكترونية، لتحديد متى يكون الشاغلون في المبنى، ومتى يكون ثمَّة حاجة إلى الطاقة، ومتى تكون الحرارة منخفضة، وبذلك يخرج الناس، فلا يستخدمون كثيراً من الكهرباء.</p>
|
||||
<h4 id="two">اثنان</h4>
|
||||
<p>مع الأسف، كل هذه الحلول المبتكرة مكلِّفة، وهذا ما يجعلها عديمة الجدوى في نظر بعض الشركات الخاصة والمواطن المتقشّف. إن بعض الأفراد الواعين بيئياً يبذلون قصارى جهدهم في تقليص استهلاكهم من الطاقة، ويعون جيداً أهمية أجهزة التكييف المجدية والأرفق بالبيئة. ولكن جهات كثيرة لن تتحرّك لمجرد حافز سلامة المناخ ووقف هدر الطاقة، ما دامت لا تحركها حوافز قانونية. وعلى الحكومات أن تُقدِم عند الاهتمام بالتغيّر المناخي، على وضع التشريعات المناسبة. فبالنظم والحوافز والدعم، يمكن دفع الشركات إلى اعتماد الحلول الأجدى في مكاتبها.</p>
|
||||
<h4 id="three">ثلاثة</h4>
|
||||
<p>وكما يتبيّن لنا، من عدد الحلول الملطِّفة للمشكلة، ومن تنوّعها، وهي الحلول التي أسلفنا الحديث عنها، فإن التكنولوجيا التي نحتاج إليها من أجل معالجة هذه التحديات، هي في مدى قدرتنا، لكنها ربما تتطلّب بعض التحسين، ودعماً استثمارياً أكبر!</p>
|
||||
<p>ولا مانع من إضافة محتوى آخر ليس تحت أي قسم معين.</p>
|
||||
</div>
|
||||
`} />
|
||||
</div>
|
||||
</article>
|
||||
<article class="my-3" id="spinners">
|
||||
|
||||
@@ -1187,8 +1187,7 @@ export const body_class = 'bg-body-tertiary'
|
||||
<nav class="navbar navbar-expand-lg bg-body-tertiary">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="#">
|
||||
<img src=${getVersionedDocsPath('/assets/brand/bootstrap-logo-white.svg')} width="38" height="30" class="d-inline-block align-top" alt="Bootstrap" loading="lazy"
|
||||
style="filter: invert(1) grayscale(100%) brightness(200%);">
|
||||
<img src="${getVersionedDocsPath('/assets/brand/bootstrap-logo-white.svg')}" width="38" height="30" class="d-inline-block align-top" alt="Bootstrap" loading="lazy" style="filter: invert(1) grayscale(100%) brightness(200%);">
|
||||
</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
@@ -1223,11 +1222,11 @@ export const body_class = 'bg-body-tertiary'
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-primary mt-5">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="#">
|
||||
<img src=${getVersionedDocsPath('/assets/brand/bootstrap-logo-white.svg')} width="38" height="30" class="d-inline-block align-top" alt="Bootstrap" loading="lazy">
|
||||
<img src="${getVersionedDocsPath('/assets/brand/bootstrap-logo-white.svg')}" width="38" height="30" class="d-inline-block align-top" alt="Bootstrap" loading="lazy">
|
||||
</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent2" aria-controls="navbarSupportedContent2" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
@@ -1394,40 +1393,40 @@ export const body_class = 'bg-body-tertiary'
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="bd-example">
|
||||
<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">
|
||||
<a class="nav-link active" href="#scrollspyHeading1">First</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#scrollspyHeading2">Second</a>
|
||||
</li>
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">Dropdown</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a class="dropdown-item" href="#scrollspyHeading3">Third</a></li>
|
||||
<li><a class="dropdown-item" href="#scrollspyHeading4">Fourth</a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item" href="#scrollspyHeading5">Fifth</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<Example showMarkup={false} code={`
|
||||
<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">
|
||||
<a class="nav-link active" href="#scrollspyHeading1">First</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#scrollspyHeading2">Second</a>
|
||||
</li>
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">Dropdown</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a class="dropdown-item" href="#scrollspyHeading3">Third</a></li>
|
||||
<li><a class="dropdown-item" href="#scrollspyHeading4">Fourth</a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item" href="#scrollspyHeading5">Fifth</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div data-bs-spy="scroll" data-bs-target="#navbar-example2" data-bs-offset="0" class="scrollspy-example position-relative mt-2 overflow-auto" tabindex="0">
|
||||
<h4 id="scrollspyHeading1">First heading</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It's repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<h4 id="scrollspyHeading2">Second heading</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It's repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<h4 id="scrollspyHeading3">Third heading</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It's repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<h4 id="scrollspyHeading4">Fourth heading</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It's repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<h4 id="scrollspyHeading5">Fifth heading</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It's repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
</div>
|
||||
<h4 id="scrollspyHeading1">First heading</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It's repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<h4 id="scrollspyHeading2">Second heading</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It's repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<h4 id="scrollspyHeading3">Third heading</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It's repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<h4 id="scrollspyHeading4">Fourth heading</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It's repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<h4 id="scrollspyHeading5">Fifth heading</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It's repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
</div>
|
||||
`} />
|
||||
</div>
|
||||
</article>
|
||||
<article class="my-3" id="spinners">
|
||||
|
||||
@@ -1,19 +1,9 @@
|
||||
// Example starter JavaScript for disabling form submissions if there are invalid fields
|
||||
(() => {
|
||||
'use strict'
|
||||
function bad() {
|
||||
const bad = document.getElementById('bad')
|
||||
bad.style.width = '60%'
|
||||
}
|
||||
|
||||
// Fetch all the forms we want to apply custom Bootstrap validation styles to
|
||||
const forms = document.querySelectorAll('.needs-validation')
|
||||
|
||||
// Loop over them and prevent submission
|
||||
Array.from(forms).forEach(form => {
|
||||
form.addEventListener('submit', event => {
|
||||
if (!form.checkValidity()) {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
|
||||
form.classList.add('was-validated')
|
||||
}, false)
|
||||
})
|
||||
})()
|
||||
function good() {
|
||||
const good = document.getElementById('good')
|
||||
good.style.width = '60%'
|
||||
}
|
||||
|
||||
@@ -2,230 +2,51 @@
|
||||
import { getVersionedDocsPath } from '@libs/path'
|
||||
|
||||
export const title = 'Checkout example'
|
||||
export const extra_css = ['checkout.css']
|
||||
export const extra_js = [{ src: 'checkout.js' }]
|
||||
export const body_class = 'bg-body-tertiary'
|
||||
---
|
||||
<h2>.progress-stacked bad</h2>
|
||||
|
||||
<div class="container">
|
||||
<main>
|
||||
<div class="py-5 text-center">
|
||||
<img class="d-block mx-auto mb-4" src={getVersionedDocsPath('/assets/brand/bootstrap-logo.svg')} alt="" width="72" height="57">
|
||||
<h1 class="h2">Checkout form</h1>
|
||||
<p class="lead">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="row g-5">
|
||||
<div class="col-md-5 col-lg-4 order-md-last">
|
||||
<h4 class="d-flex justify-content-between align-items-center mb-3">
|
||||
<span class="text-primary">Your cart</span>
|
||||
<span class="badge bg-primary rounded-pill">3</span>
|
||||
</h4>
|
||||
<ul class="list-group mb-3">
|
||||
<li class="list-group-item d-flex justify-content-between lh-sm">
|
||||
<div>
|
||||
<h6 class="my-0">Product name</h6>
|
||||
<small class="text-body-secondary">Brief description</small>
|
||||
</div>
|
||||
<span class="text-body-secondary">$12</span>
|
||||
</li>
|
||||
<li class="list-group-item d-flex justify-content-between lh-sm">
|
||||
<div>
|
||||
<h6 class="my-0">Second product</h6>
|
||||
<small class="text-body-secondary">Brief description</small>
|
||||
</div>
|
||||
<span class="text-body-secondary">$8</span>
|
||||
</li>
|
||||
<li class="list-group-item d-flex justify-content-between lh-sm">
|
||||
<div>
|
||||
<h6 class="my-0">Third item</h6>
|
||||
<small class="text-body-secondary">Brief description</small>
|
||||
</div>
|
||||
<span class="text-body-secondary">$5</span>
|
||||
</li>
|
||||
<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>
|
||||
</div>
|
||||
<span class="text-success">−$5</span>
|
||||
</li>
|
||||
<li class="list-group-item d-flex justify-content-between">
|
||||
<span>Total (USD)</span>
|
||||
<strong>$20</strong>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<form class="card p-2">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" placeholder="Promo code">
|
||||
<button type="submit" class="btn btn-secondary">Redeem</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-7 col-lg-8">
|
||||
<h4 class="mb-3">Billing address</h4>
|
||||
<form class="needs-validation" novalidate>
|
||||
<div class="row g-3">
|
||||
<div class="col-sm-6">
|
||||
<label for="firstName" class="form-label">First name</label>
|
||||
<input type="text" class="form-control" id="firstName" placeholder="" value="" required>
|
||||
<div class="invalid-feedback">
|
||||
Valid first name is required.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6">
|
||||
<label for="lastName" class="form-label">Last name</label>
|
||||
<input type="text" class="form-control" id="lastName" placeholder="" value="" required>
|
||||
<div class="invalid-feedback">
|
||||
Valid last name is required.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<label for="username" class="form-label">Username</label>
|
||||
<div class="input-group has-validation">
|
||||
<span class="input-group-text">@</span>
|
||||
<input type="text" class="form-control" id="username" placeholder="Username" required>
|
||||
<div class="invalid-feedback">
|
||||
Your username is required.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<label for="email" class="form-label">Email <span class="text-body-secondary">(Optional)</span></label>
|
||||
<input type="email" class="form-control" id="email" placeholder="you@example.com">
|
||||
<div class="invalid-feedback">
|
||||
Please enter a valid email address for shipping updates.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<label for="address" class="form-label">Address</label>
|
||||
<input type="text" class="form-control" id="address" placeholder="1234 Main St" required>
|
||||
<div class="invalid-feedback">
|
||||
Please enter your shipping address.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<label for="address2" class="form-label">Address 2 <span class="text-body-secondary">(Optional)</span></label>
|
||||
<input type="text" class="form-control" id="address2" placeholder="Apartment or suite">
|
||||
</div>
|
||||
|
||||
<div class="col-md-5">
|
||||
<label for="country" class="form-label">Country</label>
|
||||
<select class="form-select" id="country" required>
|
||||
<option value="">Choose...</option>
|
||||
<option>United States</option>
|
||||
</select>
|
||||
<div class="invalid-feedback">
|
||||
Please select a valid country.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<label for="state" class="form-label">State</label>
|
||||
<select class="form-select" id="state" required>
|
||||
<option value="">Choose...</option>
|
||||
<option>California</option>
|
||||
</select>
|
||||
<div class="invalid-feedback">
|
||||
Please provide a valid state.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<label for="zip" class="form-label">Zip</label>
|
||||
<input type="text" class="form-control" id="zip" placeholder="" required>
|
||||
<div class="invalid-feedback">
|
||||
Zip code required.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="my-4">
|
||||
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="same-address">
|
||||
<label class="form-check-label" for="same-address">Shipping address is the same as my billing address</label>
|
||||
</div>
|
||||
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="save-info">
|
||||
<label class="form-check-label" for="save-info">Save this information for next time</label>
|
||||
</div>
|
||||
|
||||
<hr class="my-4">
|
||||
|
||||
<h4 class="mb-3">Payment</h4>
|
||||
|
||||
<div class="my-3">
|
||||
<div class="form-check">
|
||||
<input id="credit" name="paymentMethod" type="radio" class="form-check-input" checked required>
|
||||
<label class="form-check-label" for="credit">Credit card</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input id="debit" name="paymentMethod" type="radio" class="form-check-input" required>
|
||||
<label class="form-check-label" for="debit">Debit card</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input id="paypal" name="paymentMethod" type="radio" class="form-check-input" required>
|
||||
<label class="form-check-label" for="paypal">PayPal</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row gy-3">
|
||||
<div class="col-md-6">
|
||||
<label for="cc-name" class="form-label">Name on card</label>
|
||||
<input type="text" class="form-control" id="cc-name" placeholder="" required>
|
||||
<small class="text-body-secondary">Full name as displayed on card</small>
|
||||
<div class="invalid-feedback">
|
||||
Name on card is required
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label for="cc-number" class="form-label">Credit card number</label>
|
||||
<input type="text" class="form-control" id="cc-number" placeholder="" required>
|
||||
<div class="invalid-feedback">
|
||||
Credit card number is required
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<label for="cc-expiration" class="form-label">Expiration</label>
|
||||
<input type="text" class="form-control" id="cc-expiration" placeholder="" required>
|
||||
<div class="invalid-feedback">
|
||||
Expiration date required
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<label for="cc-cvv" class="form-label">CVV</label>
|
||||
<input type="text" class="form-control" id="cc-cvv" placeholder="" required>
|
||||
<div class="invalid-feedback">
|
||||
Security code required
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="my-4">
|
||||
|
||||
<button class="w-100 btn btn-primary btn-lg" type="submit">Continue to checkout</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer class="my-5 pt-5 text-body-secondary text-center text-small">
|
||||
<p class="mb-1">© 2017–{new Date().getFullYear()} Company Name</p>
|
||||
<ul class="list-inline">
|
||||
<li class="list-inline-item"><a href="#">Privacy</a></li>
|
||||
<li class="list-inline-item"><a href="#">Terms</a></li>
|
||||
<li class="list-inline-item"><a href="#">Support</a></li>
|
||||
</ul>
|
||||
</footer>
|
||||
<div class="progress-stacked">
|
||||
<div
|
||||
id="bad"
|
||||
class="progress"
|
||||
role="progressbar"
|
||||
aria-label="Percent In Favor"
|
||||
aria-valuenow="40"
|
||||
aria-valuemin="0"
|
||||
aria-valuemax="100"
|
||||
style="width: 40%"
|
||||
>
|
||||
<div class="progress-bar bg-success"></div>
|
||||
</div>
|
||||
<div
|
||||
class="progress"
|
||||
role="progressbar"
|
||||
aria-label="Percent Opposed"
|
||||
aria-valuenow="40"
|
||||
aria-valuemin="0"
|
||||
aria-valuemax="100"
|
||||
style="width: 40%"
|
||||
>
|
||||
<div class="progress-bar bg-danger"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button class="btn btn-danger mt-2" onclick="bad()">Bad</button>
|
||||
|
||||
<div class="progress mt-2">
|
||||
<div
|
||||
id="good"
|
||||
class="progress-bar bg-success"
|
||||
role="progressbar"
|
||||
style="width: 40%"
|
||||
></div>
|
||||
<div
|
||||
class="progress-bar bg-danger"
|
||||
role="progressbar"
|
||||
style="width: 40%"
|
||||
></div>
|
||||
</div>
|
||||
|
||||
<button class="btn btn-success mt-2" onclick="good()">Good</button>
|
||||
|
||||
|
||||
@@ -435,7 +435,7 @@ export const extra_css = ['navbars.css']
|
||||
</nav>
|
||||
|
||||
<div>
|
||||
<div class="bg-body-tertiaryp-5 rounded">
|
||||
<div class="bg-body-tertiary p-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={getVersionedDocsPath('/examples/navbar-static/')}>top</a> and <a href={getVersionedDocsPath('/examples/navbar-fixed/')}>fixed top</a> examples.</p>
|
||||
|
||||
@@ -6,7 +6,6 @@ import Stylesheet from '@components/head/Stylesheet.astro'
|
||||
import Favicons from '@components/head/Favicons.astro'
|
||||
import Social from '@components/head/Social.astro'
|
||||
import Analytics from '@components/head/Analytics.astro'
|
||||
import Scss from '@components/head/Scss.astro'
|
||||
|
||||
interface Props {
|
||||
description: string
|
||||
@@ -25,6 +24,10 @@ const isHome = Astro.url.pathname === '/'
|
||||
const pageTitle = isHome
|
||||
? `${getConfig().title} · ${getConfig().subtitle}`
|
||||
: `${title} · ${getConfig().title} v${getConfig().docs_version}`
|
||||
|
||||
// Dynamic imports to avoid build-time processing
|
||||
const Scss = import.meta.env.PROD ? null : await import('@components/head/Scss.astro')
|
||||
const ScssProd = import.meta.env.PROD ? await import('@components/head/ScssProd.astro') : null
|
||||
---
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
@@ -47,8 +50,15 @@ const pageTitle = isHome
|
||||
|
||||
<script is:inline src={getVersionedDocsPath('assets/js/color-modes.js')}></script>
|
||||
|
||||
<Stylesheet direction={direction} layout={layout} />
|
||||
<Scss />
|
||||
{import.meta.env.PROD && ScssProd && (
|
||||
<Stylesheet direction={direction} layout={layout} />
|
||||
<ScssProd.default />
|
||||
)}
|
||||
|
||||
{!import.meta.env.PROD && Scss && (
|
||||
<Scss.default />
|
||||
)}
|
||||
|
||||
<Favicons />
|
||||
<Social description={description} layout={layout} thumbnail={thumbnail} title={title} />
|
||||
<Analytics />
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
---
|
||||
|
||||
<style is:global lang="scss">
|
||||
@import '../../../../scss/bootstrap.scss';
|
||||
@import '../../scss/docs';
|
||||
@import '../../scss/docs_search';
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
---
|
||||
|
||||
<style is:global lang="scss">
|
||||
@import '../../scss/docs';
|
||||
@import '../../scss/docs_search';
|
||||
</style>
|
||||
@@ -33,15 +33,20 @@ interface Props {
|
||||
* This takes precedence over the `code` prop.
|
||||
*/
|
||||
filePath?: string
|
||||
/**
|
||||
* Defines if the `<Code>` component is nested inside an `<Example>` component or not.
|
||||
* @default false
|
||||
*/
|
||||
nestedInExample?: boolean
|
||||
}
|
||||
|
||||
const { class: className, code, containerClass, fileMatch, filePath, lang } = Astro.props
|
||||
const { class: className, code, containerClass, fileMatch, filePath, lang, nestedInExample = false } = Astro.props
|
||||
|
||||
let codeToDisplay = filePath
|
||||
? fs.readFileSync(path.join(process.cwd(), filePath), 'utf8')
|
||||
: Array.isArray(code)
|
||||
? code.join('\n')
|
||||
: code
|
||||
? code.join('\n')
|
||||
: code
|
||||
|
||||
if (filePath && fileMatch && codeToDisplay) {
|
||||
const match = codeToDisplay.match(new RegExp(fileMatch))
|
||||
@@ -130,19 +135,23 @@ if (filePath && fileMatch && codeToDisplay) {
|
||||
})
|
||||
</script>
|
||||
|
||||
<div class:list={['bd-code-snippet', containerClass]}>
|
||||
<div class:list={[{ 'bd-code-snippet': !nestedInExample }, containerClass]}>
|
||||
{
|
||||
Astro.slots.has('pre') ? (
|
||||
<slot name="pre" />
|
||||
) : (
|
||||
<div class="bd-clipboard">
|
||||
<button type="button" class="btn-clipboard">
|
||||
<svg class="bi" role="img" aria-label="Copy">
|
||||
<use xlink:href="#clipboard" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
nestedInExample
|
||||
? (<></>)
|
||||
: Astro.slots.has('pre')
|
||||
? (
|
||||
<slot name="pre" />
|
||||
)
|
||||
: (
|
||||
<div class="bd-clipboard">
|
||||
<button type="button" class="btn-clipboard">
|
||||
<svg class="bi" role="img" aria-label="Copy">
|
||||
<use xlink:href="#clipboard" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
<div class="highlight">
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
import { replacePlaceholdersInHtml } from '@libs/placeholder'
|
||||
import { Prism } from '@astrojs/prism'
|
||||
import Code from '@components/shortcodes/Code.astro'
|
||||
|
||||
interface Props {
|
||||
/**
|
||||
@@ -96,9 +96,7 @@ const simplifiedMarkup = markup
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<div class="highlight">
|
||||
<Prism code={simplifiedMarkup} lang={lang} />
|
||||
</div>
|
||||
<Code code={simplifiedMarkup} lang={lang} nestedInExample={true} />
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ try {
|
||||
|
||||
content = matches[1]
|
||||
|
||||
// Fix the identation by removing extra spaces at the beginning of each line
|
||||
// Fix the indentation by removing extra spaces at the beginning of each line
|
||||
const lines = content.split('\n')
|
||||
const spaceCounts = lines.filter((line) => line.trim().length > 0).map((line) => line.match(/^ */)[0].length)
|
||||
const minSpaces = spaceCounts.length ? Math.min(...spaceCounts) : 0
|
||||
|
||||
@@ -42,7 +42,7 @@ try {
|
||||
|
||||
content = matches[1].replaceAll(' !default', '')
|
||||
|
||||
// Fix the identation by removing extra spaces at the beginning of each line
|
||||
// Fix the indentation by removing extra spaces at the beginning of each line
|
||||
const lines = content.split('\n')
|
||||
const spaceCounts = lines.filter((line) => line.trim().length > 0).map((line) => line.match(/^ */)[0].length)
|
||||
const minSpaces = spaceCounts.length ? Math.min(...spaceCounts) : 0
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
import Code from '@shortcodes/Code.astro'
|
||||
import Example from '@shortcodes/Example.astro'
|
||||
import * as tableContent from '@shortcodes/TableContent.md'
|
||||
|
||||
interface Props {
|
||||
@@ -20,12 +21,12 @@ const { class: className, simplified = true } = Astro.props
|
||||
const tableCode = `<table${className ? ` class="${className}"` : ''}>
|
||||
${simplified ? ' ...' : await tableContent.compiledContent()}
|
||||
</table>`
|
||||
|
||||
const exampleCode = `<table${className ? ` class="${className}"` : ''}>
|
||||
${await tableContent.compiledContent()}
|
||||
</table>`
|
||||
---
|
||||
|
||||
<div class="bd-example">
|
||||
<table class={className}>
|
||||
<tableContent.Content />
|
||||
</table>
|
||||
</div>
|
||||
<Example showMarkup={false} code={exampleCode} />
|
||||
|
||||
<Code code={tableCode} lang="html" />
|
||||
|
||||
@@ -200,9 +200,9 @@ Each `.btn-*` modifier class updates the appropriate CSS variables to minimize a
|
||||
|
||||
Here’s an example of building a custom `.btn-*` modifier class as we do for the buttons unique to our docs by reassigning Bootstrap’s CSS variables with a mixture of our own CSS and Sass variables.
|
||||
|
||||
<div class="bd-example">
|
||||
<button type="button" class="btn btn-bd-primary">Custom button</button>
|
||||
</div>
|
||||
<Example showMarkup={false} code={`
|
||||
<button type="button" class="btn btn-bd-primary">Custom button</button>
|
||||
`} />
|
||||
|
||||
<ScssDocs name="btn-css-vars-example" file="site/src/scss/_buttons.scss" />
|
||||
|
||||
|
||||
@@ -100,9 +100,9 @@ Toggle a working modal demo by clicking the button below. It will slide down and
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bd-example">
|
||||
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModalLive">Launch demo modal</button>
|
||||
</div>
|
||||
<Example showMarkup={false} code={`
|
||||
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModalLive">Launch demo modal</button>
|
||||
`} />
|
||||
|
||||
```html
|
||||
<!-- Button trigger modal -->
|
||||
@@ -152,9 +152,9 @@ When backdrop is set to static, the modal will not close when clicking outside o
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bd-example">
|
||||
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#staticBackdropLive">Launch static backdrop modal</button>
|
||||
</div>
|
||||
<Example showMarkup={false} code={`
|
||||
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#staticBackdropLive">Launch static backdrop modal</button>
|
||||
`} />
|
||||
|
||||
```html
|
||||
<!-- Button trigger modal -->
|
||||
@@ -204,9 +204,9 @@ When modals become too long for the user’s viewport or device, they scroll ind
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bd-example">
|
||||
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModalLong">Launch demo modal</button>
|
||||
</div>
|
||||
<Example showMarkup={false} code={`
|
||||
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModalLong">Launch demo modal</button>
|
||||
`} />
|
||||
|
||||
You can also create a scrollable modal that allows scrolling the modal body by adding `.modal-dialog-scrollable` to `.modal-dialog`.
|
||||
|
||||
@@ -230,9 +230,9 @@ You can also create a scrollable modal that allows scrolling the modal body by a
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bd-example">
|
||||
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModalScrollable">Launch demo modal</button>
|
||||
</div>
|
||||
<Example showMarkup={false} code={`
|
||||
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModalScrollable">Launch demo modal</button>
|
||||
`} />
|
||||
|
||||
```html
|
||||
<!-- Scrollable modal -->
|
||||
@@ -383,9 +383,9 @@ Utilize the Bootstrap grid system within a modal by nesting `.container-fluid` w
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bd-example">
|
||||
<Example showMarkup={false} code={`
|
||||
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#gridSystemModal">Launch demo modal</button>
|
||||
</div>
|
||||
`} />
|
||||
|
||||
```html
|
||||
<div class="modal-body">
|
||||
|
||||
@@ -302,94 +302,94 @@ Mix and match with other components and utilities as needed.
|
||||
|
||||
Navbar themes are easier than ever thanks to Bootstrap’s combination of Sass and CSS variables. The default is our “light navbar” for use with light background colors, but you can also apply `data-bs-theme="dark"` to the `.navbar` parent for dark background colors. Then, customize with `.bg-*` and additional utilities.
|
||||
|
||||
<div class="bd-example">
|
||||
<nav class="navbar navbar-expand-lg bg-dark border-bottom border-body" data-bs-theme="dark">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="#">Navbar</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarColor01" aria-controls="navbarColor01" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarColor01">
|
||||
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" aria-current="page" href="#">Home</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Features</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Pricing</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">About</a>
|
||||
</li>
|
||||
</ul>
|
||||
<form class="d-flex" role="search">
|
||||
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search"/>
|
||||
<button class="btn btn-outline-light" type="submit">Search</button>
|
||||
</form>
|
||||
</div>
|
||||
<Example showMarkup={false} code={`
|
||||
<nav class="navbar navbar-expand-lg bg-dark border-bottom border-body" data-bs-theme="dark">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="#">Navbar</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarColor01" aria-controls="navbarColor01" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarColor01">
|
||||
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" aria-current="page" href="#">Home</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Features</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Pricing</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">About</a>
|
||||
</li>
|
||||
</ul>
|
||||
<form class="d-flex" role="search">
|
||||
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search"/>
|
||||
<button class="btn btn-outline-light" type="submit">Search</button>
|
||||
</form>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<nav class="navbar navbar-expand-lg bg-primary" data-bs-theme="dark">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="#">Navbar</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarColor02">
|
||||
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" aria-current="page" href="#">Home</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Features</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Pricing</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">About</a>
|
||||
</li>
|
||||
</ul>
|
||||
<form class="d-flex" role="search">
|
||||
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search"/>
|
||||
<button class="btn btn-outline-light" type="submit">Search</button>
|
||||
</form>
|
||||
</div>
|
||||
<nav class="navbar navbar-expand-lg bg-primary" data-bs-theme="dark">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="#">Navbar</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarColor02">
|
||||
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" aria-current="page" href="#">Home</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Features</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Pricing</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">About</a>
|
||||
</li>
|
||||
</ul>
|
||||
<form class="d-flex" role="search">
|
||||
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search"/>
|
||||
<button class="btn btn-outline-light" type="submit">Search</button>
|
||||
</form>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<nav class="navbar navbar-expand-lg" style="background-color: #e3f2fd;" data-bs-theme="light">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="#">Navbar</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarColor03" aria-controls="navbarColor03" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarColor03">
|
||||
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" aria-current="page" href="#">Home</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Features</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Pricing</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">About</a>
|
||||
</li>
|
||||
</ul>
|
||||
<form class="d-flex" role="search">
|
||||
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search"/>
|
||||
<button class="btn btn-outline-primary" type="submit">Search</button>
|
||||
</form>
|
||||
</div>
|
||||
<nav class="navbar navbar-expand-lg" style="background-color: #e3f2fd;" data-bs-theme="light">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="#">Navbar</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarColor03" aria-controls="navbarColor03" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarColor03">
|
||||
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" aria-current="page" href="#">Home</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Features</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Pricing</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">About</a>
|
||||
</li>
|
||||
</ul>
|
||||
<form class="d-flex" role="search">
|
||||
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search"/>
|
||||
<button class="btn btn-outline-primary" type="submit">Search</button>
|
||||
</form>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
`} />
|
||||
|
||||
```html
|
||||
<nav class="navbar bg-dark border-bottom border-body" data-bs-theme="dark">
|
||||
|
||||
@@ -325,36 +325,36 @@ On the `.nav-underline` modifier class:
|
||||
|
||||
Use the tab JavaScript plugin—include it individually or through the compiled `bootstrap.js` file—to extend our navigational tabs and pills to create tabbable panes of local content.
|
||||
|
||||
<div class="bd-example">
|
||||
<ul class="nav nav-tabs mb-3" id="myTab" role="tablist">
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link active" id="home-tab" data-bs-toggle="tab" data-bs-target="#home-tab-pane" type="button" role="tab" aria-controls="home-tab-pane" aria-selected="true">Home</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="profile-tab" data-bs-toggle="tab" data-bs-target="#profile-tab-pane" type="button" role="tab" aria-controls="profile-tab-pane" aria-selected="false">Profile</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="contact-tab" data-bs-toggle="tab" data-bs-target="#contact-tab-pane" type="button" role="tab" aria-controls="contact-tab-pane" aria-selected="false">Contact</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="disabled-tab" data-bs-toggle="tab" data-bs-target="#disabled-tab-pane" type="button" role="tab" aria-controls="disabled-tab-pane" aria-selected="false" disabled>Disabled</button>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" id="myTabContent">
|
||||
<div class="tab-pane fade show active" id="home-tab-pane" role="tabpanel" aria-labelledby="home-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Home tab’s</strong> associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other <code>.nav</code>-powered navigation.</p>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="profile-tab-pane" role="tabpanel" aria-labelledby="profile-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Profile tab’s</strong> associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other <code>.nav</code>-powered navigation.</p>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="contact-tab-pane" role="tabpanel" aria-labelledby="contact-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Contact tab’s</strong> associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other <code>.nav</code>-powered navigation.</p>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="disabled-tab-pane" role="tabpanel" aria-labelledby="disabled-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Disabled tab’s</strong> associated content.</p>
|
||||
</div>
|
||||
<Example showMarkup={false} code={`
|
||||
<ul class="nav nav-tabs mb-3" id="myTab" role="tablist">
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link active" id="home-tab" data-bs-toggle="tab" data-bs-target="#home-tab-pane" type="button" role="tab" aria-controls="home-tab-pane" aria-selected="true">Home</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="profile-tab" data-bs-toggle="tab" data-bs-target="#profile-tab-pane" type="button" role="tab" aria-controls="profile-tab-pane" aria-selected="false">Profile</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="contact-tab" data-bs-toggle="tab" data-bs-target="#contact-tab-pane" type="button" role="tab" aria-controls="contact-tab-pane" aria-selected="false">Contact</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="disabled-tab" data-bs-toggle="tab" data-bs-target="#disabled-tab-pane" type="button" role="tab" aria-controls="disabled-tab-pane" aria-selected="false" disabled>Disabled</button>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" id="myTabContent">
|
||||
<div class="tab-pane fade show active" id="home-tab-pane" role="tabpanel" aria-labelledby="home-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Home tab’s</strong> associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other <code>.nav</code>-powered navigation.</p>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="profile-tab-pane" role="tabpanel" aria-labelledby="profile-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Profile tab’s</strong> associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other <code>.nav</code>-powered navigation.</p>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="contact-tab-pane" role="tabpanel" aria-labelledby="contact-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Contact tab’s</strong> associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other <code>.nav</code>-powered navigation.</p>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="disabled-tab-pane" role="tabpanel" aria-labelledby="disabled-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Disabled tab’s</strong> associated content.</p>
|
||||
</div>
|
||||
</div>
|
||||
`} />
|
||||
|
||||
```html
|
||||
<ul class="nav nav-tabs" id="myTab" role="tablist">
|
||||
@@ -381,30 +381,30 @@ Use the tab JavaScript plugin—include it individually or through the compiled
|
||||
|
||||
To help fit your needs, this works with `<ul>`-based markup, as shown above, or with any arbitrary “roll your own” markup. Note that if you’re using `<nav>`, you shouldn’t add `role="tablist"` directly to it, as this would override the element’s native role as a navigation landmark. Instead, switch to an alternative element (in the example below, a simple `<div>`) and wrap the `<nav>` around it.
|
||||
|
||||
<div class="bd-example">
|
||||
<nav>
|
||||
<div class="nav nav-tabs mb-3" id="nav-tab" role="tablist">
|
||||
<button class="nav-link active" id="nav-home-tab" data-bs-toggle="tab" data-bs-target="#nav-home" type="button" role="tab" aria-controls="nav-home" aria-selected="true">Home</button>
|
||||
<button class="nav-link" id="nav-profile-tab" data-bs-toggle="tab" data-bs-target="#nav-profile" type="button" role="tab" aria-controls="nav-profile" aria-selected="false">Profile</button>
|
||||
<button class="nav-link" id="nav-contact-tab" data-bs-toggle="tab" data-bs-target="#nav-contact" type="button" role="tab" aria-controls="nav-contact" aria-selected="false">Contact</button>
|
||||
<button class="nav-link" id="nav-disabled-tab" data-bs-toggle="tab" data-bs-target="#nav-disabled" type="button" role="tab" aria-controls="nav-disabled" aria-selected="false" disabled>Disabled</button>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="tab-content" id="nav-tabContent">
|
||||
<div class="tab-pane fade show active" id="nav-home" role="tabpanel" aria-labelledby="nav-home-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Home tab’s</strong> associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other <code>.nav</code>-powered navigation.</p>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="nav-profile" role="tabpanel" aria-labelledby="nav-profile-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Profile tab’s</strong> associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other <code>.nav</code>-powered navigation.</p>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="nav-contact" role="tabpanel" aria-labelledby="nav-contact-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Contact tab’s</strong> associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other <code>.nav</code>-powered navigation.</p>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="nav-disabled" role="tabpanel" aria-labelledby="nav-disabled-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Disabled tab’s</strong> associated content.</p>
|
||||
</div>
|
||||
<Example showMarkup={false} code={`
|
||||
<nav>
|
||||
<div class="nav nav-tabs mb-3" id="nav-tab" role="tablist">
|
||||
<button class="nav-link active" id="nav-home-tab" data-bs-toggle="tab" data-bs-target="#nav-home" type="button" role="tab" aria-controls="nav-home" aria-selected="true">Home</button>
|
||||
<button class="nav-link" id="nav-profile-tab" data-bs-toggle="tab" data-bs-target="#nav-profile" type="button" role="tab" aria-controls="nav-profile" aria-selected="false">Profile</button>
|
||||
<button class="nav-link" id="nav-contact-tab" data-bs-toggle="tab" data-bs-target="#nav-contact" type="button" role="tab" aria-controls="nav-contact" aria-selected="false">Contact</button>
|
||||
<button class="nav-link" id="nav-disabled-tab" data-bs-toggle="tab" data-bs-target="#nav-disabled" type="button" role="tab" aria-controls="nav-disabled" aria-selected="false" disabled>Disabled</button>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="tab-content" id="nav-tabContent">
|
||||
<div class="tab-pane fade show active" id="nav-home" role="tabpanel" aria-labelledby="nav-home-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Home tab’s</strong> associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other <code>.nav</code>-powered navigation.</p>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="nav-profile" role="tabpanel" aria-labelledby="nav-profile-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Profile tab’s</strong> associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other <code>.nav</code>-powered navigation.</p>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="nav-contact" role="tabpanel" aria-labelledby="nav-contact-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Contact tab’s</strong> associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other <code>.nav</code>-powered navigation.</p>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="nav-disabled" role="tabpanel" aria-labelledby="nav-disabled-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Disabled tab’s</strong> associated content.</p>
|
||||
</div>
|
||||
</div>
|
||||
`} />
|
||||
|
||||
```html
|
||||
<nav>
|
||||
@@ -425,36 +425,36 @@ To help fit your needs, this works with `<ul>`-based markup, as shown above, or
|
||||
|
||||
The tabs plugin also works with pills.
|
||||
|
||||
<div class="bd-example">
|
||||
<ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link active" id="pills-home-tab" data-bs-toggle="pill" data-bs-target="#pills-home" type="button" role="tab" aria-controls="pills-home" aria-selected="true">Home</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="pills-profile-tab" data-bs-toggle="pill" data-bs-target="#pills-profile" type="button" role="tab" aria-controls="pills-profile" aria-selected="false">Profile</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="pills-contact-tab" data-bs-toggle="pill" data-bs-target="#pills-contact" type="button" role="tab" aria-controls="pills-contact" aria-selected="false">Contact</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="pills-disabled-tab" data-bs-toggle="pill" data-bs-target="#pills-disabled" type="button" role="tab" aria-controls="pills-disabled" aria-selected="false" disabled>Disabled</button>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" id="pills-tabContent">
|
||||
<div class="tab-pane fade show active" id="pills-home" role="tabpanel" aria-labelledby="pills-home-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Home tab’s</strong> associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other <code>.nav</code>-powered navigation.</p>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="pills-profile" role="tabpanel" aria-labelledby="pills-profile-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Profile tab’s</strong> associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other <code>.nav</code>-powered navigation.</p>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="pills-contact" role="tabpanel" aria-labelledby="pills-contact-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Contact tab’s</strong> associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other <code>.nav</code>-powered navigation.</p>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="pills-disabled" role="tabpanel" aria-labelledby="pills-disabled-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Disabled tab’s</strong> associated content.</p>
|
||||
</div>
|
||||
<Example showMarkup={false} code={`
|
||||
<ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link active" id="pills-home-tab" data-bs-toggle="pill" data-bs-target="#pills-home" type="button" role="tab" aria-controls="pills-home" aria-selected="true">Home</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="pills-profile-tab" data-bs-toggle="pill" data-bs-target="#pills-profile" type="button" role="tab" aria-controls="pills-profile" aria-selected="false">Profile</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="pills-contact-tab" data-bs-toggle="pill" data-bs-target="#pills-contact" type="button" role="tab" aria-controls="pills-contact" aria-selected="false">Contact</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="pills-disabled-tab" data-bs-toggle="pill" data-bs-target="#pills-disabled" type="button" role="tab" aria-controls="pills-disabled" aria-selected="false" disabled>Disabled</button>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" id="pills-tabContent">
|
||||
<div class="tab-pane fade show active" id="pills-home" role="tabpanel" aria-labelledby="pills-home-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Home tab’s</strong> associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other <code>.nav</code>-powered navigation.</p>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="pills-profile" role="tabpanel" aria-labelledby="pills-profile-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Profile tab’s</strong> associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other <code>.nav</code>-powered navigation.</p>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="pills-contact" role="tabpanel" aria-labelledby="pills-contact-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Contact tab’s</strong> associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other <code>.nav</code>-powered navigation.</p>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="pills-disabled" role="tabpanel" aria-labelledby="pills-disabled-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Disabled tab’s</strong> associated content.</p>
|
||||
</div>
|
||||
</div>
|
||||
`} />
|
||||
|
||||
```html
|
||||
<ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
|
||||
@@ -481,34 +481,34 @@ The tabs plugin also works with pills.
|
||||
|
||||
And with vertical pills. Ideally, for vertical tabs, you should also add `aria-orientation="vertical"` to the tab list container.
|
||||
|
||||
<div class="bd-example">
|
||||
<div class="d-flex align-items-start">
|
||||
<div class="nav flex-column nav-pills me-3" id="v-pills-tab" role="tablist" aria-orientation="vertical">
|
||||
<button class="nav-link active" id="v-pills-home-tab" data-bs-toggle="pill" data-bs-target="#v-pills-home" type="button" role="tab" aria-controls="v-pills-home" aria-selected="true">Home</button>
|
||||
<button class="nav-link" id="v-pills-profile-tab" data-bs-toggle="pill" data-bs-target="#v-pills-profile" type="button" role="tab" aria-controls="v-pills-profile" aria-selected="false">Profile</button>
|
||||
<button class="nav-link" id="v-pills-disabled-tab" data-bs-toggle="pill" data-bs-target="#v-pills-disabled" type="button" role="tab" aria-controls="v-pills-disabled" aria-selected="false" disabled>Disabled</button>
|
||||
<button class="nav-link" id="v-pills-messages-tab" data-bs-toggle="pill" data-bs-target="#v-pills-messages" type="button" role="tab" aria-controls="v-pills-messages" aria-selected="false">Messages</button>
|
||||
<button class="nav-link" id="v-pills-settings-tab" data-bs-toggle="pill" data-bs-target="#v-pills-settings" type="button" role="tab" aria-controls="v-pills-settings" aria-selected="false">Settings</button>
|
||||
<Example showMarkup={false} code={`
|
||||
<div class="d-flex align-items-start">
|
||||
<div class="nav flex-column nav-pills me-3" id="v-pills-tab" role="tablist" aria-orientation="vertical">
|
||||
<button class="nav-link active" id="v-pills-home-tab" data-bs-toggle="pill" data-bs-target="#v-pills-home" type="button" role="tab" aria-controls="v-pills-home" aria-selected="true">Home</button>
|
||||
<button class="nav-link" id="v-pills-profile-tab" data-bs-toggle="pill" data-bs-target="#v-pills-profile" type="button" role="tab" aria-controls="v-pills-profile" aria-selected="false">Profile</button>
|
||||
<button class="nav-link" id="v-pills-disabled-tab" data-bs-toggle="pill" data-bs-target="#v-pills-disabled" type="button" role="tab" aria-controls="v-pills-disabled" aria-selected="false" disabled>Disabled</button>
|
||||
<button class="nav-link" id="v-pills-messages-tab" data-bs-toggle="pill" data-bs-target="#v-pills-messages" type="button" role="tab" aria-controls="v-pills-messages" aria-selected="false">Messages</button>
|
||||
<button class="nav-link" id="v-pills-settings-tab" data-bs-toggle="pill" data-bs-target="#v-pills-settings" type="button" role="tab" aria-controls="v-pills-settings" aria-selected="false">Settings</button>
|
||||
</div>
|
||||
<div class="tab-content" id="v-pills-tabContent">
|
||||
<div class="tab-pane fade show active" id="v-pills-home" role="tabpanel" aria-labelledby="v-pills-home-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Home tab’s</strong> associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other <code>.nav</code>-powered navigation.</p>
|
||||
</div>
|
||||
<div class="tab-content" id="v-pills-tabContent">
|
||||
<div class="tab-pane fade show active" id="v-pills-home" role="tabpanel" aria-labelledby="v-pills-home-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Home tab’s</strong> associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other <code>.nav</code>-powered navigation.</p>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="v-pills-profile" role="tabpanel" aria-labelledby="v-pills-profile-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Profile tab’s</strong> associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other <code>.nav</code>-powered navigation.</p>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="v-pills-disabled" role="tabpanel" aria-labelledby="v-pills-disabled-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Disabled tab’s</strong> associated content.</p>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="v-pills-messages" role="tabpanel" aria-labelledby="v-pills-messages-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Messages tab’s</strong> associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other <code>.nav</code>-powered navigation.</p>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="v-pills-settings" role="tabpanel" aria-labelledby="v-pills-settings-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Settings tab’s</strong> associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other <code>.nav</code>-powered navigation.</p>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="v-pills-profile" role="tabpanel" aria-labelledby="v-pills-profile-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Profile tab’s</strong> associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other <code>.nav</code>-powered navigation.</p>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="v-pills-disabled" role="tabpanel" aria-labelledby="v-pills-disabled-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Disabled tab’s</strong> associated content.</p>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="v-pills-messages" role="tabpanel" aria-labelledby="v-pills-messages-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Messages tab’s</strong> associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other <code>.nav</code>-powered navigation.</p>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="v-pills-settings" role="tabpanel" aria-labelledby="v-pills-settings-tab" tabindex="0">
|
||||
<p>This is some placeholder content the <strong>Settings tab’s</strong> associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other <code>.nav</code>-powered navigation.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`} />
|
||||
|
||||
```html
|
||||
<div class="d-flex align-items-start">
|
||||
|
||||
@@ -94,66 +94,66 @@ Scroll the area below the navbar and watch the active class change. Open the dro
|
||||
|
||||
Scrollspy also works with nested `.nav`s. If a nested `.nav` is `.active`, its parents will also be `.active`. Scroll the area next to the navbar and watch the active class change.
|
||||
|
||||
<div class="bd-example">
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<nav id="navbar-example3" class="h-100 flex-column align-items-stretch pe-4 border-end">
|
||||
<Example showMarkup={false} code={`
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<nav id="navbar-example3" class="h-100 flex-column align-items-stretch pe-4 border-end">
|
||||
<nav class="nav nav-pills flex-column">
|
||||
<a class="nav-link" href="#item-1">Item 1</a>
|
||||
<nav class="nav nav-pills flex-column">
|
||||
<a class="nav-link" href="#item-1">Item 1</a>
|
||||
<nav class="nav nav-pills flex-column">
|
||||
<a class="nav-link ms-3 my-1" href="#item-1-1">Item 1-1</a>
|
||||
<a class="nav-link ms-3 my-1" href="#item-1-2">Item 1-2</a>
|
||||
</nav>
|
||||
<a class="nav-link" href="#item-2">Item 2</a>
|
||||
<a class="nav-link" href="#item-3">Item 3</a>
|
||||
<nav class="nav nav-pills flex-column">
|
||||
<a class="nav-link ms-3 my-1" href="#item-3-1">Item 3-1</a>
|
||||
<a class="nav-link ms-3 my-1" href="#item-3-2">Item 3-2</a>
|
||||
</nav>
|
||||
<a class="nav-link ms-3 my-1" href="#item-1-1">Item 1-1</a>
|
||||
<a class="nav-link ms-3 my-1" href="#item-1-2">Item 1-2</a>
|
||||
</nav>
|
||||
<a class="nav-link" href="#item-2">Item 2</a>
|
||||
<a class="nav-link" href="#item-3">Item 3</a>
|
||||
<nav class="nav nav-pills flex-column">
|
||||
<a class="nav-link ms-3 my-1" href="#item-3-1">Item 3-1</a>
|
||||
<a class="nav-link ms-3 my-1" href="#item-3-2">Item 3-2</a>
|
||||
</nav>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<div data-bs-spy="scroll" data-bs-target="#navbar-example3" data-bs-smooth-scroll="true" class="scrollspy-example-2" tabindex="0">
|
||||
<div id="item-1">
|
||||
<h4>Item 1</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<p>Keep in mind that the JavaScript plugin tries to pick the right element among all that may be visible. Multiple visible scrollspy targets at the same time may cause some issues.</p>
|
||||
</div>
|
||||
<div id="item-1-1">
|
||||
<h5>Item 1-1</h5>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<p>Keep in mind that the JavaScript plugin tries to pick the right element among all that may be visible. Multiple visible scrollspy targets at the same time may cause some issues.</p>
|
||||
</div>
|
||||
<div id="item-1-2">
|
||||
<h5>Item 1-2</h5>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<p>Keep in mind that the JavaScript plugin tries to pick the right element among all that may be visible. Multiple visible scrollspy targets at the same time may cause some issues.</p>
|
||||
</div>
|
||||
<div id="item-2">
|
||||
<h4>Item 2</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<p>Keep in mind that the JavaScript plugin tries to pick the right element among all that may be visible. Multiple visible scrollspy targets at the same time may cause some issues.</p>
|
||||
</div>
|
||||
<div id="item-3">
|
||||
<h4>Item 3</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<p>Keep in mind that the JavaScript plugin tries to pick the right element among all that may be visible. Multiple visible scrollspy targets at the same time may cause some issues.</p>
|
||||
</div>
|
||||
<div id="item-3-1">
|
||||
<h5>Item 3-1</h5>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<p>Keep in mind that the JavaScript plugin tries to pick the right element among all that may be visible. Multiple visible scrollspy targets at the same time may cause some issues.</p>
|
||||
</div>
|
||||
<div id="item-3-2">
|
||||
<h5>Item 3-2</h5>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<p>Keep in mind that the JavaScript plugin tries to pick the right element among all that may be visible. Multiple visible scrollspy targets at the same time may cause some issues.</p>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<div data-bs-spy="scroll" data-bs-target="#navbar-example3" data-bs-smooth-scroll="true" class="scrollspy-example-2" tabindex="0">
|
||||
<div id="item-1">
|
||||
<h4>Item 1</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<p>Keep in mind that the JavaScript plugin tries to pick the right element among all that may be visible. Multiple visible scrollspy targets at the same time may cause some issues.</p>
|
||||
</div>
|
||||
<div id="item-1-1">
|
||||
<h5>Item 1-1</h5>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<p>Keep in mind that the JavaScript plugin tries to pick the right element among all that may be visible. Multiple visible scrollspy targets at the same time may cause some issues.</p>
|
||||
</div>
|
||||
<div id="item-1-2">
|
||||
<h5>Item 1-2</h5>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<p>Keep in mind that the JavaScript plugin tries to pick the right element among all that may be visible. Multiple visible scrollspy targets at the same time may cause some issues.</p>
|
||||
</div>
|
||||
<div id="item-2">
|
||||
<h4>Item 2</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<p>Keep in mind that the JavaScript plugin tries to pick the right element among all that may be visible. Multiple visible scrollspy targets at the same time may cause some issues.</p>
|
||||
</div>
|
||||
<div id="item-3">
|
||||
<h4>Item 3</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<p>Keep in mind that the JavaScript plugin tries to pick the right element among all that may be visible. Multiple visible scrollspy targets at the same time may cause some issues.</p>
|
||||
</div>
|
||||
<div id="item-3-1">
|
||||
<h5>Item 3-1</h5>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<p>Keep in mind that the JavaScript plugin tries to pick the right element among all that may be visible. Multiple visible scrollspy targets at the same time may cause some issues.</p>
|
||||
</div>
|
||||
<div id="item-3-2">
|
||||
<h5>Item 3-2</h5>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<p>Keep in mind that the JavaScript plugin tries to pick the right element among all that may be visible. Multiple visible scrollspy targets at the same time may cause some issues.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`} />
|
||||
|
||||
```html
|
||||
<div class="row">
|
||||
@@ -214,30 +214,30 @@ Scrollspy also works with nested `.nav`s. If a nested `.nav` is `.active`, its p
|
||||
|
||||
Scrollspy also works with `.list-group`s. Scroll the area next to the list group and watch the active class change.
|
||||
|
||||
<div class="bd-example">
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<div id="list-example" class="list-group">
|
||||
<a class="list-group-item list-group-item-action" href="#list-item-1">Item 1</a>
|
||||
<a class="list-group-item list-group-item-action" href="#list-item-2">Item 2</a>
|
||||
<a class="list-group-item list-group-item-action" href="#list-item-3">Item 3</a>
|
||||
<a class="list-group-item list-group-item-action" href="#list-item-4">Item 4</a>
|
||||
</div>
|
||||
<Example showMarkup={false} code={`
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<div id="list-example" class="list-group">
|
||||
<a class="list-group-item list-group-item-action" href="#list-item-1">Item 1</a>
|
||||
<a class="list-group-item list-group-item-action" href="#list-item-2">Item 2</a>
|
||||
<a class="list-group-item list-group-item-action" href="#list-item-3">Item 3</a>
|
||||
<a class="list-group-item list-group-item-action" href="#list-item-4">Item 4</a>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<div data-bs-spy="scroll" data-bs-target="#list-example" data-bs-smooth-scroll="true" class="scrollspy-example" tabindex="0">
|
||||
<h4 id="list-item-1">Item 1</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<h4 id="list-item-2">Item 2</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<h4 id="list-item-3">Item 3</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<h4 id="list-item-4">Item 4</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<div data-bs-spy="scroll" data-bs-target="#list-example" data-bs-smooth-scroll="true" class="scrollspy-example" tabindex="0">
|
||||
<h4 id="list-item-1">Item 1</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<h4 id="list-item-2">Item 2</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<h4 id="list-item-3">Item 3</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<h4 id="list-item-4">Item 4</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`} />
|
||||
|
||||
```html
|
||||
<div class="row">
|
||||
@@ -268,33 +268,33 @@ Scrollspy also works with `.list-group`s. Scroll the area next to the list group
|
||||
|
||||
Scrollspy is not limited to nav components and list groups, so it will work on any `<a>` anchor elements in the current document. Scroll the area and watch the `.active` class change.
|
||||
|
||||
<div class="bd-example">
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<div id="simple-list-example" class="d-flex flex-column gap-2 simple-list-example-scrollspy text-center">
|
||||
<a class="p-1 rounded" href="#simple-list-item-1">Item 1</a>
|
||||
<a class="p-1 rounded" href="#simple-list-item-2">Item 2</a>
|
||||
<a class="p-1 rounded" href="#simple-list-item-3">Item 3</a>
|
||||
<a class="p-1 rounded" href="#simple-list-item-4">Item 4</a>
|
||||
<a class="p-1 rounded" href="#simple-list-item-5">Item 5</a>
|
||||
</div>
|
||||
<Example showMarkup={false} code={`
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<div id="simple-list-example" class="d-flex flex-column gap-2 simple-list-example-scrollspy text-center">
|
||||
<a class="p-1 rounded" href="#simple-list-item-1">Item 1</a>
|
||||
<a class="p-1 rounded" href="#simple-list-item-2">Item 2</a>
|
||||
<a class="p-1 rounded" href="#simple-list-item-3">Item 3</a>
|
||||
<a class="p-1 rounded" href="#simple-list-item-4">Item 4</a>
|
||||
<a class="p-1 rounded" href="#simple-list-item-5">Item 5</a>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<div data-bs-spy="scroll" data-bs-target="#simple-list-example" data-bs-offset="0" data-bs-smooth-scroll="true" class="scrollspy-example" tabindex="0">
|
||||
<h4 id="simple-list-item-1">Item 1</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<h4 id="simple-list-item-2">Item 2</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<h4 id="simple-list-item-3">Item 3</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<h4 id="simple-list-item-4">Item 4</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<h4 id="simple-list-item-5">Item 5</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<div data-bs-spy="scroll" data-bs-target="#simple-list-example" data-bs-offset="0" data-bs-smooth-scroll="true" class="scrollspy-example" tabindex="0">
|
||||
<h4 id="simple-list-item-1">Item 1</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<h4 id="simple-list-item-2">Item 2</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<h4 id="simple-list-item-3">Item 3</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<h4 id="simple-list-item-4">Item 4</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
<h4 id="simple-list-item-5">Item 5</h4>
|
||||
<p>This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It’s repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`} />
|
||||
|
||||
```html
|
||||
<div class="row">
|
||||
|
||||
@@ -57,9 +57,9 @@ Click the button below to show a toast (positioned with our utilities in the low
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bd-example">
|
||||
<button type="button" class="btn btn-primary" id="liveToastBtn">Show live toast</button>
|
||||
</div>
|
||||
<Example showMarkup={false} code={`
|
||||
<button type="button" class="btn btn-primary" id="liveToastBtn">Show live toast</button>
|
||||
`} />
|
||||
|
||||
```html
|
||||
<button type="button" class="btn btn-primary" id="liveToastBtn">Show live toast</button>
|
||||
|
||||
@@ -147,17 +147,17 @@ All lists—`<ul>`, `<ol>`, and `<dl>`—have their `margin-top` removed and a `
|
||||
|
||||
For simpler styling, clear hierarchy, and better spacing, description lists have updated `margin`s. `<dd>`s reset `margin-left` to `0` and add `margin-bottom: .5rem`. `<dt>`s are **bolded**.
|
||||
|
||||
<div class="bd-example">
|
||||
<dl>
|
||||
<dt>Description lists</dt>
|
||||
<dd>A description list is perfect for defining terms.</dd>
|
||||
<dt>Term</dt>
|
||||
<dd>Definition for the term.</dd>
|
||||
<dd>A second definition for the same term.</dd>
|
||||
<dt>Another term</dt>
|
||||
<dd>Definition for this other term.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<Example showMarkup={false} code={`
|
||||
<dl>
|
||||
<dt>Description lists</dt>
|
||||
<dd>A description list is perfect for defining terms.</dd>
|
||||
<dt>Term</dt>
|
||||
<dd>Definition for the term.</dd>
|
||||
<dd>A second definition for the same term.</dd>
|
||||
<dt>Another term</dt>
|
||||
<dd>Definition for this other term.</dd>
|
||||
</dl>
|
||||
`} />
|
||||
|
||||
## Inline code
|
||||
|
||||
@@ -408,25 +408,25 @@ The default `margin` on blockquotes is `1em 40px`, so we reset that to `0 0 1rem
|
||||
|
||||
The `<abbr>` element receives basic styling to make it stand out amongst paragraph text.
|
||||
|
||||
<div class="bd-example">
|
||||
The <abbr title="HyperText Markup Language">HTML</abbr> abbreviation element.
|
||||
</div>
|
||||
<Example showMarkup={false} code={`
|
||||
The <abbr title="HyperText Markup Language">HTML</abbr> abbreviation element.
|
||||
`} />
|
||||
|
||||
### Summary
|
||||
|
||||
The default `cursor` on summary is `text`, so we reset that to `pointer` to convey that the element can be interacted with by clicking on it.
|
||||
|
||||
<div class="bd-example">
|
||||
<details>
|
||||
<summary>Some details</summary>
|
||||
<p>More info about the details.</p>
|
||||
</details>
|
||||
<Example showMarkup={false} code={`
|
||||
<details>
|
||||
<summary>Some details</summary>
|
||||
<p>More info about the details.</p>
|
||||
</details>
|
||||
|
||||
<details open>
|
||||
<summary>Even more details</summary>
|
||||
<p>Here are even more details about the details.</p>
|
||||
</details>
|
||||
</div>
|
||||
<details open>
|
||||
<summary>Even more details</summary>
|
||||
<p>Here are even more details about the details.</p>
|
||||
</details>
|
||||
`} />
|
||||
|
||||
## HTML5 `[hidden]` attribute
|
||||
|
||||
|
||||
@@ -105,38 +105,38 @@ These hoverable rows can also be combined with the striped rows variant:
|
||||
|
||||
Highlight a table row or cell by adding a `.table-active` class.
|
||||
|
||||
<div class="bd-example">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">#</th>
|
||||
<th scope="col">First</th>
|
||||
<th scope="col">Last</th>
|
||||
<th scope="col">Handle</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="table-active">
|
||||
<th scope="row">1</th>
|
||||
<td>Mark</td>
|
||||
<td>Otto</td>
|
||||
<td>@mdo</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">2</th>
|
||||
<td>Jacob</td>
|
||||
<td>Thornton</td>
|
||||
<td>@fat</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">3</th>
|
||||
<td>John</td>
|
||||
<td>Doe</td>
|
||||
<td class="table-active">@social</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<Example showMarkup={false} code={`
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">#</th>
|
||||
<th scope="col">First</th>
|
||||
<th scope="col">Last</th>
|
||||
<th scope="col">Handle</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="table-active">
|
||||
<th scope="row">1</th>
|
||||
<td>Mark</td>
|
||||
<td>Otto</td>
|
||||
<td>@mdo</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">2</th>
|
||||
<td>Jacob</td>
|
||||
<td>Thornton</td>
|
||||
<td>@fat</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">3</th>
|
||||
<td>John</td>
|
||||
<td>Doe</td>
|
||||
<td class="table-active">@social</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
`} />
|
||||
|
||||
```html
|
||||
<table class="table">
|
||||
@@ -160,38 +160,38 @@ Highlight a table row or cell by adding a `.table-active` class.
|
||||
</table>
|
||||
```
|
||||
|
||||
<div class="bd-example">
|
||||
<table class="table table-dark">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">#</th>
|
||||
<th scope="col">First</th>
|
||||
<th scope="col">Last</th>
|
||||
<th scope="col">Handle</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="table-active">
|
||||
<th scope="row">1</th>
|
||||
<td>Mark</td>
|
||||
<td>Otto</td>
|
||||
<td>@mdo</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">2</th>
|
||||
<td>Jacob</td>
|
||||
<td>Thornton</td>
|
||||
<td>@fat</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">3</th>
|
||||
<td>John</td>
|
||||
<td>Doe</td>
|
||||
<td class="table-active">@social</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<Example showMarkup={false} code={`
|
||||
<table class="table table-dark">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">#</th>
|
||||
<th scope="col">First</th>
|
||||
<th scope="col">Last</th>
|
||||
<th scope="col">Handle</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="table-active">
|
||||
<th scope="row">1</th>
|
||||
<td>Mark</td>
|
||||
<td>Otto</td>
|
||||
<td>@mdo</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">2</th>
|
||||
<td>Jacob</td>
|
||||
<td>Thornton</td>
|
||||
<td>@fat</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">3</th>
|
||||
<td>John</td>
|
||||
<td>Doe</td>
|
||||
<td class="table-active">@social</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
`} />
|
||||
|
||||
```html
|
||||
<table class="table table-dark">
|
||||
@@ -296,40 +296,40 @@ Add a thicker border, darker between table groups—`<thead>`, `<tbody>`, and `<
|
||||
|
||||
Table cells of `<thead>` are always vertical aligned to the bottom. Table cells in `<tbody>` inherit their alignment from `<table>` and are aligned to the top by default. Use the [vertical align]([[docsref:/utilities/vertical-align]]) classes to re-align where needed.
|
||||
|
||||
<div class="bd-example">
|
||||
<div class="table-responsive">
|
||||
<table class="table align-middle">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="w-25">Heading 1</th>
|
||||
<th scope="col" class="w-25">Heading 2</th>
|
||||
<th scope="col" class="w-25">Heading 3</th>
|
||||
<th scope="col" class="w-25">Heading 4</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>This cell inherits <code>vertical-align: middle;</code> from the table</td>
|
||||
<td>This cell inherits <code>vertical-align: middle;</code> from the table</td>
|
||||
<td>This cell inherits <code>vertical-align: middle;</code> from the table</td>
|
||||
<td>This here is some placeholder text, intended to take up quite a bit of vertical space, to demonstrate how the vertical alignment works in the preceding cells.</td>
|
||||
</tr>
|
||||
<tr class="align-bottom">
|
||||
<td>This cell inherits <code>vertical-align: bottom;</code> from the table row</td>
|
||||
<td>This cell inherits <code>vertical-align: bottom;</code> from the table row</td>
|
||||
<td>This cell inherits <code>vertical-align: bottom;</code> from the table row</td>
|
||||
<td>This here is some placeholder text, intended to take up quite a bit of vertical space, to demonstrate how the vertical alignment works in the preceding cells.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>This cell inherits <code>vertical-align: middle;</code> from the table</td>
|
||||
<td>This cell inherits <code>vertical-align: middle;</code> from the table</td>
|
||||
<td class="align-top">This cell is aligned to the top.</td>
|
||||
<td>This here is some placeholder text, intended to take up quite a bit of vertical space, to demonstrate how the vertical alignment works in the preceding cells.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<Example showMarkup={false} code={`
|
||||
<div class="table-responsive">
|
||||
<table class="table align-middle">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="w-25">Heading 1</th>
|
||||
<th scope="col" class="w-25">Heading 2</th>
|
||||
<th scope="col" class="w-25">Heading 3</th>
|
||||
<th scope="col" class="w-25">Heading 4</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>This cell inherits <code>vertical-align: middle;</code> from the table</td>
|
||||
<td>This cell inherits <code>vertical-align: middle;</code> from the table</td>
|
||||
<td>This cell inherits <code>vertical-align: middle;</code> from the table</td>
|
||||
<td>This here is some placeholder text, intended to take up quite a bit of vertical space, to demonstrate how the vertical alignment works in the preceding cells.</td>
|
||||
</tr>
|
||||
<tr class="align-bottom">
|
||||
<td>This cell inherits <code>vertical-align: bottom;</code> from the table row</td>
|
||||
<td>This cell inherits <code>vertical-align: bottom;</code> from the table row</td>
|
||||
<td>This cell inherits <code>vertical-align: bottom;</code> from the table row</td>
|
||||
<td>This here is some placeholder text, intended to take up quite a bit of vertical space, to demonstrate how the vertical alignment works in the preceding cells.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>This cell inherits <code>vertical-align: middle;</code> from the table</td>
|
||||
<td>This cell inherits <code>vertical-align: middle;</code> from the table</td>
|
||||
<td class="align-top">This cell is aligned to the top.</td>
|
||||
<td>This here is some placeholder text, intended to take up quite a bit of vertical space, to demonstrate how the vertical alignment works in the preceding cells.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
`} />
|
||||
|
||||
```html
|
||||
<div class="table-responsive">
|
||||
@@ -361,7 +361,7 @@ Table cells of `<thead>` are always vertical aligned to the bottom. Table cells
|
||||
|
||||
Border styles, active styles, and table variants are not inherited by nested tables.
|
||||
|
||||
<div class="bd-example">
|
||||
<Example showMarkup={false} code={`
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -416,7 +416,7 @@ Border styles, active styles, and table variants are not inherited by nested tab
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
`} />
|
||||
|
||||
```html
|
||||
<table class="table table-striped table-bordered">
|
||||
@@ -449,7 +449,7 @@ Note that if you add `<tr>`s as direct children of a table, those `<tr>` will be
|
||||
|
||||
Similar to tables and dark tables, use the modifier classes `.table-light` or `.table-dark` to make `<thead>`s appear light or dark gray.
|
||||
|
||||
<div class="bd-example">
|
||||
<Example showMarkup={false} code={`
|
||||
<table class="table">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
@@ -480,7 +480,7 @@ Similar to tables and dark tables, use the modifier classes `.table-light` or `.
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
`} />
|
||||
|
||||
```html
|
||||
<table class="table">
|
||||
@@ -493,7 +493,7 @@ Similar to tables and dark tables, use the modifier classes `.table-light` or `.
|
||||
</table>
|
||||
```
|
||||
|
||||
<div class="bd-example">
|
||||
<Example showMarkup={false} code={`
|
||||
<table class="table">
|
||||
<thead class="table-dark">
|
||||
<tr>
|
||||
@@ -524,7 +524,7 @@ Similar to tables and dark tables, use the modifier classes `.table-light` or `.
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
`} />
|
||||
|
||||
```html
|
||||
<table class="table">
|
||||
@@ -539,7 +539,7 @@ Similar to tables and dark tables, use the modifier classes `.table-light` or `.
|
||||
|
||||
### Table foot
|
||||
|
||||
<div class="bd-example">
|
||||
<Example showMarkup={false} code={`
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -578,7 +578,7 @@ Similar to tables and dark tables, use the modifier classes `.table-light` or `.
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
`} />
|
||||
|
||||
```html
|
||||
<table class="table">
|
||||
@@ -665,64 +665,64 @@ Responsive tables make use of `overflow-y: hidden`, which clips off any content
|
||||
|
||||
Across every breakpoint, use `.table-responsive` for horizontally scrolling tables.
|
||||
|
||||
<div class="bd-example">
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">#</th>
|
||||
<th scope="col">Heading</th>
|
||||
<th scope="col">Heading</th>
|
||||
<th scope="col">Heading</th>
|
||||
<th scope="col">Heading</th>
|
||||
<th scope="col">Heading</th>
|
||||
<th scope="col">Heading</th>
|
||||
<th scope="col">Heading</th>
|
||||
<th scope="col">Heading</th>
|
||||
<th scope="col">Heading</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">1</th>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">2</th>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">3</th>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<Example showMarkup={false} code={`
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">#</th>
|
||||
<th scope="col">Heading</th>
|
||||
<th scope="col">Heading</th>
|
||||
<th scope="col">Heading</th>
|
||||
<th scope="col">Heading</th>
|
||||
<th scope="col">Heading</th>
|
||||
<th scope="col">Heading</th>
|
||||
<th scope="col">Heading</th>
|
||||
<th scope="col">Heading</th>
|
||||
<th scope="col">Heading</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">1</th>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">2</th>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">3</th>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
<td>Cell</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
`} />
|
||||
|
||||
```html
|
||||
<div class="table-responsive">
|
||||
|
||||
@@ -62,14 +62,14 @@ 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.
|
||||
|
||||
<div class="bd-example">
|
||||
<div class="display-1 pb-3 mb-3 border-bottom">Display 1</div>
|
||||
<div class="display-2 pb-3 mb-3 border-bottom">Display 2</div>
|
||||
<div class="display-3 pb-3 mb-3 border-bottom">Display 3</div>
|
||||
<div class="display-4 pb-3 mb-3 border-bottom">Display 4</div>
|
||||
<div class="display-5 pb-3 mb-3 border-bottom">Display 5</div>
|
||||
<div class="display-6">Display 6</div>
|
||||
</div>
|
||||
<Example showMarkup={false} code={`
|
||||
<div class="display-1 pb-3 mb-3 border-bottom">Display 1</div>
|
||||
<div class="display-2 pb-3 mb-3 border-bottom">Display 2</div>
|
||||
<div class="display-3 pb-3 mb-3 border-bottom">Display 3</div>
|
||||
<div class="display-4 pb-3 mb-3 border-bottom">Display 4</div>
|
||||
<div class="display-5 pb-3 mb-3 border-bottom">Display 5</div>
|
||||
<div class="display-6">Display 6</div>
|
||||
`} />
|
||||
|
||||
```html
|
||||
<h1 class="display-1">Display 1</h1>
|
||||
|
||||
@@ -38,11 +38,11 @@ For more information and examples on how to modify our Sass maps and variables,
|
||||
|
||||
We encourage you to adopt these guidelines when building with Bootstrap to create your own components. We’ve extended this approach ourselves to the custom components in our documentation and examples. Components like our callouts are built just like our provided components with base and modifier classes.
|
||||
|
||||
<div class="bd-example">
|
||||
<div class="bd-callout my-0">
|
||||
<strong>This is a callout.</strong> We built it custom for our docs so our messages to you stand out. It has three variants via modifier classes.
|
||||
</div>
|
||||
<Example showMarkup={false} code={`
|
||||
<div class="bd-callout my-0">
|
||||
<strong>This is a callout.</strong> We built it custom for our docs so our messages to you stand out. It has three variants via modifier classes.
|
||||
</div>
|
||||
`} />
|
||||
|
||||
```html
|
||||
<div class="callout">...</div>
|
||||
|
||||
@@ -34,9 +34,7 @@ robots: noindex,follow
|
||||
}
|
||||
```
|
||||
|
||||
<div class="bd-example">
|
||||
The <abbr title="HyperText Markup Language">HTML</abbr> abbreviation element.
|
||||
</div>
|
||||
<Example showMarkup={false} code={`The <abbr title="HyperText Markup Language">HTML</abbr> abbreviation element.`} />
|
||||
|
||||
<Example code={`<div class="test">This is a test.</div>`} />
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ Running our documentation locally requires the use of Astro. Astro is a modern s
|
||||
|
||||
1. Run through the [tooling setup](#tooling-setup) above to install all dependencies.
|
||||
2. From the root `/bootstrap` directory, run `npm run docs-serve` in the command line.
|
||||
3. Open `http://localhost:4321/` in your browser, and voilà.
|
||||
3. Open http://localhost:9001 in your browser, and voilà.
|
||||
|
||||
Learn more about using Astro by reading its [documentation](https://docs.astro.build/en/getting-started/).
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ function bootstrap_auto_import() {
|
||||
const autoImportedComponentDefinition = `/**
|
||||
* DO NOT EDIT THIS FILE MANUALLY.
|
||||
*
|
||||
* This file is automatically generated by the Boostrap Astro Integration.
|
||||
* This file is automatically generated by the Bootstrap Astro Integration.
|
||||
* It contains the type definitions for the components that are auto imported in all pages.
|
||||
* @see site/src/libs/astro.ts
|
||||
*/
|
||||
|
||||
@@ -25,8 +25,8 @@ export function getVersionedDocsPath(docsPath: string): string {
|
||||
// This is useful to catch typos in docs paths.
|
||||
// Note: this function is only called during a production build.
|
||||
// Note: this could at some point be refactored to use Astro list of generated `routes` accessible in the
|
||||
// `astro:build:done` integration hook. Altho as of 03/14/2023, this is not possible due to the route's data only
|
||||
// containing informations regarding the last page generated page for dynamic routes.
|
||||
// `astro:build:done` integration hook. Although as of 03/14/2023, this is not possible due to the route's data only
|
||||
// containing information regarding the last page generated page for dynamic routes.
|
||||
// @see https://github.com/withastro/astro/issues/5802
|
||||
export function validateVersionedDocsPaths(distUrl: URL) {
|
||||
const { docs_version } = getConfig()
|
||||
|
||||
@@ -215,13 +215,13 @@ export interface PlaceholderOptions {
|
||||
*/
|
||||
markup: 'img' | 'svg'
|
||||
/**
|
||||
* The text to show in the image. You can explicitely pass the `false` boolean value (and not the string "false") to
|
||||
* The text to show in the image. You can explicitly pass the `false` boolean value (and not the string "false") to
|
||||
* hide the text.
|
||||
* @default "${width}x{$height)"
|
||||
*/
|
||||
text: string | false
|
||||
/**
|
||||
* Used in the SVG `title` tag. You can explicitely pass the `false` boolean value (and not the string "false") to
|
||||
* Used in the SVG `title` tag. You can explicitly pass the `false` boolean value (and not the string "false") to
|
||||
* hide the title.
|
||||
* @default "Placeholder"
|
||||
*/
|
||||
|
||||
@@ -56,7 +56,7 @@ export const remarkBsConfig: Plugin<[], Root> = function () {
|
||||
}
|
||||
}
|
||||
|
||||
// A remark plugin to add versionned docs links in markdown (or MDX) files.
|
||||
// A remark plugin to add versioned docs links in markdown (or MDX) files.
|
||||
// For example, [[docsref:/foo]] will be replaced with the `/docs/${docs_version}/foo` value with the `docs_version`
|
||||
// value being read from the `config.yml` file.
|
||||
// Note: this also works in frontmatter.
|
||||
|
||||
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* DO NOT EDIT THIS FILE MANUALLY.
|
||||
*
|
||||
* This file is automatically generated by the Boostrap Astro Integration.
|
||||
* This file is automatically generated by the Bootstrap Astro Integration.
|
||||
* It contains the type definitions for the components that are auto imported in all pages.
|
||||
* @see site/src/libs/astro.ts
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user