0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-03-12 12:29:22 +01:00

47 lines
54 KiB
HTML
Raw Normal View History

2025-03-08 09:31:15 +01:00
<!DOCTYPE html><html lang="en" data-bs-theme="auto"> <head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="description" content="Learn how to theme, customize, and extend Bootstrap with Sass, a boatload of global options, an expansive color system, and more."><meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors"><meta name="generator" content="Astro v5.4.2"><meta name="docsearch:language" content="en"><meta name="docsearch:version" content="5.3"><link rel="canonical" href="https://getbootstrap.com/docs/5.3/customize/overview/"><link rel="preconnect" href="https://AK7KMZKZHQ-dsn.algolia.net" crossorigin><title>Customize · Bootstrap v5.3</title><script src="/docs/5.3/assets/js/color-modes.js"></script><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3"><link href="/docs/5.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH"><link rel="apple-touch-icon" href="/docs/5.3/assets/img/favicons/apple-touch-icon.png" sizes="180x180"><link rel="icon" href="/docs/5.3/assets/img/favicons/favicon-32x32.png" sizes="32x32" type="image/png"><link rel="icon" href="/docs/5.3/assets/img/favicons/favicon-16x16.png" sizes="16x16" type="image/png"><link rel="manifest" href="/docs/5.3/assets/img/favicons/manifest.json"><link rel="mask-icon" href="/docs/5.3/assets/img/favicons/safari-pinned-tab.svg" color="#712cf9"><link rel="icon" href="/docs/5.3/assets/img/favicons/favicon.ico"><meta name="theme-color" content="#712cf9"><meta name="twitter:card" content="summary_large_image"><meta name="twitter:site" content="getbootstrap"><meta name="twitter:creator" content="getbootstrap"><meta name="twitter:title" content="Customize"><meta name="twitter:description" content="Learn how to theme, customize, and extend Bootstrap with Sass, a boatload of global options, an expansive color system, and more."><meta name="twitter:image" content="https://getbootstrap.com/docs/5.3/assets/brand/bootstrap-social.png"><meta property="og:url" content="https://getbootstrap.com/docs/5.3/customize/overview/"><meta property="og:title" content="Customize"><meta property="og:description" content="Learn how to theme, customize, and extend Bootstrap with Sass, a boatload of global options, an expansive color system, and more."><meta property="og:type" content="article"><meta property="og:image" content="https://getbootstrap.com/docs/5.3/assets/brand/bootstrap-social.png"><meta property="og:image:type" content="image/png"><meta property="og:image:width" content="2000"><meta property="og:image:height" content="1000"><script defer src="https://cdn.usefathom.com/script.js" data-site="ITUSEYJG"></script><link rel="stylesheet" href="/_astro/_slug_.BBRoHHoO.css"></head> <body tabindex="0"> <div class="skippy visually-hidden-focusable overflow-hidden"> <div class="container-xl"> <a class="d-inline-flex p-2 m-1" href="#content">Skip to main content</a> <a class="d-none d-md-inline-flex p-2 m-1" href="#bd-docs-nav">
Skip to docs navigation
</a> </div> </div> <svg xmlns="http://www.w3.org/2000/svg" class="d-none"> <symbol id="arrow-right" viewBox="0 0 16 16"> <path fill-rule="evenodd" d="M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8z"></path> </symbol> <symbol id="arrow-right-short" viewBox="0 0 16 16"> <path fill-rule="evenodd" d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8"></path> </symbol> <symbol id="book-half" viewBox="0 0 16 16"> <path d="M8.5 2.687c.654-.689 1.782-.886 3.112-.752 1.234.124 2.503.523 3.388.893v9.923c-.918-.35-2.107-.692-3.287-.81-1.094-.111-2.278-.039-3.213.492V2.687zM8 1.783C7.015.936 5.587.81 4.287.94c-1.514.153-3.042.672-3.994 1.105A.5.5 0 0 0 0 2.5v11a.5.5 0 0 0 .707.455c.882-.4 2.303-.881 3.68-1.02 1.409-.142 2.59.087 3.223.877a.5.5 0 0 0 .78 0c.633-.79 1.814-1.019 3.222-.877 1.378.139 2.8.62 3.681 1.02A.5.5 0 0 0 16 13.5v-11a.5.5 0 0 0-.293-.455c-.952-.433-2.48-.952-3.994-1.105C10.413.809 8.985.936 8 1.783z"></path> </symbol> <symbol id="box-seam" viewBox="0 0 16 16"> <path d="M8.186 1.113a.5.5 0 0 0-.372 0L1.846 3.5l2.404.961L10.404 2l-2.218-.887zm3.564 1.426L5.596 5 8 5.961 14.154 3.5l-2.404-.961zm3.25 1.7-6.5 2.6v7.922l6.5-2.6V4.24zM7.5 14.762V6.838L1 4.239v7.923l6.5 2.6zM7.443.184a1.5 1.5 0 0 1 1.114 0l7.129 2.852A.5.5 0 0 1 16 3.5v8.662a1 1 0 0 1-.629.928l-7.185 2.874a.5.5 0 0 1-.372 0L.63 13.09a1 1 0 0 1-.63-.928V3.5a.5.5 0 0 1 .314-.464L7.443.184z"></path> </symbol> <symbol id="braces" viewBox="0 0 16 16"> <path d="M2.114 8.063V7.9c1.005-.102 1.497-.615 1.497-1.6V4.503c0-1.094.39-1.538 1.354-1.538h.273V2h-.376C3.25 2 2.49 2.759 2.49 4.352v1.524c0 1.094-.376 1.456-1.49 1.456v1.299c1.114 0 1.49.362 1.49 1.456v1.524c0 1.593.759 2.352 2.372 2.352h.376v-.964h-.273c-.964 0-1.354-.444-1.354-1.538V9.663c0-.984-.492-1.497-1.497-1.6zM13.886 7.9v.163c-1.005.103-1.497.616-1.497 1.6v1.798c0 1.094-.39 1.538-1.354 1.538h-.273v.964h.376c1.613 0 2.372-.759 2.372-2.352v-1.524c0-1.094.376-1.456 1.49-1.456V7.332c-1.114 0-1.49-.362-1.49-1.456V4.352C13.51 2.759 12.75 2 11.138 2h-.376v.964h.273c.964 0 1.354.444 1.354 1.538V6.3c0 .984.492 1.497 1.497 1.6z"></path> </symbol> <symbol id="braces-asterisk" viewBox="0 0 16 16"> <path fill-rule="evenodd" d="M1.114 8.063V7.9c1.005-.102 1.497-.615 1.497-1.6V4.503c0-1.094.39-1.538 1.354-1.538h.273V2h-.376C2.25 2 1.49 2.759 1.49 4.352v1.524c0 1.094-.376 1.456-1.49 1.456v1.299c1.114 0 1.49.362 1.49 1.456v1.524c0 1.593.759 2.352 2.372 2.352h.376v-.964h-.273c-.964 0-1.354-.444-1.354-1.538V9.663c0-.984-.492-1.497-1.497-1.6ZM14.886 7.9v.164c-1.005.103-1.497.616-1.497 1.6v1.798c0 1.094-.39 1.538-1.354 1.538h-.273v.964h.376c1.613 0 2.372-.759 2.372-2.352v-1.524c0-1.094.376-1.456 1.49-1.456v-1.3c-1.114 0-1.49-.362-1.49-1.456V4.352C14.51 2.759 13.75 2 12.138 2h-.376v.964h.273c.964 0 1.354.444 1.354 1.538V6.3c0 .984.492 1.497 1.497 1.6ZM7.5 11.5V9.207l-1.621 1.621-.707-.707L6.792 8.5H4.5v-1h2.293L5.172 5.879l.707-.707L7.5 6.792V4.5h1v2.293l1.621-1.621.707.707L9.208 7.5H11.5v1H9.207l1.621 1.621-.707.707L8.5 9.208V11.5h-1Z"></path> </symbol> <symbol id="check2" viewBox="0 0 16 16"> <path d="M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"></path> </symbol> <symbol id="chevron-expand" viewBox="0 0 16 16"> <path fill-rule="evenodd" d="M3.646 9.146a.5.5 0 0 1 .708 0L8 12.793l3.646-3.647a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 0-.708zm0-2.292a.5.5 0 0 0 .708 0L8 3.207l3.646 3.647a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 0 0 0 .708z"></path> </symbol> <symbol id="circle-half" viewBox="0 0 16 16"> <path d="M8 15A7 7 0 1 0 8 1v14zm0 1A8 8 0 1 1 8 0a8 8 0 0 1 0 16z"></path> </symbol> <symbol id="clipboard" viewBox="0 0 16 16"> <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z"></path> <path d="M9.5 1a.5.5 0 0 1 .5.5
Docs
</a> </li> <li class="nav-item col-6 col-lg-auto"> <a class="nav-link py-2 px-0 px-lg-2" href="/docs/5.3/examples/"> Examples </a> </li> <li class="nav-item col-6 col-lg-auto"> <a class="nav-link py-2 px-0 px-lg-2" href="https://icons.getbootstrap.com/" target="_blank" rel="noopener"> Icons </a> </li> <li class="nav-item col-6 col-lg-auto"> <a class="nav-link py-2 px-0 px-lg-2" href="https://themes.getbootstrap.com/" target="_blank" rel="noopener"> Themes </a> </li> <li class="nav-item col-6 col-lg-auto"> <a class="nav-link py-2 px-0 px-lg-2" href="https://blog.getbootstrap.com/" target="_blank" rel="noopener"> Blog </a> </li> </ul> <hr class="d-lg-none text-white-50"> <ul class="navbar-nav flex-row flex-wrap ms-md-auto"> <li class="nav-item col-6 col-lg-auto"> <a class="nav-link py-2 px-0 px-lg-2 nav-link py-2 px-0 px-lg-2" href="https://github.com/twbs" target="_blank" rel="noopener"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 499.36" role="img" class="navbar-nav-svg" height="16" width="16"> <title>GitHub</title> <path fill="currentColor" fill-rule="evenodd" d="M256 0C114.64 0 0 114.61 0 256c0 113.09 73.34 209 175.08 242.9 12.8 2.35 17.47-5.56 17.47-12.34 0-6.08-.22-22.18-.35-43.54-71.2 15.49-86.2-34.34-86.2-34.34-11.64-29.57-28.42-37.45-28.42-37.45-23.27-15.84 1.73-15.55 1.73-15.55 25.69 1.81 39.21 26.38 39.21 26.38 22.84 39.12 59.92 27.82 74.5 21.27 2.33-16.54 8.94-27.82 16.25-34.22-56.84-6.43-116.6-28.43-116.6-126.49 0-27.95 10-50.8 26.35-68.69-2.63-6.48-11.42-32.5 2.51-67.75 0 0 21.49-6.88 70.4 26.24a242.65 242.65 0 0 1 128.18 0c48.87-33.13 70.33-26.24 70.33-26.24 14 35.25 5.18 61.27 2.55 67.75 16.41 17.9 26.31 40.75 26.31 68.69 0 98.35-59.85 120-116.88 126.32 9.19 7.9 17.38 23.53 17.38 47.41 0 34.22-.31 61.83-.31 70.23 0 6.85 4.61 14.81 17.6 12.31C438.72 464.97 512 369.08 512 256.02 512 114.62 397.37 0 256 0z"></path> </svg> <small class="d-lg-none ms-2">GitHub</small> </a> </li> <li class="nav-item col-6 col-lg-auto"> <a class="nav-link py-2 px-0 px-lg-2 nav-link py-2 px-0 px-lg-2" href="https://twitter.com/getbootstrap" target="_blank" rel="noopener"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 416.32" role="img" class="navbar-nav-svg" height="16" width="16"> <title>Twitter</title> <path fill="currentColor" d="M160.83 416.32c193.2 0 298.92-160.22 298.92-298.92 0-4.51 0-9-.2-13.52A214 214 0 0 0 512 49.38a212.93 212.93 0 0 1-60.44 16.6 105.7 105.7 0 0 0 46.3-58.19 209 209 0 0 1-66.79 25.37 105.09 105.09 0 0 0-181.73 71.91 116.12 116.12 0 0 0 2.66 24c-87.28-4.3-164.73-46.3-216.56-109.82A105.48 105.48 0 0 0 68 159.6a106.27 106.27 0 0 1-47.53-13.11v1.43a105.28 105.28 0 0 0 84.21 103.06 105.67 105.67 0 0 1-47.33 1.84 105.06 105.06 0 0 0 98.14 72.94A210.72 210.72 0 0 1 25 370.84a202.17 202.17 0 0 1-25-1.43 298.85 298.85 0 0 0 160.83 46.92"></path> </svg> <small class="d-lg-none ms-2">Twitter</small> </a> </li> <li class="nav-item col-6 col-lg-auto"> <a class="nav-link py-2 px-0 px-lg-2 nav-link py-2 px-0 px-lg-2" href="https://opencollective.com/bootstrap" target="_blank" rel="noopener"> <svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" fill-rule="evenodd" viewBox="0 0 40 41" role="img" class="navbar-nav-svg" height="16" width="16"> <title>Open Collective</title> <path fill-opacity=".4" d="M32.8 21c0 2.4-.8 4.9-2 6.9l5.1 5.1c2.5-3.4 4.1-7.6 4.1-12 0-4.6-1.6-8.8-4-12.2L30.7 14c1.2 2 2 4.3 2 7z"></path> <path d="M20 33.7a12.8 12.8 0 0 1 0-25.6c2.6 0 5 .7 7 2.1L32 5a20 20 0 1 0 .1 31.9l-5-5.2a13 13 0 0 1-7 2z"></path> </svg> <small class="d-lg-none ms-2">Open Collective</small> </a> </li> <li class="nav-item py-2 py-lg-1 col-12 col-lg-auto"> <div class="vr d-none d-lg-flex h-100 mx-lg-2 text-white"></div> <hr class="d-lg-none my-2 text-white-50"> </li> <li class="nav-item dropdown"> <button type="button" class="btn btn-link nav-link py-2 px-0 px-lg-2 dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false" data-bs-display="static"> <span class="d-lg-none" aria-hidden="true">Bootstrap</span><span class="visually-hidden">Bootstrap&nbsp;</span> v5.3 <span class="visually-h
Latest (5.3.x)
<svg class="bi" aria-hidden="true"><use xlink:href="#check2"></use></svg> </a> </li> <li> <a class="dropdown-item" href="https://getbootstrap.com/docs/5.2/customize/overview/">
v5.2.3
</a> </li> <li> <a class="dropdown-item" href="https://getbootstrap.com/docs/5.1/customize/overview/">
v5.1.3
</a> </li> <li> <a class="dropdown-item" href="https://getbootstrap.com/docs/5.0/customize/overview/">
v5.0.2
</a> </li> <li><hr class="dropdown-divider"></li> <li><h6 class="dropdown-header">Previous releases</h6></li> <li><a class="dropdown-item" href="https://getbootstrap.com/docs/4.6/">v4.6.x</a></li> <li><a class="dropdown-item" href="https://getbootstrap.com/docs/3.4/">v3.4.1</a></li> <li><a class="dropdown-item" href="https://getbootstrap.com/2.3.2/">v2.3.2</a></li> <li><hr class="dropdown-divider"></li> <li><a class="dropdown-item" href="/docs/versions/">All versions</a></li> </ul> </li> <li class="nav-item py-2 py-lg-1 col-12 col-lg-auto"> <div class="vr d-none d-lg-flex h-100 mx-lg-2 text-white"></div> <hr class="d-lg-none my-2 text-white-50"> </li> <li class="nav-item dropdown"> <button class="btn btn-link nav-link px-0 px-lg-2 py-2 dropdown-toggle d-flex align-items-center" id="bd-theme" type="button" aria-expanded="false" data-bs-toggle="dropdown" data-bs-display="static" aria-label="Toggle theme (auto)"> <svg class="bi my-1 theme-icon-active" aria-hidden="true"><use href="#circle-half"></use></svg> <span class="d-lg-none ms-2" id="bd-theme-text">Toggle theme</span> </button> <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="bd-theme-text"> <li> <button type="button" class="dropdown-item d-flex align-items-center" data-bs-theme-value="light" aria-pressed="false"> <svg class="bi me-2 opacity-50" aria-hidden="true"><use href="#sun-fill"></use></svg>
Light
<svg class="bi ms-auto d-none" aria-hidden="true"><use href="#check2"></use></svg> </button> </li> <li> <button type="button" class="dropdown-item d-flex align-items-center" data-bs-theme-value="dark" aria-pressed="false"> <svg class="bi me-2 opacity-50" aria-hidden="true"><use href="#moon-stars-fill"></use></svg>
Dark
<svg class="bi ms-auto d-none" aria-hidden="true"><use href="#check2"></use></svg> </button> </li> <li> <button type="button" class="dropdown-item d-flex align-items-center active" data-bs-theme-value="auto" aria-pressed="true"> <svg class="bi me-2 opacity-50" aria-hidden="true"><use href="#circle-half"></use></svg>
Auto
<svg class="bi ms-auto d-none" aria-hidden="true"><use href="#check2"></use></svg> </button> </li> </ul> </li> </ul> </div> </div> </nav> </header> <div class="container-xxl bd-gutter mt-3 my-md-4 bd-layout"> <aside class="bd-sidebar"> <div class="offcanvas-lg offcanvas-start" tabindex="-1" id="bdSidebar" aria-labelledby="bdSidebarOffcanvasLabel"> <div class="offcanvas-header border-bottom"> <h5 class="offcanvas-title" id="bdSidebarOffcanvasLabel">Browse docs</h5> <button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close" data-bs-target="#bdSidebar"></button> </div> <div class="offcanvas-body"> <nav class="bd-links w-100" id="bd-docs-nav" aria-label="Docs navigation"> <ul class="bd-links-nav list-unstyled mb-0 pb-3 pb-md-2 pe-lg-2"> <li class="bd-links-group py-2"> <strong class="bd-links-heading d-flex w-100 align-items-center fw-semibold"> <svg class="bi me-2" style="color: var(--bs-indigo);" aria-hidden="true"> <use xlink:href="#book-half"></use> </svg> Getting started </strong> <ul class="list-unstyled fw-normal pb-2 small"> <li> <a href="/docs/5.3/getting-started/introduction" class="bd-links-link d-inline-block rounded"> Introduction </a> </li><li> <a href="/docs/5.3/getting-started/download" class="bd-links-link d-inline-block rounded"> Download </a> </li><li> <a href="/docs/5.3/getting-started/contents" class="bd-links-link d-inline-block rounded"> Contents </a> </li><li> <a href="/docs/5.3/getting-started/browsers-devices" class="bd-links-link d-inline-block rounded"> Browsers &amp; devices </a> </li><li> <a href="/docs/5.3/getting-started/javascript" class="bd-links-link d-inline-block rounded"> JavaScript </a> </li><li> <a href="/docs/5.3/getting-started/webpack" class="bd-links-link d-inline-block rounded"> Webpack </a> </li><li> <a href="/docs/5.3/getting-started/parcel" class="bd-links-link d-inline-block rounded"> Parcel </a> </li><li> <a href="/docs/5.3/getting-started/vite" class="bd-links-link d-inline-block rounded"> Vite </a> </li><li> <a href="/docs/5.3/getting-started/accessibility" class="bd-links-link d-inline-block rounded"> Accessibility </a> </li><li> <a href="/docs/5.3/getting-started/rfs" class="bd-links-link d-inline-block rounded"> RFS </a> </li><li> <a href="/docs/5.3/getting-started/rtl" class="bd-links-link d-inline-block rounded"> RTL </a> </li><li> <a href="/docs/5.3/getting-started/contribute" class="bd-links-link d-inline-block rounded"> Contribute </a> </li> </ul> </li><li class="bd-links-group py-2"> <strong class="bd-links-heading d-flex w-100 align-items-center fw-semibold"> <svg class="bi me-2" style="color: var(--bs-pink);" aria-hidden="true"> <use xlink:href="#palette2"></use> </svg> Customize </strong> <ul class="list-unstyled fw-normal pb-2 small"> <li> <a href="/docs/5.3/customize/overview" class="bd-links-link d-inline-block rounded active" aria-current="page"> Overview </a> </li><li> <a href="/docs/5.3/customize/sass" class="bd-links-link d-inline-block rounded"> Sass </a> </li><li> <a href="/docs/5.3/customize/options" class="bd-links-link d-inline-block rounded"> Options </a> </li><li> <a href="/docs/5.3/customize/color" class="bd-links-link d-inline-block rounded"> Color </a> </li><li> <a href="/docs/5.3/customize/color-modes" class="bd-links-link d-inline-block rounded"> Color modes </a> </li><li> <a href="/docs/5.3/customize/components" class="bd-links-link d-inline-block rounded"> Components </a> </li><li> <a href="/docs/5.3/customize/css-variables" class="bd-links-link d-inline-block rounded"> CSS variables </a> </li><li> <a href="/docs/5.3/customize/optimize" class="bd-links-link d-inline-block rounded"> Optimize </a> </li> </ul> </li><li class="bd-links-group py-2"> <strong class="bd-links-heading d-flex w-100 align-items-center fw-semibold"> <svg class="bi me-2" style="color: var(--bs-teal);" aria-hidden="true"> <use xlink:href="#grid-fill"></use> </svg> Layout </strong> <ul class="list-unstyled fw-normal pb-2 small"> <li> <a href="/docs/5.3/layout/breakpoints" class="bd-links-link d-inline-block rounded"> Breakpoints </a> </li><l
View on GitHub
</a> </div> <h1 class="bd-title mb-0" id="content">Customize</h1> </div> <p class="bd-lead"> Learn how to theme, customize, and extend Bootstrap with Sass, a boatload of global options, an expansive color system, and more. </p> <script async src="https://cdn.carbonads.com/carbon.js?serve=CKYIKKJL&placement=getbootstrapcom" id="_carbonads_js"></script> </div> <div class="bd-content ps-lg-2"> <div class="row g-3"> <div class="col-md-6"> <a class="d-block text-decoration-none" href="./sass/"> <strong class="d-block h5 mb-0">Sass</strong> <span class="text-secondary">Utilize our source Sass files to take advantage of variables, maps, mixins, and functions.</span> </a> </div><div class="col-md-6"> <a class="d-block text-decoration-none" href="./options/"> <strong class="d-block h5 mb-0">Options</strong> <span class="text-secondary">Customize Bootstrap with built-in variables to easily toggle global CSS preferences.</span> </a> </div><div class="col-md-6"> <a class="d-block text-decoration-none" href="./color/"> <strong class="d-block h5 mb-0">Color</strong> <span class="text-secondary">Learn about and customize the color systems that support the entire toolkit.</span> </a> </div><div class="col-md-6"> <a class="d-block text-decoration-none" href="./color-modes/"> <strong class="d-block h5 mb-0">Color modes</strong> <span class="text-secondary">Explore our default light mode and the new dark mode, or create custom color modes yourself.</span> </a> </div><div class="col-md-6"> <a class="d-block text-decoration-none" href="./components/"> <strong class="d-block h5 mb-0">Components</strong> <span class="text-secondary">Learn how we build nearly all our components responsively and with base and modifier classes.</span> </a> </div><div class="col-md-6"> <a class="d-block text-decoration-none" href="./css-variables/"> <strong class="d-block h5 mb-0">CSS variables</strong> <span class="text-secondary">Use Bootstrap&#39;s CSS custom properties for fast and forward-looking design and development.</span> </a> </div><div class="col-md-6"> <a class="d-block text-decoration-none" href="./optimize/"> <strong class="d-block h5 mb-0">Optimize</strong> <span class="text-secondary">Keep your projects lean, responsive, and maintainable so you can deliver the best experience.</span> </a> </div> </div> <h2 id="overview">Overview<a class="anchor-link" href="#overview"> </a></h2>
<p>There are multiple ways to customize Bootstrap. Your best path can depend on your project, the complexity of your build tools, the version of Bootstrap you&#39;re using, browser support, and more.</p>
2022-12-24 18:43:04 +02:00
<p>Our two preferred methods are:</p>
<ol>
2025-03-08 09:31:15 +01:00
<li>Using Bootstrap <a href="/docs/5.3/getting-started/download#package-managers">via package manager</a> so you can use and extend our source files.</li>
<li>Using Bootstrap&#39;s compiled distribution files or <a href="/docs/5.3/getting-started/download#cdn-via-jsdelivr">jsDelivr</a> so you can add onto or override Bootstrap&#39;s styles.</li>
2022-12-24 18:43:04 +02:00
</ol>
2025-03-08 09:31:15 +01:00
<p>While we cannot go into details here on how to use every package manager, we can give some guidance on <a href="/docs/5.3/customize/sass">using Bootstrap with your own Sass compiler</a>.</p>
<p>For those who want to use the distribution files, review the <a href="/docs/5.3/getting-started/introduction">getting started page</a> for how to include those files and an example HTML page. From there, consult the docs for the layout, components, and behaviors you&#39;d like to use.</p>
2022-12-24 18:43:04 +02:00
<p>As you familiarize yourself with Bootstrap, continue exploring this section for more details on how to utilize our global options, making use of and changing our color system, how we build our components, how to use our growing list of CSS custom properties, and how to optimize your code when building with Bootstrap.</p>
2025-03-08 09:31:15 +01:00
<h2 id="csps-and-embedded-svgs">CSPs and embedded SVGs<a class="anchor-link" href="#csps-and-embedded-svgs"> </a></h2>
<p>Several Bootstrap components include embedded SVGs in our CSS to style components consistently and easily across browsers and devices. <strong>For organizations with more strict <abbr title="Content Security Policy">CSP</abbr> configurations</strong>, we&#39;ve documented all instances of our embedded SVGs (all of which are applied via <code>background-image</code>) so you can more thoroughly review your options.</p>
2022-12-24 18:43:04 +02:00
<ul>
2025-03-08 09:31:15 +01:00
<li><a href="/docs/5.3/components/accordion">Accordion</a></li>
<li><a href="/docs/5.3/components/carousel#with-controls">Carousel controls</a></li>
<li><a href="/docs/5.3/components/close-button">Close button</a> (used in alerts and modals)</li>
<li><a href="/docs/5.3/forms/checks-radios">Form checkboxes and radio buttons</a></li>
<li><a href="/docs/5.3/forms/checks-radios#switches">Form switches</a></li>
<li><a href="/docs/5.3/forms/validation#server-side">Form validation icons</a></li>
<li><a href="/docs/5.3/components/navbar#responsive-behaviors">Navbar toggle buttons</a></li>
<li><a href="/docs/5.3/forms/select">Select menus</a></li>
2022-12-24 18:43:04 +02:00
</ul>
2025-03-08 09:31:15 +01:00
<p>Based on <a href="https://github.com/twbs/bootstrap/issues/25394">community conversation</a>, some options for addressing this in your own codebase include <a href="/docs/5.3/getting-started/webpack#extracting-svg-files">replacing the URLs with locally hosted assets</a>, removing the images and using inline images (not possible in all components), and modifying your CSP. Our recommendation is to carefully review your own security policies and decide on the best path forward, if necessary.</p> </div> </main> </div> <script src="/docs/5.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"></script> <script type="module" src="/_astro/Scripts.astro_astro_type_script_index_0_lang.lFiTneBv.js"></script> <script type="module" src="/_astro/Scripts.astro_astro_type_script_index_1_lang.CAqD2hc_.js"></script> <script type="module">const p=()=>{const t=document.querySelector(".bd-sidebar"),a=document.querySelector(".bd-links-nav .active");if(!t||!a)return;const c=t.clientHeight,i=a.offsetTop,r=a.clientHeight,n=i,s=n-c+r;(t.scrollTop>n||t.scrollTop<s)&&(t.scrollTop=n-c/2+r/2)},v=()=>{document.querySelectorAll('[data-bs-toggle="tooltip"]').forEach(e=>{new bootstrap.Tooltip(e)}),document.querySelectorAll('[data-bs-toggle="popover"]').forEach(e=>{new bootstrap.Popover(e)});const t=document.getElementById("toastPlacement");t&&document.getElementById("selectToastPlacement").addEventListener("change",function(){t.dataset.originalClass||(t.dataset.originalClass=t.className),t.className=`${t.dataset.originalClass} ${this.value}`}),document.querySelectorAll(".bd-example .toast").forEach(e=>{new bootstrap.Toast(e,{autohide:!1}).show()});const a=document.getElementById("liveToastBtn"),c=document.getElementById("liveToast");if(a){const e=bootstrap.Toast.getOrCreateInstance(c);a.addEventListener("click",()=>{e.show()})}const i=document.getElementById("liveAlertPlaceholder"),r=(e,o)=>{const l=document.createElement("div");l.innerHTML=[`<div class="alert alert-${o} alert-dismissible" role="alert">`,` <div>${e}</div>`,' <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>',"</div>"].join(""),i.append(l)},n=document.getElementById("liveAlertBtn");n&&n.addEventListener("click",()=>{r("Nice, you triggered this alert message!","success")}),document.querySelectorAll('.carousel:not([data-bs-ride="carousel"])').forEach(e=>{bootstrap.Carousel.getOrCreateInstance(e)}),document.querySelectorAll('.bd-example-indeterminate [type="checkbox"]').forEach(e=>{e.id.includes("Indeterminate")&&(e.indeterminate=!0)}),document.querySelectorAll('.bd-content [href="#"]').forEach(e=>{e.addEventListener("click",o=>{o.preventDefault()})});const s=document.getElementById("exampleModal");s&&s.addEventListener("show.bs.modal",e=>{const l=e.relatedTarget.getAttribute("data-bs-whatever"),m=s.querySelector(".modal-title"),u=s.querySelector(".modal-body input");m.textContent=`New message to ${l}`,u.value=l});const d=document.querySelectorAll(".bd-example-offcanvas .offcanvas");d&&d.forEach(e=>{e.addEventListener("show.bs.offcanvas",o=>{o.preventDefault()},!1)})};p();v();</script> <footer class="bd-footer py-4 py-md-5 mt-5 bg-body-tertiary"> <div class="container py-4 py-md-5 px-4 px-md-3 text-body-secondary"> <div class="row"> <div class="col-lg-3 mb-3"> <a class="d-inline-flex align-items-center mb-2 text-body-emphasis text-decoration-none" href="/" aria-label="Bootstrap"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 118 94" role="img" class="d-block me-2" height="32" width="40"> <title>Bootstrap</title> <path fill-rule="evenodd" clip-rule="evenodd" d="M24.509 0c-6.733 0-11.715 5.893-11.492 12.284.214 6.14-.064 14.092-2.066 20.577C8.943 39.365 5.547 43.485 0 44.014v5.972c5.547.529 8.943 4.649 10.951 11.153 2.002 6.485 2.28 14.437 2.066 20.577C12.794 88.106 17.776 94 24.51 94H93.5c6.733 0 11.714-5.893 11.491-12.284-.214-6.14.064-14.092 2.066-20.577 2.009-6.504 5.396-10.624 10.943-11.153v-5.972c-5.547-.529-8.934-4.649-10.943-11.153-2.002-6.484-2.28-14.437-2.066-2
Designed and built with all the love in the world by the <a href="/docs/5.3/about/team">Bootstrap team</a> with the help of <a href="https://github.com/twbs/bootstrap/graphs/contributors">our contributors</a>.
</li> <li class="mb-2">
Code licensed <a href="https://github.com/twbs/bootstrap/blob/main/LICENSE" target="_blank" rel="license noopener">MIT</a>, docs <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank" rel="license noopener">CC BY 3.0</a>.
</li> <li class="mb-2">Currently v5.3.3.</li> </ul> </div> <div class="col-6 col-lg-2 offset-lg-1 mb-3"> <h5>Links</h5> <ul class="list-unstyled"> <li class="mb-2"><a href="/">Home</a></li> <li class="mb-2"><a href="/docs/5.3/">Docs</a></li> <li class="mb-2"><a href="/docs/5.3/examples">Examples</a></li> <li class="mb-2"><a href="https://icons.getbootstrap.com/">Icons</a></li> <li class="mb-2"><a href="https://themes.getbootstrap.com/">Themes</a></li> <li class="mb-2"><a href="https://blog.getbootstrap.com/">Blog</a></li> <li class="mb-2"><a href="https://cottonbureau.com/people/bootstrap" target="_blank" rel="noopener">Swag Store</a></li> </ul> </div> <div class="col-6 col-lg-2 mb-3"> <h5>Guides</h5> <ul class="list-unstyled"> <li class="mb-2"><a href="/docs/5.3/getting-started">Getting started</a></li> <li class="mb-2"><a href="/docs/5.3/examples/starter-template">Starter template</a></li> <li class="mb-2"><a href="/docs/5.3/getting-started/webpack">Webpack</a></li> <li class="mb-2"><a href="/docs/5.3/getting-started/parcel">Parcel</a></li> <li class="mb-2"><a href="/docs/5.3/getting-started/vite">Vite</a></li> </ul> </div> <div class="col-6 col-lg-2 mb-3"> <h5>Projects</h5> <ul class="list-unstyled"> <li class="mb-2"> <a href="https://github.com/twbs/bootstrap" target="_blank" rel="noopener">Bootstrap 5</a> </li> <li class="mb-2"> <a href="https://github.com/twbs/bootstrap/tree/v4-dev" target="_blank" rel="noopener">Bootstrap 4</a> </li> <li class="mb-2"><a href="https://github.com/twbs/icons" target="_blank" rel="noopener">Icons</a></li> <li class="mb-2"><a href="https://github.com/twbs/rfs" target="_blank" rel="noopener">RFS</a></li> <li class="mb-2"> <a href="https://github.com/twbs/examples" target="_blank" rel="noopener">Examples repo</a> </li> </ul> </div> <div class="col-6 col-lg-2 mb-3"> <h5>Community</h5> <ul class="list-unstyled"> <li class="mb-2"> <a href="https://github.com/twbs/bootstrap/issues" target="_blank" rel="noopener">Issues</a> </li> <li class="mb-2"> <a href="https://github.com/twbs/bootstrap/discussions" target="_blank" rel="noopener">Discussions</a> </li> <li class="mb-2"> <a href="https://github.com/sponsors/twbs" target="_blank" rel="noopener">Corporate sponsors</a> </li> <li class="mb-2"><a href="https://opencollective.com/bootstrap" target="_blank" rel="noopener">Open Collective</a></li> <li class="mb-2"> <a href="https://stackoverflow.com/questions/tagged/bootstrap-5" target="_blank" rel="noopener">Stack Overflow</a> </li> </ul> </div> </div> </div> </footer> </body> </html>