mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-29 08:10:47 +02:00
Add v5.0.0-beta3 docs (#33440)
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="Documentation and examples for common text utilities to control alignment, wrapping, weight, and more.">
|
||||
<meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
|
||||
<meta name="generator" content="Hugo 0.80.0">
|
||||
<meta name="generator" content="Hugo 0.82.0">
|
||||
|
||||
<meta name="docsearch:language" content="en">
|
||||
<meta name="docsearch:version" content="5.0">
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link href="/docs/5.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl" crossorigin="anonymous">
|
||||
<link href="/docs/5.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" crossorigin="anonymous">
|
||||
|
||||
<link href="/docs/5.0/assets/css/docs.css" rel="stylesheet">
|
||||
|
||||
@@ -193,6 +193,7 @@
|
||||
<li><a href="/docs/5.0/getting-started/javascript/" class="d-inline-flex align-items-center rounded">JavaScript</a></li>
|
||||
<li><a href="/docs/5.0/getting-started/build-tools/" class="d-inline-flex align-items-center rounded">Build tools</a></li>
|
||||
<li><a href="/docs/5.0/getting-started/webpack/" class="d-inline-flex align-items-center rounded">Webpack</a></li>
|
||||
<li><a href="/docs/5.0/getting-started/parcel/" class="d-inline-flex align-items-center rounded">Parcel</a></li>
|
||||
<li><a href="/docs/5.0/getting-started/accessibility/" class="d-inline-flex align-items-center rounded">Accessibility</a></li>
|
||||
<li><a href="/docs/5.0/getting-started/rfs/" class="d-inline-flex align-items-center rounded">RFS</a></li>
|
||||
<li><a href="/docs/5.0/getting-started/rtl/" class="d-inline-flex align-items-center rounded">RTL</a></li>
|
||||
@@ -289,6 +290,7 @@
|
||||
<li><a href="/docs/5.0/components/modal/" class="d-inline-flex align-items-center rounded">Modal</a></li>
|
||||
<li><a href="/docs/5.0/components/navs-tabs/" class="d-inline-flex align-items-center rounded">Navs & tabs</a></li>
|
||||
<li><a href="/docs/5.0/components/navbar/" class="d-inline-flex align-items-center rounded">Navbar</a></li>
|
||||
<li><a href="/docs/5.0/components/offcanvas/" class="d-inline-flex align-items-center rounded">Offcanvas</a></li>
|
||||
<li><a href="/docs/5.0/components/pagination/" class="d-inline-flex align-items-center rounded">Pagination</a></li>
|
||||
<li><a href="/docs/5.0/components/popovers/" class="d-inline-flex align-items-center rounded">Popovers</a></li>
|
||||
<li><a href="/docs/5.0/components/progress/" class="d-inline-flex align-items-center rounded">Progress</a></li>
|
||||
@@ -406,6 +408,13 @@
|
||||
<li><a href="#monospace">Monospace</a></li>
|
||||
<li><a href="#reset-color">Reset color</a></li>
|
||||
<li><a href="#text-decoration">Text decoration</a></li>
|
||||
<li><a href="#sass">Sass</a>
|
||||
<ul>
|
||||
<li><a href="#variables">Variables</a></li>
|
||||
<li><a href="#maps">Maps</a></li>
|
||||
<li><a href="#utilities-api">Utilities API</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
@@ -489,15 +498,6 @@ Note that <a href="https://rtlstyling.com/posts/rtl-styling#3.-line-break">break
|
||||
<span class="p"><</span><span class="nt">p</span> <span class="na">class</span><span class="o">=</span><span class="s">"fs-5"</span><span class="p">></span>.fs-5 text<span class="p"></</span><span class="nt">p</span><span class="p">></span>
|
||||
<span class="p"><</span><span class="nt">p</span> <span class="na">class</span><span class="o">=</span><span class="s">"fs-6"</span><span class="p">></span>.fs-6 text<span class="p"></</span><span class="nt">p</span><span class="p">></span></code></pre></div>
|
||||
<p>Customize your available <code>font-size</code>s by modifying the <code>$font-sizes</code> Sass map.</p>
|
||||
<div class="highlight"><pre class="chroma"><code class="language-scss" data-lang="scss"><span class="nv">$font-sizes</span><span class="o">:</span> <span class="p">(</span>
|
||||
<span class="mi">1</span><span class="o">:</span> <span class="nv">$h1-font-size</span><span class="o">,</span>
|
||||
<span class="mi">2</span><span class="o">:</span> <span class="nv">$h2-font-size</span><span class="o">,</span>
|
||||
<span class="mi">3</span><span class="o">:</span> <span class="nv">$h3-font-size</span><span class="o">,</span>
|
||||
<span class="mi">4</span><span class="o">:</span> <span class="nv">$h4-font-size</span><span class="o">,</span>
|
||||
<span class="mi">5</span><span class="o">:</span> <span class="nv">$h5-font-size</span><span class="o">,</span>
|
||||
<span class="mi">6</span><span class="o">:</span> <span class="nv">$h6-font-size</span>
|
||||
<span class="p">);</span>
|
||||
</code></pre></div>
|
||||
<h2 id="font-weight-and-italics">Font weight and italics</h2>
|
||||
<p>Quickly change the <code>font-weight</code> or <code>font-style</code> of text with these utilities. <code>font-style</code> utilities are abbreviated as <code>.fst-*</code> and <code>font-weight</code> utilities are abbreviated as <code>.fw-*</code>.</p>
|
||||
<div class="bd-example">
|
||||
@@ -549,6 +549,125 @@ Note that <a href="https://rtlstyling.com/posts/rtl-styling#3.-line-break">break
|
||||
</div><div class="highlight"><pre class="chroma"><code class="language-html" data-lang="html"><span class="p"><</span><span class="nt">p</span> <span class="na">class</span><span class="o">=</span><span class="s">"text-decoration-underline"</span><span class="p">></span>This text has a line underneath it.<span class="p"></</span><span class="nt">p</span><span class="p">></span>
|
||||
<span class="p"><</span><span class="nt">p</span> <span class="na">class</span><span class="o">=</span><span class="s">"text-decoration-line-through"</span><span class="p">></span>This text has a line going through it.<span class="p"></</span><span class="nt">p</span><span class="p">></span>
|
||||
<span class="p"><</span><span class="nt">a</span> <span class="na">href</span><span class="o">=</span><span class="s">"#"</span> <span class="na">class</span><span class="o">=</span><span class="s">"text-decoration-none"</span><span class="p">></span>This link has its text decoration removed<span class="p"></</span><span class="nt">a</span><span class="p">></span></code></pre></div>
|
||||
<h2 id="sass">Sass</h2>
|
||||
<h3 id="variables">Variables</h3>
|
||||
<div class="highlight"><pre class="chroma"><code class="language-scss" data-lang="scss"><span class="c1">// stylelint-disable value-keyword-case
|
||||
</span><span class="c1"></span><span class="nv">$font-family-sans-serif</span><span class="o">:</span> <span class="n">system-ui</span><span class="o">,</span> <span class="o">-</span><span class="n">apple-system</span><span class="o">,</span> <span class="s2">"Segoe UI"</span><span class="o">,</span> <span class="n">Roboto</span><span class="o">,</span> <span class="s2">"Helvetica Neue"</span><span class="o">,</span> <span class="n">Arial</span><span class="o">,</span> <span class="s2">"Noto Sans"</span><span class="o">,</span> <span class="s2">"Liberation Sans"</span><span class="o">,</span> <span class="no">sans-serif</span><span class="o">,</span> <span class="s2">"Apple Color Emoji"</span><span class="o">,</span> <span class="s2">"Segoe UI Emoji"</span><span class="o">,</span> <span class="s2">"Segoe UI Symbol"</span><span class="o">,</span> <span class="s2">"Noto Color Emoji"</span><span class="p">;</span>
|
||||
<span class="nv">$font-family-monospace</span><span class="o">:</span> <span class="n">SFMono-Regular</span><span class="o">,</span> <span class="n">Menlo</span><span class="o">,</span> <span class="n">Monaco</span><span class="o">,</span> <span class="n">Consolas</span><span class="o">,</span> <span class="s2">"Liberation Mono"</span><span class="o">,</span> <span class="s2">"Courier New"</span><span class="o">,</span> <span class="no">monospace</span><span class="p">;</span>
|
||||
<span class="c1">// stylelint-enable value-keyword-case
|
||||
</span><span class="c1"></span><span class="nv">$font-family-base</span><span class="o">:</span> <span class="nf">var</span><span class="p">(</span><span class="o">--</span><span class="si">#{</span><span class="nv">$variable-prefix</span><span class="si">}</span><span class="no">font</span><span class="o">-</span><span class="no">sans-serif</span><span class="p">);</span>
|
||||
<span class="nv">$font-family-code</span><span class="o">:</span> <span class="nf">var</span><span class="p">(</span><span class="o">--</span><span class="si">#{</span><span class="nv">$variable-prefix</span><span class="si">}</span><span class="no">font</span><span class="o">-</span><span class="no">monospace</span><span class="p">);</span>
|
||||
|
||||
<span class="c1">// $font-size-root effects the value of `rem`, which is used for as well font sizes, paddings and margins
|
||||
</span><span class="c1">// $font-size-base effects the font size of the body text
|
||||
</span><span class="c1"></span><span class="nv">$font-size-root</span><span class="o">:</span> <span class="n">null</span><span class="p">;</span>
|
||||
<span class="nv">$font-size-base</span><span class="o">:</span> <span class="mi">1</span><span class="kt">rem</span><span class="p">;</span> <span class="c1">// Assumes the browser default, typically `16px`
|
||||
</span><span class="c1"></span><span class="nv">$font-size-sm</span><span class="o">:</span> <span class="nv">$font-size-base</span> <span class="o">*</span> <span class="mf">.875</span><span class="p">;</span>
|
||||
<span class="nv">$font-size-lg</span><span class="o">:</span> <span class="nv">$font-size-base</span> <span class="o">*</span> <span class="mi">1</span><span class="mf">.25</span><span class="p">;</span>
|
||||
|
||||
<span class="nv">$font-weight-lighter</span><span class="o">:</span> <span class="no">lighter</span><span class="p">;</span>
|
||||
<span class="nv">$font-weight-light</span><span class="o">:</span> <span class="mi">300</span><span class="p">;</span>
|
||||
<span class="nv">$font-weight-normal</span><span class="o">:</span> <span class="mi">400</span><span class="p">;</span>
|
||||
<span class="nv">$font-weight-bold</span><span class="o">:</span> <span class="mi">700</span><span class="p">;</span>
|
||||
<span class="nv">$font-weight-bolder</span><span class="o">:</span> <span class="no">bolder</span><span class="p">;</span>
|
||||
|
||||
<span class="nv">$font-weight-base</span><span class="o">:</span> <span class="nv">$font-weight-normal</span><span class="p">;</span>
|
||||
|
||||
<span class="nv">$line-height-base</span><span class="o">:</span> <span class="mi">1</span><span class="mf">.5</span><span class="p">;</span>
|
||||
<span class="nv">$line-height-sm</span><span class="o">:</span> <span class="mi">1</span><span class="mf">.25</span><span class="p">;</span>
|
||||
<span class="nv">$line-height-lg</span><span class="o">:</span> <span class="mi">2</span><span class="p">;</span>
|
||||
|
||||
<span class="nv">$h1-font-size</span><span class="o">:</span> <span class="nv">$font-size-base</span> <span class="o">*</span> <span class="mi">2</span><span class="mf">.5</span><span class="p">;</span>
|
||||
<span class="nv">$h2-font-size</span><span class="o">:</span> <span class="nv">$font-size-base</span> <span class="o">*</span> <span class="mi">2</span><span class="p">;</span>
|
||||
<span class="nv">$h3-font-size</span><span class="o">:</span> <span class="nv">$font-size-base</span> <span class="o">*</span> <span class="mi">1</span><span class="mf">.75</span><span class="p">;</span>
|
||||
<span class="nv">$h4-font-size</span><span class="o">:</span> <span class="nv">$font-size-base</span> <span class="o">*</span> <span class="mi">1</span><span class="mf">.5</span><span class="p">;</span>
|
||||
<span class="nv">$h5-font-size</span><span class="o">:</span> <span class="nv">$font-size-base</span> <span class="o">*</span> <span class="mi">1</span><span class="mf">.25</span><span class="p">;</span>
|
||||
<span class="nv">$h6-font-size</span><span class="o">:</span> <span class="nv">$font-size-base</span><span class="p">;</span>
|
||||
</code></pre></div>
|
||||
<h3 id="maps">Maps</h3>
|
||||
<p>Font-size utilities are generated from this map, in combination with our utilities API.</p>
|
||||
<div class="highlight"><pre class="chroma"><code class="language-scss" data-lang="scss"><span class="nv">$font-sizes</span><span class="o">:</span> <span class="p">(</span>
|
||||
<span class="mi">1</span><span class="o">:</span> <span class="nv">$h1-font-size</span><span class="o">,</span>
|
||||
<span class="mi">2</span><span class="o">:</span> <span class="nv">$h2-font-size</span><span class="o">,</span>
|
||||
<span class="mi">3</span><span class="o">:</span> <span class="nv">$h3-font-size</span><span class="o">,</span>
|
||||
<span class="mi">4</span><span class="o">:</span> <span class="nv">$h4-font-size</span><span class="o">,</span>
|
||||
<span class="mi">5</span><span class="o">:</span> <span class="nv">$h5-font-size</span><span class="o">,</span>
|
||||
<span class="mi">6</span><span class="o">:</span> <span class="nv">$h6-font-size</span>
|
||||
<span class="p">);</span>
|
||||
</code></pre></div>
|
||||
<h3 id="utilities-api">Utilities API</h3>
|
||||
<p>Font and text utilities are declared in our utilities API in <code>scss/_utilities.scss</code>. <a href="/docs/5.0/utilities/api/#using-the-api">Learn how to use the utilities API.</a></p>
|
||||
<div class="highlight"><pre class="chroma"><code class="language-scss" data-lang="scss"> <span class="s2">"font-family"</span><span class="nd">:</span> <span class="o">(</span>
|
||||
<span class="nt">property</span><span class="nd">:</span> <span class="nt">font-family</span><span class="o">,</span>
|
||||
<span class="nt">class</span><span class="nd">:</span> <span class="nt">font</span><span class="o">,</span>
|
||||
<span class="nt">values</span><span class="nd">:</span> <span class="o">(</span><span class="nt">monospace</span><span class="nd">:</span> <span class="nt">var</span><span class="o">(</span><span class="nt">--</span><span class="nn">#</span><span class="p">{</span><span class="err">$</span><span class="nt">variable-prefix</span><span class="p">}</span><span class="nt">font-monospace</span><span class="o">))</span>
|
||||
<span class="o">),</span>
|
||||
<span class="s2">"font-size"</span><span class="nd">:</span> <span class="o">(</span>
|
||||
<span class="nt">rfs</span><span class="nd">:</span> <span class="nt">true</span><span class="o">,</span>
|
||||
<span class="nt">property</span><span class="nd">:</span> <span class="nt">font-size</span><span class="o">,</span>
|
||||
<span class="nt">class</span><span class="nd">:</span> <span class="nt">fs</span><span class="o">,</span>
|
||||
<span class="nt">values</span><span class="nd">:</span> <span class="err">$</span><span class="nt">font-sizes</span>
|
||||
<span class="o">),</span>
|
||||
<span class="s2">"font-style"</span><span class="nd">:</span> <span class="o">(</span>
|
||||
<span class="nt">property</span><span class="nd">:</span> <span class="nt">font-style</span><span class="o">,</span>
|
||||
<span class="nt">class</span><span class="nd">:</span> <span class="nt">fst</span><span class="o">,</span>
|
||||
<span class="nt">values</span><span class="nd">:</span> <span class="nt">italic</span> <span class="nt">normal</span>
|
||||
<span class="o">),</span>
|
||||
<span class="s2">"font-weight"</span><span class="nd">:</span> <span class="o">(</span>
|
||||
<span class="nt">property</span><span class="nd">:</span> <span class="nt">font-weight</span><span class="o">,</span>
|
||||
<span class="nt">class</span><span class="nd">:</span> <span class="nt">fw</span><span class="o">,</span>
|
||||
<span class="nt">values</span><span class="nd">:</span> <span class="o">(</span>
|
||||
<span class="nt">light</span><span class="nd">:</span> <span class="err">$</span><span class="nt">font-weight-light</span><span class="o">,</span>
|
||||
<span class="nt">lighter</span><span class="nd">:</span> <span class="err">$</span><span class="nt">font-weight-lighter</span><span class="o">,</span>
|
||||
<span class="nt">normal</span><span class="nd">:</span> <span class="err">$</span><span class="nt">font-weight-normal</span><span class="o">,</span>
|
||||
<span class="nt">bold</span><span class="nd">:</span> <span class="err">$</span><span class="nt">font-weight-bold</span><span class="o">,</span>
|
||||
<span class="nt">bolder</span><span class="nd">:</span> <span class="err">$</span><span class="nt">font-weight-bolder</span>
|
||||
<span class="o">)</span>
|
||||
<span class="o">),</span>
|
||||
<span class="s2">"line-height"</span><span class="nd">:</span> <span class="o">(</span>
|
||||
<span class="nt">property</span><span class="nd">:</span> <span class="nt">line-height</span><span class="o">,</span>
|
||||
<span class="nt">class</span><span class="nd">:</span> <span class="nt">lh</span><span class="o">,</span>
|
||||
<span class="nt">values</span><span class="nd">:</span> <span class="o">(</span>
|
||||
<span class="nt">1</span><span class="nd">:</span> <span class="nt">1</span><span class="o">,</span>
|
||||
<span class="nt">sm</span><span class="nd">:</span> <span class="err">$</span><span class="nt">line-height-sm</span><span class="o">,</span>
|
||||
<span class="nt">base</span><span class="nd">:</span> <span class="err">$</span><span class="nt">line-height-base</span><span class="o">,</span>
|
||||
<span class="nt">lg</span><span class="nd">:</span> <span class="err">$</span><span class="nt">line-height-lg</span><span class="o">,</span>
|
||||
<span class="o">)</span>
|
||||
<span class="o">),</span>
|
||||
<span class="s2">"text-align"</span><span class="nd">:</span> <span class="o">(</span>
|
||||
<span class="nt">responsive</span><span class="nd">:</span> <span class="nt">true</span><span class="o">,</span>
|
||||
<span class="nt">property</span><span class="nd">:</span> <span class="nt">text-align</span><span class="o">,</span>
|
||||
<span class="nt">class</span><span class="nd">:</span> <span class="nt">text</span><span class="o">,</span>
|
||||
<span class="nt">values</span><span class="nd">:</span> <span class="o">(</span>
|
||||
<span class="nt">start</span><span class="nd">:</span> <span class="nt">left</span><span class="o">,</span>
|
||||
<span class="nt">end</span><span class="nd">:</span> <span class="nt">right</span><span class="o">,</span>
|
||||
<span class="nt">center</span><span class="nd">:</span> <span class="nt">center</span><span class="o">,</span>
|
||||
<span class="o">)</span>
|
||||
<span class="o">),</span>
|
||||
<span class="s2">"text-decoration"</span><span class="nd">:</span> <span class="o">(</span>
|
||||
<span class="nt">property</span><span class="nd">:</span> <span class="nt">text-decoration</span><span class="o">,</span>
|
||||
<span class="nt">values</span><span class="nd">:</span> <span class="nt">none</span> <span class="nt">underline</span> <span class="nt">line-through</span>
|
||||
<span class="o">),</span>
|
||||
<span class="s2">"text-transform"</span><span class="nd">:</span> <span class="o">(</span>
|
||||
<span class="nt">property</span><span class="nd">:</span> <span class="nt">text-transform</span><span class="o">,</span>
|
||||
<span class="nt">class</span><span class="nd">:</span> <span class="nt">text</span><span class="o">,</span>
|
||||
<span class="nt">values</span><span class="nd">:</span> <span class="nt">lowercase</span> <span class="nt">uppercase</span> <span class="nt">capitalize</span>
|
||||
<span class="o">),</span>
|
||||
<span class="s2">"white-space"</span><span class="nd">:</span> <span class="o">(</span>
|
||||
<span class="nt">property</span><span class="nd">:</span> <span class="nt">white-space</span><span class="o">,</span>
|
||||
<span class="nt">class</span><span class="nd">:</span> <span class="nt">text</span><span class="o">,</span>
|
||||
<span class="nt">values</span><span class="nd">:</span> <span class="o">(</span>
|
||||
<span class="nt">wrap</span><span class="nd">:</span> <span class="nt">normal</span><span class="o">,</span>
|
||||
<span class="nt">nowrap</span><span class="nd">:</span> <span class="nt">nowrap</span><span class="o">,</span>
|
||||
<span class="o">)</span>
|
||||
<span class="o">),</span>
|
||||
<span class="s2">"word-wrap"</span><span class="nd">:</span> <span class="o">(</span>
|
||||
<span class="nt">property</span><span class="nd">:</span> <span class="nt">word-wrap</span> <span class="nt">word-break</span><span class="o">,</span>
|
||||
<span class="nt">class</span><span class="nd">:</span> <span class="nt">text</span><span class="o">,</span>
|
||||
<span class="nt">values</span><span class="nd">:</span> <span class="o">(</span><span class="nt">break</span><span class="nd">:</span> <span class="nt">break-word</span><span class="o">),</span>
|
||||
<span class="nt">rtl</span><span class="nd">:</span> <span class="nt">false</span>
|
||||
<span class="o">),</span>
|
||||
</code></pre></div>
|
||||
|
||||
</div>
|
||||
</main>
|
||||
@@ -564,11 +683,11 @@ Note that <a href="https://rtlstyling.com/posts/rtl-styling#3.-line-break">break
|
||||
<li class="d-inline-block ms-3"><a href="/docs/5.0/about/overview/">About</a></li>
|
||||
</ul>
|
||||
<p class="mb-0">Designed and built with all the love in the world by the <a href="/docs/5.0/about/team/">Bootstrap team</a> with the help of <a href="https://github.com/twbs/bootstrap/graphs/contributors">our contributors</a>.</p>
|
||||
<p class="mb-0">Currently v5.0.0-beta2. 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>.</p>
|
||||
<p class="mb-0">Currently v5.0.0-beta3. 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>.</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="/docs/5.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-b5kHyXgcpbZJO/tY9Ul7kGkf1S0CWuKcCD38l8YkeH8z8QjE0GmW1gYU5S9FOnJ0" crossorigin="anonymous"></script>
|
||||
<script src="/docs/5.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf" crossorigin="anonymous"></script>
|
||||
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
|
||||
|
Reference in New Issue
Block a user