| commit | author | age | ||
| 83c3f6 | 1 | --- |
| SP | 2 | layout: docs |
| 3 | title: Visibility | |
| 4 | description: Control the visibility, without modifying the display, of elements with visibility utilities. | |
| 5 | group: utilities | |
| 6 | --- | |
| 7 | ||
| 8 | Set the `visibility` of elements with our visibility utilities. These utility classes do not modify the `display` value at all and do not affect layout – `.invisible` elements still take up space in the page. Content will be hidden both visually and for assistive technology/screen reader users. | |
| 9 | ||
| 10 | Apply `.visible` or `.invisible` as needed. | |
| 11 | ||
| 12 | {% highlight html %} | |
| 13 | <div class="visible">...</div> | |
| 14 | <div class="invisible">...</div> | |
| 15 | {% endhighlight %} | |
| 16 | ||
| 17 | {% highlight scss %} | |
| 18 | // Class | |
| 19 | .visible { | |
| 20 | visibility: visible; | |
| 21 | } | |
| 22 | .invisible { | |
| 23 | visibility: hidden; | |
| 24 | } | |
| 25 | ||
| 26 | // Usage as a mixin | |
| 27 | .element { | |
| 28 | @include invisible(visible); | |
| 29 | } | |
| 30 | .element { | |
| 31 | @include invisible(hidden); | |
| 32 | } | |
| 33 | {% endhighlight %} | |