Skip to content

Commit

Permalink
Docs: add 'Utilities > Float' page
Browse files Browse the repository at this point in the history
  • Loading branch information
louismaximepiton committed Aug 1, 2024
1 parent 5267180 commit a710891
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
44 changes: 43 additions & 1 deletion site/content/docs/0.0/utilities/float.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,46 @@ aliases:
toc: true
---

{{< callout-soon "page" >}}
## Overview

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 breakpoints as our grid system. Please be aware float utilities have no effect on flex items.

{{< example >}}
<div class="float-start">Float start on all viewport sizes</div><br>
<div class="float-end">Float end on all viewport sizes</div><br>
<div class="float-none">Don't float on all viewport sizes</div>
{{< /example >}}

<!--Use the [clearfix helper]({{< docsref "/helpers/clearfix" >}}) on a parent element to clear floats.-->

<!--## Responsive
Responsive variations also exist for each `float` value.
{{< example >}}
<div class="float-sm-end">Float end on viewports sized SM (small) or wider</div><br>
<div class="float-md-end">Float end on viewports sized MD (medium) or wider</div><br>
<div class="float-lg-end">Float end on viewports sized LG (large) or wider</div><br>
<div class="float-xl-end">Float end on viewports sized XL (extra large) or wider</div><br>
<div class="float-xxl-end">Float end on viewports sized XXL (extra extra large) or wider</div><br>
{{< /example >}}
Here are all the support classes:
{{< markdown >}}
{{< float.inline >}}
{{- range $.Site.Data.breakpoints }}
- `.float{{ .abbr }}-start`
- `.float{{ .abbr }}-end`
- `.float{{ .abbr }}-none`
{{- end -}}
{{< /float.inline >}}
{{< /markdown >}}-->

## CSS

### Sass utilities API

Float utilities are declared in our utilities API in `scss/_utilities.scss`. [Learn how to use the utilities API.]({{< docsref "/utilities/api#using-the-api" >}})

{{< scss-docs name="utils-float" file="scss/_utilities.scss" >}}
1 change: 0 additions & 1 deletion site/data/sidebar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@
draft: true
- title: Flex
- title: Float
draft: true
- title: Interactions
draft: true
- title: Link
Expand Down

0 comments on commit a710891

Please sign in to comment.