Skip to content

Commit

Permalink
docs(utilities): add 'Float' page (#2661)
Browse files Browse the repository at this point in the history
Co-authored-by: Julien Déramond <[email protected]>
  • Loading branch information
louismaximepiton and julien-deramond authored Aug 2, 2024
1 parent 59c798c commit 65c6428
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 @@ -223,7 +223,6 @@
draft: true
- title: Flex
- title: Float
draft: true
- title: Interactions
- title: Link
draft: true
Expand Down

0 comments on commit 65c6428

Please sign in to comment.