<pclass="text-default"><code>.text-default</code> Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.</p><pclass="text-primary"><code>.text-primary</code> Nullam id dolor id nibh ultricies vehicula ut id elit.</p><pclass="text-secondary"><code>.text-secondary</code> Nullam nisi erat porttitor ligula vehicula ut id.</p><pclass="text-disabled"><code>.text-disabled</code> Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</p><pclass="text-success"><code>.text-success</code> Dapibus cursus commodo, tortor mauris nibh amet non magna.</p><pclass="text-error"><code>.text-error</code> Maecenas sed diam eget risus varius blandit sit amet non magna.</p><pclass="text-warning"><code>.text-warning</code> Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
Dealing with specificity! Sometimes emphasis classes cannot be applied due to the specificity of another selector. In most cases, a sufficient workaround is to wrap your text in a <span> with the class.
Alignments
Easily re-align text to components with text alignment classes.
For left, right, and center alignment, responsive classes are available that use the same viewport width breakpoints as the grid system.
.text-left or .text-{xs,sm,md,lg,xl,xxl}-left
text-align: left;
.text-center or .text-{xs,sm,md,lg,xl,xxl}-center
text-align: center;
.text-right or .text-{xs,sm,md,lg,xl,xxl}-right
text-align: right;
.text-justify or .text-{xs,sm,md,lg,xl,xxl}-justify
.text-left Left aligned text on all viewport sizes.
.text-center Center aligned text on all viewport sizes.
.text-right Right aligned text on all viewport sizes.
.text-justify This is a long paragraph written to show how the 'text-justify' class affect it. Classes are applied to the element itself. Nullam id dolor_id nibh_ultricies_vehicula ut id elit. This is a long paragraph written to show how the 'text-justify' class affect it. Classes are applied to the element itself. Nullam id dolor_id nibh_ultricies_vehicula ut id elit.
.text-sm-right Right aligned text on viewports sized SM (small) or wider.
.text-xxl-right Right aligned text on viewports sized XXL or wider.
<pclass="text-left"><code>.text-left</code> Left aligned text on all viewport sizes.</p><pclass="text-center"><code>.text-center</code> Center aligned text on all viewport sizes.</p><pclass="text-right"><code>.text-right</code> Right aligned text on all viewport sizes.</p><pclass="text-justify"><code>.text-justify</code> This is a long paragraph written to show how the 'text-justify' class affect it. Classes are applied to the element itself. Nullam id dolor_id nibh_ultricies_vehicula ut id elit. This is a long paragraph written to show how the 'text-justify' class affect it. Classes are applied to the element itself. Nullam id dolor_id nibh_ultricies_vehicula ut id elit.</p><pclass="text-sm-right"><code>.text-sm-right</code> Right aligned text on viewports sized SM (small) or wider.</p><pclass="text-xxl-right"><code>.text-xxl-right</code> Right aligned text on viewports sized XXL or wider.</p>
Text decoration
Helper classes for controlling the decoration of text.
<p><code>.text-underline</code><spanclass="text-underline">Underline text</span></p><p><code>.text-line-through</code><spanclass="text-line-through">Text with line through</span></p><p><code>.text-no-underline</code><aclass="text-no-underline"> 'a' element without underline</a></p>
Text overflow
Prevent text from wrapping with a .text-nowrap class.
<codeclass="d-inline-block">.text-nowrap</code><divclass="text-nowrap bg-default border d-inline-block p-4"style="width: 120px;">This text should overflow the parent.</div>
For longer text you can add extension points by adding .text-truncate class. Requires display: inline-block or display: block.
Also you have the option to add helper classes to truncate the text not only for one row, but for 2,3 or 4 rows. Check out the example below.
<divclass="d-flex align-items-center"><codeclass="d-inline-block pr-8">.text-truncate</code><pclass="d-inline-block mb-0"><spanclass="text-truncate"style="max-width: 160px;">This text should have maximum 1 row and if longer ellipsis will appear.</span></p></div><br><divclass="d-flex align-items-center"><codeclass="d-inline-block pr-8">.text-truncate-2</code><pclass="text-truncate-2 mb-0"style="max-width: 160px;">This text should have maximum 2 rows and if longer ellipsis will appear.</p></div><br><divclass="d-flex align-items-center"><codeclass="d-inline-block pr-8">.text-truncate-3</code><pclass="text-truncate-3 mb-0"style="max-width: 160px;">This text should have maximum 3 rows and if longer ellipsis will appear.</p></div><br><divclass="d-flex align-items-center"><codeclass="d-inline-block pr-8">.text-truncate-4</code><pclass="text-truncate-4 mb-0"style="max-width: 150px;">This text should have a maximum of 4 rows and if longer ellipsis will appear and you won't see the end of this sentence.</p></div>
Text transform
Transform text in components with text transform classes. You can use any ot this classes: text-lowercase, text-uppercase or text-capitalize
Use the clasees below to enable additional fractions (sans-serif support it) or ordinal markers (monospace support it), in fonts that support them (the Open Sans and Ubuntu, for the moment doesn't support it).
<p><code>.font-weight-bold</code> or <code>.bold</code><spanclass="bold">Bold text.</span></p><p><code>.font-weight-semibold</code> or <code>.semibold</code><spanclass="semibold">Semibold text.</span></p><p><code>.font-weight-medium</code> or <code>.medium</code><spanclass="medium">Medium weight text.</span></p><p><code>.font-weight-normal</code> or <code>.normal</code><spanclass="normal">Normal weight text.</span></p><p><code>.font-weight-light</code> or <code>.light</code><spanclass="light">Light weight text.</span></p><h4class="mt-32">Numeric font-weight classes</h4><p>CSS classes are available for the full 100-900 numeric scale. Use these when you need a specific weight value not covered by the named classes above.</p><p><code>.font-weight-100</code><spanclass="font-weight-100">Thin (100)</span></p><p><code>.font-weight-200</code><spanclass="font-weight-200">Extra Light (200)</span></p><p><code>.font-weight-300</code><spanclass="font-weight-300">Light (300)</span></p><p><code>.font-weight-400</code><spanclass="font-weight-400">Normal (400)</span></p><p><code>.font-weight-500</code><spanclass="font-weight-500">Medium (500)</span></p><p><code>.font-weight-600</code><spanclass="font-weight-600">Semi Bold (600)</span></p><p><code>.font-weight-700</code><spanclass="font-weight-700">Bold (700)</span></p><p><code>.font-weight-800</code><spanclass="font-weight-800">Extra Bold (800)</span></p><p><code>.font-weight-900</code><spanclass="font-weight-900">Black (900)</span></p>
Font style
Helper classes for controlling the font style of an element.
This text uses the tightest line height (no extra additional spacing). .lh-1 - Use for single-line text or tightly packed labels where vertical rhythm is not a concern.
This text uses the extra-small line height scale value. .lh-xs - Use for compact UI elements such as badges, chips, or condensed table cells.
This text uses the small line height scale value. .lh-sm - Use for smaller body text or secondary descriptions that need a slightly tighter feel.
This text uses the medium line height scale value. .lh-md - The default body text line height. Use when you need to explicitly set the standard reading rhythm.
This text uses the large line height scale value. .lh-lg - Use for larger paragraphs or content areas where improved readability is desired.
This text uses the extra-large line height scale value. .lh-xl - Use for spacious text blocks, pull quotes, or introductory paragraphs.
<pclass="lh-1 mb-16">This text uses the tightest line height (no extra additional spacing). <code>.lh-1</code> - Use for single-line text or tightly packed labels where vertical rhythm is not a concern.</p><pclass="lh-xs mb-16">This text uses the extra-small line height scale value. <code>.lh-xs</code> - Use for compact UI elements such as badges, chips, or condensed table cells.</p><pclass="lh-sm mb-16">This text uses the small line height scale value. <code>.lh-sm</code> - Use for smaller body text or secondary descriptions that need a slightly tighter feel.</p><pclass="lh-md mb-16">This text uses the medium line height scale value. <code>.lh-md</code> - The default body text line height. Use when you need to explicitly set the standard reading rhythm.</p><pclass="lh-lg mb-16">This text uses the large line height scale value. <code>.lh-lg</code> - Use for larger paragraphs or content areas where improved readability is desired.</p><pclass="lh-xl mb-16">This text uses the extra-large line height scale value. <code>.lh-xl</code> - Use for spacious text blocks, pull quotes, or introductory paragraphs.</p>
Font family
Helper classes for controlling the font family of an element. In the Design System we have only 2 types of fonts: Open Sans (default type - that is used in the body) and Ubuntu (used for branding and some types of headings).
.font-family-open-sansThe font used for this paragraph is Open Sans.Deprecated: This class now applies the Inter font, not Open Sans. It will be removed in a future release.
.font-family-ubuntuThe font used for this paragraph is Ubuntu.Deprecated: This class now applies the Inter font, not Ubuntu. It will be removed in a future release.
.font-family-ubuntu-lightThe font used for this paragraph is Ubuntu Light.Deprecated: This class now applies the Inter font, not Ubuntu Light. It will be removed in a future release.
.font-family-ubuntu-semiboldThe font used for this paragraph is Ubuntu Semibold.Deprecated: This class now applies the Inter font, not Ubuntu Semibold. It will be removed in a future release.
.font-family-ubuntu-boldThe font used for this paragraph is Ubuntu Bold.Deprecated: This class now applies the Inter font, not Ubuntu Bold. It will be removed in a future release.
<p><code>.font-family-inter</code><spanclass="font-family-inter">The font used for this paragraph is Inter. Unless stated otherwise, this is the font you should use.</span></p><p><code>.font-family-spiris</code><spanclass="font-family-spiris">Spiris Räksmörgås</span></p><p><code>.font-family-spiris.bold,<br> .font-family-spiris.font-weight-bold </code><spanclass="font-family-spiris font-weight-bold">Spiris Räksmörgås</span></p><pclass="text-line-through"><code>.font-family-open-sans</code><spanclass="font-family-open-sans">The font used for this paragraph is Open Sans.</span><strong>Deprecated: This class now applies the Inter font, not Open Sans. It will be removed in a future release.</strong></p><pclass="text-line-through"><code>.font-family-ubuntu</code><spanclass="font-family-ubuntu">The font used for this paragraph is Ubuntu.</span><strong>Deprecated: This class now applies the Inter font, not Ubuntu. It will be removed in a future release.</strong></p><pclass="text-line-through"><code>.font-family-ubuntu-light</code><spanclass="font-family-ubuntu-light">The font used for this paragraph is Ubuntu Light.</span><strong>Deprecated: This class now applies the Inter font, not Ubuntu Light. It will be removed in a future release.</strong></p><pclass="text-line-through"><code>.font-family-ubuntu-semibold</code><spanclass="font-family-ubuntu-semibold">The font used for this paragraph is Ubuntu Semibold.</span><strong>Deprecated: This class now applies the Inter font, not Ubuntu Semibold. It will be removed in a future release.</strong></p><pclass="text-line-through"><code>.font-family-ubuntu-bold</code><spanclass="font-family-ubuntu-bold">The font used for this paragraph is Ubuntu Bold.</span><strong>Deprecated: This class now applies the Inter font, not Ubuntu Bold. It will be removed in a future release.</strong></p>
Font size
Helper classes for controlling the font size of an element.
<p><code>.font-13</code><spanclass="font-13">The font used for this paragraph is 13px (1.3rem).</span></p><p><code>.font-14</code><spanclass="font-14">The font used for this paragraph is 14px (1.4rem).</span></p><p><code>.font-16</code><spanclass="font-16">The font used for this paragraph is 16px (1.6rem).</span></p><p><code>.font-20</code><spanclass="font-20">The font used for this paragraph is 20px (2rem).</span></p><p><code>.font-24</code><spanclass="font-24">The font used for this paragraph is 20px (2.4em).</span></p><p><code>.font-32</code><spanclass="font-32">The font used for this paragraph is 32px (3.2rem).</span></p><p><code>.font-48</code><spanclass="font-48">The font used for this paragraph is 48px (4.8rem).</span></p>
<pclass="font-20 font-family-ubuntu-semibold text-uppercase text-truncate text-underline text-center text-primary w-100">The font used for this paragraph has 20px, the font family is Ubuntu Semibold, is uppercased, has underline, uses a primary color and it's truncated.</p>