From 076a950442371a8c0a974fa6478efb20a69527b7 Mon Sep 17 00:00:00 2001 From: Kovah Date: Fri, 9 Sep 2016 06:48:17 +0200 Subject: [PATCH] Docs: Breaks out Utilities into separate section and optimizes its pages (#20678) --- docs/_data/nav.yml | 14 + docs/_includes/page-headers.html | 5 + docs/components/utilities.md | 367 ----------------------- docs/utilities/clearfix.md | 39 +++ docs/utilities/close-icon.md | 13 + docs/utilities/colors.md | 47 +++ docs/utilities/display-property.md | 29 ++ docs/utilities/image-replacement.md | 18 ++ docs/utilities/invisible-content.md | 23 ++ docs/utilities/responsive-helpers.md | 70 +++++ docs/utilities/screenreaders.md | 23 ++ docs/utilities/sizing-and-positioning.md | 28 ++ docs/utilities/spacing.md | 69 +++++ docs/utilities/typography.md | 58 ++++ 14 files changed, 436 insertions(+), 367 deletions(-) delete mode 100644 docs/components/utilities.md create mode 100644 docs/utilities/clearfix.md create mode 100644 docs/utilities/close-icon.md create mode 100644 docs/utilities/colors.md create mode 100644 docs/utilities/display-property.md create mode 100644 docs/utilities/image-replacement.md create mode 100644 docs/utilities/invisible-content.md create mode 100644 docs/utilities/responsive-helpers.md create mode 100644 docs/utilities/screenreaders.md create mode 100644 docs/utilities/sizing-and-positioning.md create mode 100644 docs/utilities/spacing.md create mode 100644 docs/utilities/typography.md diff --git a/docs/_data/nav.yml b/docs/_data/nav.yml index 2700cba0c1..835caabd7d 100644 --- a/docs/_data/nav.yml +++ b/docs/_data/nav.yml @@ -53,6 +53,20 @@ - title: Tooltips - title: Utilities +- title: Utilities + pages: + - title: Clearfix + - title: Close icon + - title: Colors + - title: Display property + - title: Image replacement + - title: Invisible content + - title: Responsive helpers + - title: Screenreaders + - title: Sizing and positioning + - title: Spacing + - title: Typography + # - title: Extend # pages: # - title: Approach diff --git a/docs/_includes/page-headers.html b/docs/_includes/page-headers.html index 26f5f95b18..50b59a982f 100644 --- a/docs/_includes/page-headers.html +++ b/docs/_includes/page-headers.html @@ -18,6 +18,11 @@

Over a dozen reusable components built to provide buttons, dropdowns, input groups, navigation, alerts, and much more.

+{% elsif page.group == "utilities" %} +

Utilities

+

+ Bootstrap includes dozens of utilities—classes with a single purpose to reduce the frequency of highly repetitive declarations. +

{% elsif page.group == "javascript" %}

JavaScript plugins

diff --git a/docs/components/utilities.md b/docs/components/utilities.md deleted file mode 100644 index 0f0c176c5f..0000000000 --- a/docs/components/utilities.md +++ /dev/null @@ -1,367 +0,0 @@ ---- -layout: docs -title: Utility classes -group: components ---- - -Bootstrap includes dozens of utilities—classes with a single purpose. They're designed to reduce the frequency of highly repetitive declarations in your CSS while allowing for quick and easy development. - -## Contents - -* Will be replaced with the ToC, excluding the "Contents" header -{:toc} - -## Spacing - -Assign `margin` or `padding` to an element or a subset of its sides with shorthand classes. Includes support for individual properties, all properties, and vertical and horizontal properties. All classes are multiples on the global default value, `1rem`. - -The classes are named using the format: `{property}-{sides}-{size}` - -Where *property* is one of: - -* `m` - for classes that set `margin` -* `p` - for classes that set `padding` - -Where *sides* is one of: - -* `t` - for classes that set `margin-top` or `padding-top` -* `b` - for classes that set `margin-bottom` or `padding-bottom` -* `l` - for classes that set `margin-left` or `padding-left` -* `r` - for classes that set `margin-right` or `padding-right` -* `x` - for classes that set both `*-left` and `*-right` -* `y` - for classes that set both `*-top` and `*-bottom` -* `a` - for classes that set a `margin` or `padding` on all 4 sides of the element - -Where *size* is one of: - -* `0` - for classes that eliminate the `margin` or `padding` by setting it to `0` -* `1` - (by default) for classes that set the `margin` or `padding` to `$spacer-x` or `$spacer-y` -* `2` - (by default) for classes that set the `margin` or `padding` to `$spacer-x * 1.5` or `$spacer-y * 1.5` -* `3` - (by default) for classes that set the `margin` or `padding` to `$spacer-x * 3` or `$spacer-y * 3` - -(You can add more sizes by adding entries to the `$spacers` Sass map variable.) - -Here are some representative examples of these classes: - -{% highlight scss %} -.m-t-0 { - margin-top: 0 !important; -} - -.m-l-1 { - margin-left: $spacer-x !important; -} - -.p-x-2 { - padding-left: ($spacer-x * 1.5) !important; - padding-right: ($spacer-x * 1.5) !important; -} - -.p-a-3 { - padding: ($spacer-y * 3) ($spacer-x * 3) !important; -} -{% endhighlight %} - -### Horizontal centering -Additionally, Bootstrap also includes an `.m-x-auto` class for horizontally centering fixed-width block level content by setting the horizontal margins to `auto`. - -

-
- Centered element -
-
- -{% highlight html %} -
- Centered element -
-{% endhighlight %} - -## Text alignment - -Easily realign text to components with text alignment classes. - -{% example html %} -

Justified text.

-

No wrap text.

-{% endexample %} - -For left, right, and center alignment, responsive classes are available that use the same viewport width breakpoints as the grid system. - -{% example html %} -

Left aligned text on all viewport sizes.

-

Center aligned text on all viewport sizes.

-

Right aligned text on all viewport sizes.

- -

Left aligned text on viewports sized SM (small) or wider.

-

Left aligned text on viewports sized MD (medium) or wider.

-

Left aligned text on viewports sized LG (large) or wider.

-

Left aligned text on viewports sized XL (extra-large) or wider.

-{% endexample %} - -## Text transform - -Transform text in components with text capitalization classes. - -{% example html %} -

Lowercased text.

-

Uppercased text.

-

CapiTaliZed text.

-{% endexample %} - -Note how `text-capitalize` only changes the first letter of each word, leaving the case of any other letters unaffected. - -## Font weight and italics - -Quickly change the weight (boldness) of text or italicize text. - -{% example html %} -

Bold text.

-

Normal weight text.

-

Italic text.

-{% endexample %} - -## Contextual colors and backgrounds - -Convey meaning through color with a handful of emphasis utility classes. These may also be applied to links and will darken on hover just like our default link styles. - -{% example html %} -

Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.

-

Nullam id dolor id nibh ultricies vehicula ut id elit.

-

Duis mollis, est non commodo luctus, nisi erat porttitor ligula.

-

Maecenas sed diam eget risus varius blandit sit amet non magna.

-

Etiam porta sem malesuada magna mollis euismod.

-

Donec ullamcorper nulla non metus auctor fringilla.

-{% endexample %} - -Contextual text classes also work well on anchors with the provided hover and focus states. - -{% example html %} -Muted link -Primary link -Success link -Info link -Warning link -Danger link -{% endexample %} - -Similar to the contextual text color classes, easily set the background of an element to any contextual class. Anchor components will darken on hover, just like the text classes. - -{% example html %} -
Nullam id dolor id nibh ultricies vehicula ut id elit.
-
Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
-
Maecenas sed diam eget risus varius blandit sit amet non magna.
-
Etiam porta sem malesuada magna mollis euismod.
-
Donec ullamcorper nulla non metus auctor fringilla.
-
Cras mattis consectetur purus sit amet fermentum.
-{% endexample %} - -{% callout info %} -#### Dealing with specificity - -Sometimes contextual classes cannot be applied due to the specificity of another selector. In some cases, a sufficient workaround is to wrap your element's content in a `
` with the class. -{% endcallout %} - -{% capture callout-include %}{% include callout-warning-color-assistive-technologies.md %}{% endcapture %} -{{ callout-include | markdownify }} - -## Widths - -Easily make an element as wide as its parent using the `.w-100` utility class, which sets `width: 100%`. - -{% example html %} -Width = 100% -{% endexample %} - -## CSS `display` (`block`, `inline`, `inline-block`) - -Use `.d-block`, `.d-inline`, or `.d-inline-block` to simply set an element's [`display` property](https://developer.mozilla.org/en-US/docs/Web/CSS/display) to `block`, `inline`, or `inline-block` (respectively). - -To make an element `display: none`, use our [responsive utilities](../layout/responsive-utilities/) instead. - -{% example html %} -
Inline
-
Inline
- -Block - -
-

inline-block

- Boot that strap! -
-
-

inline-block

- Strap that boot! -
-{% endexample %} - -## Close icon - -Use a generic close icon for dismissing content like modals and alerts. **Be sure to include text for screen readers**, as we've done with `aria-label`. - -{% example html %} - -{% endexample %} - -## Responsive floats - -These utility classes float an element to the left or right, or disable floating, based on the current viewport size using the [CSS `float` property](https://developer.mozilla.org/en-US/docs/Web/CSS/float). `!important` is included to avoid specificity issues. These use the same viewport width breakpoints as the grid system. - -Two similar non-responsive Sass mixins (`pull-left` and `pull-right`) are also available. - -{% example html %} -
Float left on all viewport sizes

-
Float right on all viewport sizes

-
Don't float on all viewport sizes

- -
Float left on viewports sized SM (small) or wider

-
Float left on viewports sized MD (medium) or wider

-
Float left on viewports sized LG (large) or wider

-
Float left on viewports sized XL (extra-large) or wider

-{% endexample %} - -{% highlight scss %} -// Related simple non-responsive mixins -.element { - @include pull-left; -} -.another-element { - @include pull-right; -} -{% endhighlight %} - -## Clearfix - -Easily clear `float`s by adding `.clearfix` **to the parent element**. Utilizes [the micro clearfix](http://nicolasgallagher.com/micro-clearfix-hack/) as popularized by Nicolas Gallagher. Can also be used as a mixin. - -{% highlight html %} -
...
-{% endhighlight %} - -{% highlight scss %} -// Mixin itself -.clearfix() { - &:before, - &:after { - content: " "; - display: table; - } - &:after { - clear: both; - } -} - -// Usage as a mixin -.element { - @include clearfix; -} -{% endhighlight %} - -## Fixed positioning - -The `.pos-f-t` class can be used to easily position elements at the top of the viewport and make them as wide as the viewport. **Be sure you understand the ramifications of fixed-position elements within your project.** Here's how the class is defined: - -{% highlight scss %} -.pos-f-t { - position: fixed; - top: 0; - right: 0; - left: 0; - z-index: $zindex-navbar-fixed; -} -{% endhighlight %} - -## Invisible content - -The `.invisible` class can be used to toggle only the visibility of an element, meaning its `display` is not modified and the element can still affect the flow of the document. - -{% highlight html %} - -{% endhighlight %} - -{% highlight scss %} -// Class -.invisible { - visibility: hidden; -} - -// Usage as a mixin -.element { - @include invisible; -} -{% endhighlight %} - -## Screen readers and keyboard users - -Hide an element to all devices **except screen readers** with `.sr-only`. Combine `.sr-only` with `.sr-only-focusable` to show the element again when it's focused (e.g. by a keyboard-only user). Can also be used as mixins. - -{% comment %} -Necessary for following [accessibility best practices](../getting-started/#accessibility). -{% endcomment %} - -{% highlight html %} -Skip to main content -{% endhighlight %} - -{% highlight scss %} -// Usage as a mixin -.skip-navigation { - @include sr-only; - @include sr-only-focusable; -} -{% endhighlight %} - -## Image replacement - -Utilize the `.text-hide` class or mixin to help replace an element's text content with a background image. - -{% highlight html %} -

Custom heading

-{% endhighlight %} - -{% highlight scss %} -// Usage as a mixin -.heading { - @include text-hide; -} -{% endhighlight %} - -## Responsive embeds - -Allow browsers to determine video or slideshow dimensions based on the width of their containing block by creating an intrinsic ratio that will properly scale on any device. - -Rules are directly applied to ` -
-{% endexample %} - -Aspect ratios can be customized with modifier classes. - -{% highlight html %} - -
- -
- - -
- -
- - -
- -
- - -
- -
-{% endhighlight %} diff --git a/docs/utilities/clearfix.md b/docs/utilities/clearfix.md new file mode 100644 index 0000000000..8ebf214d2a --- /dev/null +++ b/docs/utilities/clearfix.md @@ -0,0 +1,39 @@ +--- +layout: docs +title: Clearfix +group: utilities +--- + +Easily clear `float`s by adding `.clearfix` **to the parent element**. Utilizes [the micro clearfix](http://nicolasgallagher.com/micro-clearfix-hack/) as popularized by Nicolas Gallagher. Can also be used as a mixin. + +{% highlight html %} +
...
+{% endhighlight %} + +{% highlight scss %} +// Mixin itself +.clearfix() { + &:before, + &:after { + content: " "; + display: table; + } + &:after { + clear: both; + } +} + +// Usage as a mixin +.element { + @include clearfix; +} +{% endhighlight %} + +The following example shows how the clearfix can be used. Without the clearfix the wrapping div would not span around the buttons which would cause a broken layout. + +{% example html %} +
+ + +
+{% endexample %} diff --git a/docs/utilities/close-icon.md b/docs/utilities/close-icon.md new file mode 100644 index 0000000000..5ec456bccd --- /dev/null +++ b/docs/utilities/close-icon.md @@ -0,0 +1,13 @@ +--- +layout: docs +title: Close icon +group: utilities +--- + +Use a generic close icon for dismissing content like modals and alerts. **Be sure to include text for screen readers**, as we've done with `aria-label`. + +{% example html %} + +{% endexample %} diff --git a/docs/utilities/colors.md b/docs/utilities/colors.md new file mode 100644 index 0000000000..62315e614c --- /dev/null +++ b/docs/utilities/colors.md @@ -0,0 +1,47 @@ +--- +layout: docs +title: Colors +group: utilities +--- + +Convey meaning through color with a handful of emphasis utility classes. These may also be applied to links and will darken on hover just like our default link styles. + +{% example html %} +

Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.

+

Nullam id dolor id nibh ultricies vehicula ut id elit.

+

Duis mollis, est non commodo luctus, nisi erat porttitor ligula.

+

Maecenas sed diam eget risus varius blandit sit amet non magna.

+

Etiam porta sem malesuada magna mollis euismod.

+

Donec ullamcorper nulla non metus auctor fringilla.

+{% endexample %} + +Contextual text classes also work well on anchors with the provided hover and focus states. + +{% example html %} +Muted link +Primary link +Success link +Info link +Warning link +Danger link +{% endexample %} + +Similar to the contextual text color classes, easily set the background of an element to any contextual class. Anchor components will darken on hover, just like the text classes. + +{% example html %} +
Nullam id dolor id nibh ultricies vehicula ut id elit.
+
Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
+
Maecenas sed diam eget risus varius blandit sit amet non magna.
+
Etiam porta sem malesuada magna mollis euismod.
+
Donec ullamcorper nulla non metus auctor fringilla.
+
Cras mattis consectetur purus sit amet fermentum.
+{% endexample %} + +{% callout info %} +#### Dealing with specificity + +Sometimes contextual classes cannot be applied due to the specificity of another selector. In some cases, a sufficient workaround is to wrap your element's content in a `
` with the class. +{% endcallout %} + +{% capture callout-include %}{% include callout-warning-color-assistive-technologies.md %}{% endcapture %} +{{ callout-include | markdownify }} diff --git a/docs/utilities/display-property.md b/docs/utilities/display-property.md new file mode 100644 index 0000000000..8b3f6f616f --- /dev/null +++ b/docs/utilities/display-property.md @@ -0,0 +1,29 @@ +--- +layout: docs +title: Display property +group: utilities +--- + +Use `.d-block`, `.d-inline`, or `.d-inline-block` to simply set an element's [`display` property](https://developer.mozilla.org/en-US/docs/Web/CSS/display) to `block`, `inline`, or `inline-block` (respectively). + +To make an element `display: none`, use our [responsive utilities](../../layout/responsive-utilities/) instead. + +{% example html %} +
Inline
+
Inline
+{% endexample %} + +{% example html %} +Block +{% endexample %} + +{% example html %} +
+

inline-block

+ Boot that strap! +
+
+

inline-block

+ Strap that boot! +
+{% endexample %} diff --git a/docs/utilities/image-replacement.md b/docs/utilities/image-replacement.md new file mode 100644 index 0000000000..720e7b5a92 --- /dev/null +++ b/docs/utilities/image-replacement.md @@ -0,0 +1,18 @@ +--- +layout: docs +title: Image replacement +group: utilities +--- + +Utilize the `.text-hide` class or mixin to help replace an element's text content with a background image. + +{% highlight html %} +

Custom heading

+{% endhighlight %} + +{% highlight scss %} +// Usage as a mixin +.heading { + @include text-hide; +} +{% endhighlight %} diff --git a/docs/utilities/invisible-content.md b/docs/utilities/invisible-content.md new file mode 100644 index 0000000000..84da6ad012 --- /dev/null +++ b/docs/utilities/invisible-content.md @@ -0,0 +1,23 @@ +--- +layout: docs +title: Invisible content +group: utilities +--- + +The `.invisible` class can be used to toggle only the visibility of an element, meaning its `display` is not modified and the element can still affect the flow of the document. + +{% highlight html %} + +{% endhighlight %} + +{% highlight scss %} +// Class +.invisible { + visibility: hidden; +} + +// Usage as a mixin +.element { + @include invisible; +} +{% endhighlight %} diff --git a/docs/utilities/responsive-helpers.md b/docs/utilities/responsive-helpers.md new file mode 100644 index 0000000000..b9c76d59db --- /dev/null +++ b/docs/utilities/responsive-helpers.md @@ -0,0 +1,70 @@ +--- +layout: docs +title: Responsive helpers +group: utilities +--- + +## Responsive embeds + +Allow browsers to determine video or slideshow dimensions based on the width of their containing block by creating an intrinsic ratio that will properly scale on any device. + +Rules are directly applied to ` +
+{% endexample %} + +Aspect ratios can be customized with modifier classes. + +{% highlight html %} + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+{% endhighlight %} + +## Responsive floats + +These utility classes float an element to the left or right, or disable floating, based on the current viewport size using the [CSS `float` property](https://developer.mozilla.org/en-US/docs/Web/CSS/float). `!important` is included to avoid specificity issues. These use the same viewport width breakpoints as the grid system. + +Two similar non-responsive Sass mixins (`pull-left` and `pull-right`) are also available. + +{% example html %} +
Float left on all viewport sizes

+
Float right on all viewport sizes

+
Don't float on all viewport sizes

+ +
Float left on viewports sized SM (small) or wider

+
Float left on viewports sized MD (medium) or wider

+
Float left on viewports sized LG (large) or wider

+
Float left on viewports sized XL (extra-large) or wider

+{% endexample %} + +{% highlight scss %} +// Related simple non-responsive mixins +.element { + @include pull-left; +} +.another-element { + @include pull-right; +} +{% endhighlight %} diff --git a/docs/utilities/screenreaders.md b/docs/utilities/screenreaders.md new file mode 100644 index 0000000000..576b0a18b7 --- /dev/null +++ b/docs/utilities/screenreaders.md @@ -0,0 +1,23 @@ +--- +layout: docs +title: Screenreaders +group: utilities +--- + +Hide an element to all devices **except screen readers** with `.sr-only`. Combine `.sr-only` with `.sr-only-focusable` to show the element again when it's focused (e.g. by a keyboard-only user). Can also be used as mixins. + +{% comment %} +Necessary for following [accessibility best practices](../getting-started/#accessibility). +{% endcomment %} + +{% highlight html %} +Skip to main content +{% endhighlight %} + +{% highlight scss %} +// Usage as a mixin +.skip-navigation { + @include sr-only; + @include sr-only-focusable; +} +{% endhighlight %} diff --git a/docs/utilities/sizing-and-positioning.md b/docs/utilities/sizing-and-positioning.md new file mode 100644 index 0000000000..81b65d43d1 --- /dev/null +++ b/docs/utilities/sizing-and-positioning.md @@ -0,0 +1,28 @@ +--- +layout: docs +title: Sizing and positioning +group: utilities +--- + +## Fixed positioning + +The `.pos-f-t` class can be used to easily position elements at the top of the viewport and make them as wide as the viewport. **Be sure you understand the ramifications of fixed-position elements within your project.** Here's how the class is defined: + +{% highlight scss %} +.pos-f-t { + position: fixed; + top: 0; + right: 0; + left: 0; + z-index: $zindex-navbar-fixed; +} +{% endhighlight %} + + +## Full width + +Easily make an element as wide as its parent using the `.w-100` utility class, which sets `width: 100%`. + +{% example html %} +Width = 100% +{% endexample %} diff --git a/docs/utilities/spacing.md b/docs/utilities/spacing.md new file mode 100644 index 0000000000..045c4b2139 --- /dev/null +++ b/docs/utilities/spacing.md @@ -0,0 +1,69 @@ +--- +layout: docs +title: Spacing +group: utilities +--- + +Assign `margin` or `padding` to an element or a subset of its sides with shorthand classes. Includes support for individual properties, all properties, and vertical and horizontal properties. All classes are multiples on the global default value, `1rem`. + +The classes are named using the format: `{property}-{sides}-{size}` + +Where *property* is one of: + +* `m` - for classes that set `margin` +* `p` - for classes that set `padding` + +Where *sides* is one of: + +* `t` - for classes that set `margin-top` or `padding-top` +* `b` - for classes that set `margin-bottom` or `padding-bottom` +* `l` - for classes that set `margin-left` or `padding-left` +* `r` - for classes that set `margin-right` or `padding-right` +* `x` - for classes that set both `*-left` and `*-right` +* `y` - for classes that set both `*-top` and `*-bottom` +* `a` - for classes that set a `margin` or `padding` on all 4 sides of the element + +Where *size* is one of: + +* `0` - for classes that eliminate the `margin` or `padding` by setting it to `0` +* `1` - (by default) for classes that set the `margin` or `padding` to `$spacer-x` or `$spacer-y` +* `2` - (by default) for classes that set the `margin` or `padding` to `$spacer-x * 1.5` or `$spacer-y * 1.5` +* `3` - (by default) for classes that set the `margin` or `padding` to `$spacer-x * 3` or `$spacer-y * 3` + +(You can add more sizes by adding entries to the `$spacers` Sass map variable.) + +Here are some representative examples of these classes: + +{% highlight scss %} +.m-t-0 { + margin-top: 0 !important; +} + +.m-l-1 { + margin-left: $spacer-x !important; +} + +.p-x-2 { + padding-left: ($spacer-x * 1.5) !important; + padding-right: ($spacer-x * 1.5) !important; +} + +.p-a-3 { + padding: ($spacer-y * 3) ($spacer-x * 3) !important; +} +{% endhighlight %} + +### Horizontal centering +Additionally, Bootstrap also includes an `.m-x-auto` class for horizontally centering fixed-width block level content by setting the horizontal margins to `auto`. + +
+
+ Centered element +
+
+ +{% highlight html %} +
+ Centered element +
+{% endhighlight %} diff --git a/docs/utilities/typography.md b/docs/utilities/typography.md new file mode 100644 index 0000000000..c5628dad1b --- /dev/null +++ b/docs/utilities/typography.md @@ -0,0 +1,58 @@ +--- +layout: docs +title: Typography +group: utilities +--- + +The following utilities can be used to add additional styles to texts. + +## Text alignment + +Easily realign text to components with text alignment classes. + +{% example html %} +

Ambitioni dedisse scripsisse iudicaretur. Cras mattis iudicium purus sit amet fermentum. Donec sed odio operae, eu vulputate felis rhoncus. Praeterea iter est quasdam res quas ex communi. At nos hinc posthac, sitientis piros Afros. Petierunt uti sibi concilium totius Galliae in diem certam indicere. Cras mattis iudicium purus sit amet fermentum.

+{% endexample %} + +{% example html %} +
+
+ Curabitur blandit tempus ardua ridiculus sed magna. +
+
+{% endexample %} + +For left, right, and center alignment, responsive classes are available that use the same viewport width breakpoints as the grid system. + +{% example html %} +

Left aligned text on all viewport sizes.

+

Center aligned text on all viewport sizes.

+

Right aligned text on all viewport sizes.

+ +

Left aligned text on viewports sized SM (small) or wider.

+

Left aligned text on viewports sized MD (medium) or wider.

+

Left aligned text on viewports sized LG (large) or wider.

+

Left aligned text on viewports sized XL (extra-large) or wider.

+{% endexample %} + +## Text transform + +Transform text in components with text capitalization classes. + +{% example html %} +

Lowercased text.

+

Uppercased text.

+

CapiTaliZed text.

+{% endexample %} + +Note how `text-capitalize` only changes the first letter of each word, leaving the case of any other letters unaffected. + +## Font weight and italics + +Quickly change the weight (boldness) of text or italicize text. + +{% example html %} +

Bold text.

+

Normal weight text.

+

Italic text.

+{% endexample %}