bulma/docs/documentation/helpers/visibility-helpers.html

232 lines
6.4 KiB
HTML
Raw Normal View History

2020-05-10 21:10:51 +00:00
---
title: Responsive helpers
2024-03-21 16:11:54 +00:00
layout: docs
theme: helpers
2020-05-10 21:10:51 +00:00
doc-tab: helpers
doc-subtab: helpers-visibility
breadcrumb:
2024-03-21 16:11:54 +00:00
- home
- documentation
- helpers
- helpers-visibility
2020-05-10 21:10:51 +00:00
---
{% capture thead %}
<thead>
<tr>
2024-03-21 16:11:54 +00:00
<th>Class</th>
{% for breakpoint_hash in site.data.breakpoints %} {% assign breakpoint =
breakpoint_hash[1] %}
2020-05-10 21:10:51 +00:00
<th>
2024-03-21 16:11:54 +00:00
{{ breakpoint.name }}<br />
{% if breakpoint.id == 'mobile' %} Up to
<code>{{ breakpoint.to }}px</code>
{% elsif breakpoint.id == 'fullhd' %}
<code>{{ breakpoint.from }}px</code> and above {% else %} Between
<code>{{ breakpoint.from }}px</code> and
<code>{{ breakpoint.to }}px</code>
{% endif %}
2020-05-10 21:10:51 +00:00
</th>
{% endfor %}
</tr>
</thead>
2024-03-21 16:11:54 +00:00
{% endcapture %} {% capture flex %}
<td class="is-narrow has-text-primary has-background-primary-light">Flex</td>
{% endcapture %} {% capture visible %}
<td class="is-narrow has-text-success has-background-success-light">Visible</td>
{% endcapture %} {% capture hidden %}
<td class="is-narrow has-text-danger has-background-danger-light">Hidden</td>
{% endcapture %} {% capture unchanged %}
<td class="is-narrow has-text-grey-light">Unchanged</td>
{% endcapture %} {% include docs/elements/anchor.html name="Show" %}
2020-05-10 21:10:51 +00:00
<div class="content">
2024-03-21 16:11:54 +00:00
<p>You can use one of the following <code>display</code> classes:</p>
2020-05-10 21:10:51 +00:00
<ul>
<li><code>is-block</code></li>
<li><code>is-flex</code></li>
<li><code>is-inline</code></li>
<li><code>is-inline-block</code></li>
<li><code>is-inline-flex</code></li>
</ul>
<p>For example, here's how the <code>is-flex</code> helper works:</p>
</div>
<div class="table-container">
<table class="table is-bordered">
{{ thead }}
<tbody>
<tr>
<td class="is-narrow">
<code>is-flex-mobile</code>
</td>
2024-03-21 16:11:54 +00:00
{{ flex }} {{ unchanged }} {{ unchanged }} {{ unchanged }} {{ unchanged
}}
2020-05-10 21:10:51 +00:00
</tr>
<tr>
<td class="is-narrow">
<code>is-flex-tablet-only</code>
</td>
2024-03-21 16:11:54 +00:00
{{ unchanged }} {{ flex }} {{ unchanged }} {{ unchanged }} {{ unchanged
}}
2020-05-10 21:10:51 +00:00
</tr>
<tr>
<td class="is-narrow">
<code>is-flex-desktop-only</code>
</td>
2024-03-21 16:11:54 +00:00
{{ unchanged }} {{ unchanged }} {{ flex }} {{ unchanged }} {{ unchanged
}}
2020-05-10 21:10:51 +00:00
</tr>
<tr>
<td class="is-narrow">
<code>is-flex-widescreen-only</code>
</td>
2024-03-21 16:11:54 +00:00
{{ unchanged }} {{ unchanged }} {{ unchanged }} {{ flex }} {{ unchanged
}}
2020-05-10 21:10:51 +00:00
</tr>
<tr>
<th colspan="5">
2024-03-21 16:11:54 +00:00
<p>
Classes to display <strong>up to</strong> or <strong>from</strong> a
specific breakpoint
</p>
2020-05-10 21:10:51 +00:00
</th>
</tr>
<tr>
<td class="is-narrow">
<code>is-flex-touch</code>
</td>
2024-03-21 16:11:54 +00:00
{{ flex }} {{ flex }} {{ unchanged }} {{ unchanged }} {{ unchanged }}
2020-05-10 21:10:51 +00:00
</tr>
<tr>
<td class="is-narrow">
<code>is-flex-tablet</code>
</td>
2024-03-21 16:11:54 +00:00
{{ unchanged }} {{ flex }} {{ flex }} {{ flex }} {{ flex }}
2020-05-10 21:10:51 +00:00
</tr>
<tr>
<td class="is-narrow">
<code>is-flex-desktop</code>
</td>
2024-03-21 16:11:54 +00:00
{{ unchanged }} {{ unchanged }} {{ flex }} {{ flex }} {{ flex }}
2020-05-10 21:10:51 +00:00
</tr>
<tr>
<td class="is-narrow">
<code>is-flex-widescreen</code>
</td>
2024-03-21 16:11:54 +00:00
{{ unchanged }} {{ unchanged }} {{ unchanged }} {{ flex }} {{ flex }}
2020-05-10 21:10:51 +00:00
</tr>
<tr>
<td class="is-narrow">
<code>is-flex-fullhd</code>
</td>
2024-03-21 16:11:54 +00:00
{{ unchanged }} {{ unchanged }} {{ unchanged }} {{ unchanged }} {{ flex
}}
2020-05-10 21:10:51 +00:00
</tr>
</tbody>
</table>
</div>
<div class="content">
<p>
2024-03-21 16:11:54 +00:00
For the other display options, just replace <code>is-flex</code> with
<code>is-block</code> <code>is-inline</code> <code>is-inline-block</code> or
<code>is-inline-flex</code>
2020-05-10 21:10:51 +00:00
</p>
</div>
2024-03-21 16:11:54 +00:00
{% include docs/elements/anchor.html name="Hide" %}
2020-05-10 21:10:51 +00:00
<div class="table-container">
<table class="table is-bordered">
{{ thead }}
<tbody>
<tr>
<td class="is-narrow">
<code>is-hidden-mobile</code>
</td>
2024-03-21 16:11:54 +00:00
{{ hidden }} {{ visible }} {{ visible }} {{ visible }} {{ visible }}
2020-05-10 21:10:51 +00:00
</tr>
<tr>
<td class="is-narrow">
<code>is-hidden-tablet-only</code>
</td>
2024-03-21 16:11:54 +00:00
{{ visible }} {{ hidden }} {{ visible }} {{ visible }} {{ visible }}
2020-05-10 21:10:51 +00:00
</tr>
<tr>
<td class="is-narrow">
<code>is-hidden-desktop-only</code>
</td>
2024-03-21 16:11:54 +00:00
{{ visible }} {{ visible }} {{ hidden }} {{ visible }} {{ visible }}
2020-05-10 21:10:51 +00:00
</tr>
<tr>
<td class="is-narrow">
<code>is-hidden-widescreen-only</code>
</td>
2024-03-21 16:11:54 +00:00
{{ visible }} {{ visible }} {{ visible }} {{ hidden }} {{ visible }}
2020-05-10 21:10:51 +00:00
</tr>
<tr>
<th colspan="5">
2024-03-21 16:11:54 +00:00
<p>
Classes to hide <strong>up to</strong> or <strong>from</strong> a
specific breakpoint
</p>
2020-05-10 21:10:51 +00:00
</th>
</tr>
<tr>
<td class="is-narrow">
<code>is-hidden-touch</code>
</td>
2024-03-21 16:11:54 +00:00
{{ hidden }} {{ hidden }} {{ visible }} {{ visible }} {{ visible }}
2020-05-10 21:10:51 +00:00
</tr>
<tr>
<td class="is-narrow">
<code>is-hidden-tablet</code>
</td>
2024-03-21 16:11:54 +00:00
{{ visible }} {{ hidden }} {{ hidden }} {{ hidden }} {{ hidden }}
2020-05-10 21:10:51 +00:00
</tr>
<tr>
<td class="is-narrow">
<code>is-hidden-desktop</code>
</td>
2024-03-21 16:11:54 +00:00
{{ visible }} {{ visible }} {{ hidden }} {{ hidden }} {{ hidden }}
2020-05-10 21:10:51 +00:00
</tr>
<tr>
<td class="is-narrow">
<code>is-hidden-widescreen</code>
</td>
2024-03-21 16:11:54 +00:00
{{ visible }} {{ visible }} {{ visible }} {{ hidden }} {{ hidden }}
2020-05-10 21:10:51 +00:00
</tr>
<tr>
<td class="is-narrow">
<code>is-hidden-fullhd</code>
</td>
2024-03-21 16:11:54 +00:00
{{ visible }} {{ visible }} {{ visible }} {{ visible }} {{ hidden }}
2020-05-10 21:10:51 +00:00
</tr>
</tbody>
</table>
</div>
2020-05-10 23:25:29 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/anchor.html name="Other visibility helpers" %}
2020-05-10 23:25:29 +00:00
<table class="table is-bordered">
<tbody>
<tr>
<td><code>is-invisible</code></td>
<td>Adds visibility <strong>hidden</strong></td>
</tr>
<tr>
<td><code>is-hidden</code></td>
<td>Hides element</td>
</tr>
<tr>
<td><code>is-sr-only</code></td>
2024-03-21 16:11:54 +00:00
<td>
Hide elements <strong>visually</strong> but keep the element available
to be announced by a
<strong>screen reader</strong>
</td>
2020-05-10 23:25:29 +00:00
</tr>
</tbody>
</table>