From 3e76d6565603fafa2c85ad81d7b6345c4e279c72 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sun, 28 May 2017 22:50:57 -0700 Subject: Rearrange all the docs to allow for a docs/major.minor/ setup --- docs/utilities/borders.md | 46 ---- docs/utilities/clearfix.md | 38 --- docs/utilities/close-icon.md | 15 - docs/utilities/colors.md | 50 ---- docs/utilities/display.md | 59 ---- docs/utilities/flexbox.md | 518 ----------------------------------- docs/utilities/image-replacement.md | 20 -- docs/utilities/position.md | 31 --- docs/utilities/responsive-helpers.md | 70 ----- docs/utilities/screenreaders.md | 25 -- docs/utilities/sizing.md | 37 --- docs/utilities/spacing.md | 81 ------ docs/utilities/typography.md | 75 ----- docs/utilities/vertical-align.md | 38 --- docs/utilities/visibility.md | 33 --- 15 files changed, 1136 deletions(-) delete mode 100644 docs/utilities/borders.md delete mode 100644 docs/utilities/clearfix.md delete mode 100644 docs/utilities/close-icon.md delete mode 100644 docs/utilities/colors.md delete mode 100644 docs/utilities/display.md delete mode 100644 docs/utilities/flexbox.md delete mode 100644 docs/utilities/image-replacement.md delete mode 100644 docs/utilities/position.md delete mode 100644 docs/utilities/responsive-helpers.md delete mode 100644 docs/utilities/screenreaders.md delete mode 100644 docs/utilities/sizing.md delete mode 100644 docs/utilities/spacing.md delete mode 100644 docs/utilities/typography.md delete mode 100644 docs/utilities/vertical-align.md delete mode 100644 docs/utilities/visibility.md (limited to 'docs/utilities') diff --git a/docs/utilities/borders.md b/docs/utilities/borders.md deleted file mode 100644 index 8bf3f4674..000000000 --- a/docs/utilities/borders.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -layout: docs -title: Borders -description: Use border utilities to quickly style the border and border-radius of an element. Great for images, buttons, or any other element. -group: utilities -redirect_from: "/utilities/" -toc: true ---- - -## Border - -Add classes to an element to remove all borders or some borders. - -
-{% example html %} - - - - - -{% endexample %} -
- -## Border-radius - -Add classes to an element to easily round its corners. - -
- Example rounded image - Example top rounded image - Example right rounded image - Example bottom rounded image - Example left rounded image - Completely round image - Example non-rounded image (overrides rounding applied elsewhere) -
- -{% highlight html %} -... -... -... -... -... -... -... -{% endhighlight %} diff --git a/docs/utilities/clearfix.md b/docs/utilities/clearfix.md deleted file mode 100644 index 5b5727b11..000000000 --- a/docs/utilities/clearfix.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -layout: docs -title: Clearfix -description: Quickly and easily clear floated content within a container by adding a clearfix utility. -group: utilities -toc: true ---- - -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 -@mixin clearfix() { - &::after { - display: block; - content: ""; - 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 deleted file mode 100644 index 4619132de..000000000 --- a/docs/utilities/close-icon.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -layout: docs -title: Close icon -description: Use a generic close icon for dismissing content like modals and alerts. -group: utilities -toc: true ---- - -**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 deleted file mode 100644 index 80e096cf9..000000000 --- a/docs/utilities/colors.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -layout: docs -title: Colors -description: Convey meaning through color with a handful of color utility classes. Includes support for styling links with hover states, too. -group: utilities -toc: true ---- - -{% 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.

-

Eget risus varius blandit sit ultricies vehicula amet non magna.

-

Etiam porta sem malesuada ultricies vehicula.

-{% endexample %} - -Contextual text classes also work well on anchors with the provided hover and focus states. **Note that the `.text-white` class has no link styling.** - -{% 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. Background utilities **do not set `color`**, so in some cases you'll want to use `.text-*` utilities. - -{% 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.
-
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.md b/docs/utilities/display.md deleted file mode 100644 index 86c741190..000000000 --- a/docs/utilities/display.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -layout: docs -title: Display property -description: Quickly and responsively toggle the display value of components and more with our display utilities. Includes support for some of the more common values, as well as some extras for controlling display when printing. -group: utilities -toc: true ---- - -## Common `display` values - -The [`display` property](https://developer.mozilla.org/en-US/docs/Web/CSS/display) accepts a handful of values and we support many of them with utility classes. We purposefully don't provide every value as a utility, so here's what we support: - -- `.d-none` -- `.d-inline` -- `.d-inline-block` -- `.d-block` -- `.d-table` -- `.d-table-cell` -- `.d-flex` -- `.d-inline-flex` - -Put them to use by applying any of the classes to an element of your choice. For example, here's how you could use the inline, block, or inline-block utilities (the same applies to the other classes). - -{% example html %} -
d-inline
-
d-inline
-{% endexample %} - -{% example html %} -d-block -{% endexample %} - -{% example html %} -
d-inline-block
-
d-inline-block
-{% endexample %} - -Responsive variations also exist for every single utility mentioned above. - -{% for bp in site.data.breakpoints %} -- `.d{{ bp.abbr }}-none` -- `.d{{ bp.abbr }}-inline` -- `.d{{ bp.abbr }}-inline-block` -- `.d{{ bp.abbr }}-block` -- `.d{{ bp.abbr }}-table` -- `.d{{ bp.abbr }}-table-cell` -- `.d{{ bp.abbr }}-flex` -- `.d{{ bp.abbr }}-inline-flex`{% endfor %} - -## Display in print - -Change the `display` value of elements when printing with our print display utilities. - -| Class | Print style | -| --- | --- | -| `.d-print-block` | Applies `display: block` to the element when printing | -| `.d-print-inline` | Applies `display: inline` to the element when printing | -| `.d-print-inline-block` | Applies `display: inline-block` to the element when printing | -| `.d-print-none` | Applies `display: none` to the element when printing | diff --git a/docs/utilities/flexbox.md b/docs/utilities/flexbox.md deleted file mode 100644 index bf2a6f37c..000000000 --- a/docs/utilities/flexbox.md +++ /dev/null @@ -1,518 +0,0 @@ ---- -layout: docs -title: Flexbox -description: Quickly manage the layout, alignment, and sizing of grid columns, navigation, components, and more with a full suite of responsive flexbox utilities. For more complex implementations, custom CSS may be necessary. -group: utilities -toc: true ---- - -## Enable flex behaviors - -Apply `display` utilities to create a flexbox container and transform **direct children elements** into flex items. Flex containers and items are able to be modified further with additional flex properties. - -{% example html %} -
I'm a flexbox container!
-{% endexample %} - -{% example html %} -
I'm an inline flexbox container!
-{% endexample %} - -Responsive variations also exist for `.d-flex` and `.d-inline-flex`. - -{% for bp in site.data.breakpoints %} -- `.d{{ bp.abbr }}-flex` -- `.d{{ bp.abbr }}-inline-flex`{% endfor %} - -## Direction - -Set the direction of flex items in a flex container with direction utilities. In most cases you can omit the horizontal class here as the browser default is `row`. However, you may encounter situations where you needed to explicitly set this value (like responsive layouts). - -Use `.flex-row` to set a horizontal direction (the browser default), or `.flex-row-reverse` to start the horizontal direction from the opposite side. - -{% example html %} -
-
Flex item 1
-
Flex item 2
-
Flex item 3
-
-
-
Flex item 1
-
Flex item 2
-
Flex item 3
-
-{% endexample %} - -Use `.flex-column` to set a vertical direction, or `.flex-column-reverse` to start the vertical direction from the opposite side. - -{% example html %} -
-
Flex item 1
-
Flex item 2
-
Flex item 3
-
-
-
Flex item 1
-
Flex item 2
-
Flex item 3
-
-{% endexample %} - -Responsive variations also exist for `flex-direction`. - -{% for bp in site.data.breakpoints %} -- `.flex{{ bp.abbr }}-row` -- `.flex{{ bp.abbr }}-row-reverse` -- `.flex{{ bp.abbr }}-column` -- `.flex{{ bp.abbr }}-column-reverse`{% endfor %} - -## Justify content - -Use `justify-content` utilities on flexbox containers to change the alignment of flex items on the main axis (the x-axis to start, y-axis if `flex-direction: column`). Choose from `start` (browser default), `end`, `center`, `between`, or `around`. - -
-
-
Flex item
-
Flex item
-
Flex item
-
-
-
Flex item
-
Flex item
-
Flex item
-
-
-
Flex item
-
Flex item
-
Flex item
-
-
-
Flex item
-
Flex item
-
Flex item
-
-
-
Flex item
-
Flex item
-
Flex item
-
-
- -{% highlight html %} -
...
-
...
-
...
-
...
-
...
-{% endhighlight %} - -Responsive variations also exist for `justify-content`. - -{% for bp in site.data.breakpoints %} -- `.justify-content{{ bp.abbr }}-start` -- `.justify-content{{ bp.abbr }}-end` -- `.justify-content{{ bp.abbr }}-center` -- `.justify-content{{ bp.abbr }}-between` -- `.justify-content{{ bp.abbr }}-around`{% endfor %} - -## Align items - -Use `align-items` utilities on flexbox containers to change the alignment of flex items on the cross axis (the y-axis to start, x-axis if `flex-direction: column`). Choose from `start`, `end`, `center`, `baseline`, or `stretch` (browser default). - -
-
-
Flex item
-
Flex item
-
Flex item
-
-
-
Flex item
-
Flex item
-
Flex item
-
-
-
Flex item
-
Flex item
-
Flex item
-
-
-
Flex item
-
Flex item
-
Flex item
-
-
-
Flex item
-
Flex item
-
Flex item
-
-
- -{% highlight html %} -
...
-
...
-
...
-
...
-
...
-{% endhighlight %} - -Responsive variations also exist for `align-items`. - -{% for bp in site.data.breakpoints %} -- `.align-items{{ bp.abbr }}-start` -- `.align-items{{ bp.abbr }}-end` -- `.align-items{{ bp.abbr }}-center` -- `.align-items{{ bp.abbr }}-baseline` -- `.align-items{{ bp.abbr }}-stretch`{% endfor %} - -## Align self - -Use `align-self` utilities on flexbox items to individually change their alignment on the cross axis (the y-axis to start, x-axis if `flex-direction: column`). Choose from the same options as `align-items`: `start`, `end`, `center`, `baseline`, or `stretch` (browser default). - -
-
-
Flex item
-
Aligned flex item
-
Flex item
-
-
-
Flex item
-
Aligned flex item
-
Flex item
-
-
-
Flex item
-
Aligned flex item
-
Flex item
-
-
-
Flex item
-
Aligned flex item
-
Flex item
-
-
-
Flex item
-
Aligned flex item
-
Flex item
-
-
- -{% highlight html %} -
Aligned flex item
-
Aligned flex item
-
Aligned flex item
-
Aligned flex item
-
Aligned flex item
-{% endhighlight %} - -Responsive variations also exist for `align-self`. - -{% for bp in site.data.breakpoints %} -- `.align-self{{ bp.abbr }}-start` -- `.align-self{{ bp.abbr }}-end` -- `.align-self{{ bp.abbr }}-center` -- `.align-self{{ bp.abbr }}-baseline` -- `.align-self{{ bp.abbr }}-stretch`{% endfor %} - -## Auto margins - -Flexbox can do some pretty awesome things when you mix flex alignments with auto margins. - -### With justify-content - -Easily move all flex items to one side, but keep another on the opposite end by mixing `justify-content` with `margin-right: auto` or `margin-left: auto`. - -{% example html %} -
-
Flex item
-
Flex item
-
Flex item
-
- -
-
Flex item
-
Flex item
-
Flex item
-
-{% endexample %} - -### With align-items - -Similarly, move one flex item to the top or bottom of a container by mixing `align-items`, `flex-direction: column`, and `margin-top: auto` or `margin-bottom: auto`. - -{% example html %} -
-
Flex item
-
Flex item
-
Flex item
-
- -
-
Flex item
-
Flex item
-
Flex item
-
-{% endexample %} - -## Wrap - -Change how flex items wrap in a flex container. Choose from no wrapping at all (the browser default) with `.flex-nowrap`, wrapping with `.flex-wrap`, or reverse wrapping with `.flex-wrap-reverse`. - -
-
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
-
-{% highlight html %} -
- ... -
-{% endhighlight %} - -
-
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
-
-{% highlight html %} -
- ... -
-{% endhighlight %} - -
-
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
-
-{% highlight html %} -
- ... -
-{% endhighlight %} - - -{% example html %} -{% endexample %} - -Responsive variations also exist for `flex-wrap`. - -{% for bp in site.data.breakpoints %} -- `.flex{{ bp.abbr }}-nowrap` -- `.flex{{ bp.abbr }}-wrap` -- `.flex{{ bp.abbr }}-wrap-reverse`{% endfor %} - -## Order - -Change the _visual_ order of specific flex items with a handful of `order` utilities. We only provide options for making an item first or last, as well as a reset to use the DOM order. As `order` takes any integer value (e.g., `5`), add custom CSS for any additional values needed. - -{% example html %} -
-
First flex item
-
Second flex item
-
Third flex item
-
-{% endexample %} - -Responsive variations also exist for `order`. - -{% for bp in site.data.breakpoints %} -- `.order{{ bp.abbr }}-first` -- `.order{{ bp.abbr }}-last` -- `.order{{ bp.abbr }}-0`{% endfor %} - -## Align content - -Use `align-content` utilities on flexbox containers to align flex items *together* on the cross axis. Choose from `start` (browser default), `end`, `center`, `between`, `around`, or `stretch`. To demonstrate these utilities, we've enforced `flex-wrap: wrap` and increased the number of flex items. - -**Heads up!** This property has no affect on single rows of flex items. - -
-
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
-
-{% highlight html %} -
- ... -
-{% endhighlight %} - -
-
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
-
-{% highlight html %} -
...
-{% endhighlight %} - -
-
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
-
-{% highlight html %} -
...
-{% endhighlight %} - -
-
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
-
-{% highlight html %} -
...
-{% endhighlight %} - -
-
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
-
-{% highlight html %} -
...
-{% endhighlight %} - -
-
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
Flex item
-
-
-{% highlight html %} -
...
-{% endhighlight %} - -Responsive variations also exist for `align-content`. - -{% for bp in site.data.breakpoints %} -- `.align-content{{ bp.abbr }}-start` -- `.align-content{{ bp.abbr }}-end` -- `.align-content{{ bp.abbr }}-center` -- `.align-content{{ bp.abbr }}-around` -- `.align-content{{ bp.abbr }}-stretch`{% endfor %} diff --git a/docs/utilities/image-replacement.md b/docs/utilities/image-replacement.md deleted file mode 100644 index b11c936c4..000000000 --- a/docs/utilities/image-replacement.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -layout: docs -title: Image replacement -description: Swap text for background images with the image replacement class. -group: utilities -toc: true ---- - -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/position.md b/docs/utilities/position.md deleted file mode 100644 index 93f0fd040..000000000 --- a/docs/utilities/position.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -layout: docs -title: Position -description: Use these shorthand utilities for quickly configuring the position of an element. -group: utilities -toc: true ---- - -## Fixed top - -Position an element at the top of the viewport, from edge to edge. Be sure you understand the ramifications of fixed position in your project; you may need to add aditional CSS. - -{% highlight html %} -
...
-{% endhighlight %} - -## Fixed bottom - -Position an element at the bottom of the viewport, from edge to edge. Be sure you understand the ramifications of fixed position in your project; you may need to add aditional CSS. - -{% highlight html %} -
...
-{% endhighlight %} - -## Sticky top - -Position an element at the top of the viewport, from edge to edge, but only after you scroll past it. The `.sticky-top` utility uses CSS's `position: sticky`, which isn't fully supported in all browsers. - -{% highlight html %} -
...
-{% endhighlight %} diff --git a/docs/utilities/responsive-helpers.md b/docs/utilities/responsive-helpers.md deleted file mode 100644 index ae65eff6b..000000000 --- a/docs/utilities/responsive-helpers.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -layout: docs -title: Responsive helpers -description: Create responsive video or slideshow embeds based on the width of the parent by creating an intrinsic ratio that scales on any device. -group: utilities -toc: true ---- - -## Responsive embeds - -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 (`float-left` and `float-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 float-left; -} -.another-element { - @include float-right; -} -{% endhighlight %} diff --git a/docs/utilities/screenreaders.md b/docs/utilities/screenreaders.md deleted file mode 100644 index 73743b306..000000000 --- a/docs/utilities/screenreaders.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -layout: docs -title: Screenreaders -description: Use screenreader utilities to hide elements on all devices execept screen readers. -group: utilities -toc: true ---- - -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]({{ site.baseurl }}/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.md b/docs/utilities/sizing.md deleted file mode 100644 index e2a5ed197..000000000 --- a/docs/utilities/sizing.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -layout: docs -title: Sizing -description: Easily make an element as wide or as tall (relative to its parent) with our width and height utilities. -group: utilities -toc: true ---- - -Width and height utilities are generated from the `$sizes` Sass map in `_variables.scss`. Includes support for `25%`, `50%`, `75%`, and `100%` by default. Modify those values as you need to generate different utilities here. - -{% example html %} -
Width 25%
-
Width 50%
-
Width 75%
-
Width 100%
-{% endexample %} - -{% example html %} -
-
Height 25%
-
Height 50%
-
Height 75%
-
Height 100%
-
-{% endexample %} - -You can also use `max-width: 100%;` and `max-height: 100%;` utilities as needed. - -{% example html %} -Max-width 100% -{% endexample %} - -{% example html %} -
-
Max-height 100%
-
-{% endexample %} diff --git a/docs/utilities/spacing.md b/docs/utilities/spacing.md deleted file mode 100644 index d6d2d7b54..000000000 --- a/docs/utilities/spacing.md +++ /dev/null @@ -1,81 +0,0 @@ ---- -layout: docs -title: Spacing -description: Bootstrap includes a wide range of shorthand responsive margin and padding utility classes to modify an element's appearance. -group: utilities -toc: true ---- - -## How it works - -Assign responsive-friendly `margin` or `padding` values to an element or a subset of its sides with shorthand classes. Includes support for individual properties, all properties, and vertical and horizontal properties. Classes are built from a default Sass map ranging from `.25rem` to `3rem`. - -## Notation - -Spacing utilities that apply to all breakpoints, from `xs` to `xl`, have no breakpoint abbreviation in them. This is because those classes are applied from `min-width: 0` and up, and thus are not bound by a media query. The remaining breakpoints, however, do include a breakpoint abbreviation. - -The classes are named using the format `{property}{sides}-{size}` for `xs` and `{property}{sides}-{breakpoint}-{size}` for `sm`, `md`, `lg`, and `xl`. - -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` -* blank - 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 * .25` -* `2` - (by default) for classes that set the `margin` or `padding` to `$spacer * .5` -* `3` - (by default) for classes that set the `margin` or `padding` to `$spacer` -* `4` - (by default) for classes that set the `margin` or `padding` to `$spacer * 1.5` -* `5` - (by default) for classes that set the `margin` or `padding` to `$spacer * 3` - -(You can add more sizes by adding entries to the `$spacers` Sass map variable.) - -## Examples - -Here are some representative examples of these classes: - -{% highlight scss %} -.mt-0 { - margin-top: 0 !important; -} - -.ml-1 { - margin-left: ($spacer * .25) !important; -} - -.px-2 { - padding-left: ($spacer * .5) !important; - padding-right: ($spacer * .5) !important; -} - -.p-3 { - padding: $spacer !important; -} -{% endhighlight %} - -### Horizontal centering -Additionally, Bootstrap also includes an `.mx-auto` class for horizontally centering fixed-width block level content—that is, content that has `display: block` and a `width` set—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 deleted file mode 100644 index 32e11335d..000000000 --- a/docs/utilities/typography.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -layout: docs -title: Typography -description: Documentation and examples for common text utilities to control alignment, wrapping, weight, and more. -group: utilities -toc: true ---- - -## 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 %} - -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 wrapping and overflow - -Prevent text from wrapping with a `.text-nowrap` class. - -{% example html %} -
-
- Curabitur blandit tempus ardua ridiculus sed magna. -
-
- An image to show the text doesn't wrap -
-
-{% endexample %} - -For longer content, you can add a `.text-truncate` class to truncate the text with an ellipsis. - -{% example html %} -
-
- Praeterea iter est quasdam res quas ex communi. -
-
-{% 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 %} diff --git a/docs/utilities/vertical-align.md b/docs/utilities/vertical-align.md deleted file mode 100644 index e68498270..000000000 --- a/docs/utilities/vertical-align.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -layout: docs -title: Vertical alignment -description: Easily change the vertical alignment of inlie, inline-block, inline-table, and table cell elements. -group: utilities ---- - -Change the alignment of elements with the [`vertical-alignment`](https://developer.mozilla.org/en-US/docs/Web/CSS/vertical-align) utilities. Please note that vertical-align only affects inline, inline-block, inline-table, and table cell elements. - -Choose from `.align-baseline`, `.align-top`, `.align-middle`, `.align-bottom`, `.align-text-bottom`, and `.align-text-top` as needed. - -With inline elements: - -{% example html %} -baseline -top -middle -bottom -text-top -text-bottom -{% endexample %} - -With table cells: - -{% example html %} - - - - - - - - - - - -
baselinetopmiddlebottomtext-toptext-bottom
-{% endexample %} diff --git a/docs/utilities/visibility.md b/docs/utilities/visibility.md deleted file mode 100644 index 9e127139f..000000000 --- a/docs/utilities/visibility.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -layout: docs -title: Visibility -description: Control the visibility, without modifying the display, of elements with visibility utilities. -group: utilities ---- - -Set the `visibility` of elements with our visibility utilities. These do not modify the `display` value at all and are helpful for hiding content from most users, but still keeping them for screen readers. - -Apply `.visible` or `.invisible` as needed. - -{% highlight html %} -
...
- -{% endhighlight %} - -{% highlight scss %} -// Class -.visible { - visibility: visible; -} -.invisible { - visibility: hidden; -} - -// Usage as a mixin -.element { - @include invisible(visible); -} -.element { - @include invisible(hidden); -} -{% endhighlight %} -- cgit v1.2.3