bulma/docs/documentation/columns/gap.html

223 lines
6.6 KiB
HTML
Raw Normal View History

2017-08-14 18:12:07 +00:00
---
title: Columns gap
2024-03-21 16:11:54 +00:00
layout: docs
theme: library
doc-library: true
2017-08-14 18:12:07 +00:00
doc-tab: columns
doc-subtab: gap
2018-04-09 11:45:52 +00:00
breadcrumb:
2024-03-21 16:11:54 +00:00
- home
- documentation
- columns
- columns-gap
2017-08-14 18:12:07 +00:00
---
2017-08-14 22:52:28 +00:00
{% capture columns_default_gap %}
2017-08-14 18:12:07 +00:00
<div class="columns">
<div class="column">
2024-03-21 16:11:54 +00:00
<p class="bd-notification is-primary">Default gap</p>
2017-08-14 18:12:07 +00:00
</div>
<div class="column">
2024-03-21 16:11:54 +00:00
<p class="bd-notification is-primary">Default gap</p>
2017-08-14 18:12:07 +00:00
</div>
<div class="column">
2024-03-21 16:11:54 +00:00
<p class="bd-notification is-primary">Default gap</p>
2017-08-14 18:12:07 +00:00
</div>
<div class="column">
2024-03-21 16:11:54 +00:00
<p class="bd-notification is-primary">Default gap</p>
2017-08-14 22:52:28 +00:00
</div>
</div>
{% endcapture %}
{% capture columns_gapless %}
<div class="columns is-gapless">
2024-03-21 16:11:54 +00:00
<div class="column">No gap</div>
<div class="column">No gap</div>
<div class="column">No gap</div>
<div class="column">No gap</div>
2017-08-14 22:52:28 +00:00
</div>
{% endcapture %}
2024-07-06 14:42:36 +00:00
{% capture columns_variable_gap %}
<div class="columns is-8">
<div class="column">Column</div>
<div class="column">Column</div>
<div class="column">Column</div>
<div class="column">Column</div>
</div>
{% endcapture %}
2017-08-14 22:52:28 +00:00
{% capture columns_gapless_multiline %}
<div class="columns is-gapless is-multiline is-mobile">
2024-03-21 16:11:54 +00:00
<div class="column is-one-quarter">is-one-quarter</div>
<div class="column is-one-quarter">is-one-quarter</div>
<div class="column is-one-quarter">is-one-quarter</div>
<div class="column is-one-quarter">is-one-quarter</div>
<div class="column is-half">is-half</div>
<div class="column is-one-quarter">is-one-quarter</div>
<div class="column is-one-quarter">is-one-quarter</div>
<div class="column is-one-quarter">is-one-quarter</div>
<div class="column">Auto</div>
2017-08-14 18:12:07 +00:00
</div>
{% endcapture %}
{% capture columns_variable_responsive_gaps %}
2024-07-06 14:42:36 +00:00
<div class="columns is-1-mobile is-0-tablet is-3-desktop is-8-widescreen is-2-fullhd">
2024-03-21 16:11:54 +00:00
<div class="column">Column</div>
<div class="column">Column</div>
<div class="column">Column</div>
<div class="column">Column</div>
<div class="column">Column</div>
<div class="column">Column</div>
</div>
{% endcapture %}
2024-03-21 16:11:54 +00:00
{% include docs/elements/anchor.html name="Default gap" %}
2017-08-14 18:12:07 +00:00
2018-04-09 11:45:52 +00:00
<div class="content">
<p>
2024-03-21 16:11:54 +00:00
Each column has a <strong>gap</strong> equal to the <strong>variable</strong> <code>$column-gap</code>, which has a
default value of <code>0.75rem</code>.
2018-04-09 11:45:52 +00:00
<br>
2024-03-21 16:11:54 +00:00
Since the gap is on <em>each side</em> of a column, the gap between two adjacent columns will be twice the value of
<code>$column-gap</code>, or <code>1.5rem</code> by default.
2018-04-09 11:45:52 +00:00
</p>
</div>
2017-08-14 22:52:28 +00:00
2018-04-09 11:45:52 +00:00
{{ columns_default_gap }}
2024-03-21 16:11:54 +00:00
{% include docs/elements/anchor.html name="Gapless" %}
2017-08-14 22:52:28 +00:00
2018-04-09 11:45:52 +00:00
<div class="content">
<p>
2024-03-21 16:11:54 +00:00
If you want to remove the <strong>space</strong> between the columns, add the <code>is-gapless</code> modifier on
the <code>columns</code> container:
2018-04-09 11:45:52 +00:00
</p>
</div>
2017-08-14 22:52:28 +00:00
2018-04-09 11:45:52 +00:00
<div class="columns is-gapless">
<div class="column">
2018-04-10 10:45:48 +00:00
<p class="bd-notification is-primary">First column</p>
2018-04-09 11:45:52 +00:00
</div>
<div class="column">
2018-04-10 10:45:48 +00:00
<p class="bd-notification is-primary">Second column</p>
2018-04-09 11:45:52 +00:00
</div>
<div class="column">
2018-04-10 10:45:48 +00:00
<p class="bd-notification is-primary">Third column</p>
2018-04-09 11:45:52 +00:00
</div>
<div class="column">
2018-04-10 10:45:48 +00:00
<p class="bd-notification is-primary">Fourth column</p>
2018-04-09 11:45:52 +00:00
</div>
</div>
2017-08-14 22:52:28 +00:00
<div class="bd-highlight-full">
2024-03-21 16:11:54 +00:00
{% highlight html -%}
{{- columns_gapless -}}
{%- endhighlight %}
2018-04-09 11:45:52 +00:00
</div>
2017-08-14 22:52:28 +00:00
2018-04-09 11:45:52 +00:00
<div class="content">
<p>You can combine it with the <code>is-multiline</code> modifier:</p>
</div>
2017-08-14 22:52:28 +00:00
2018-04-09 11:45:52 +00:00
<div class="columns is-multiline is-mobile is-gapless">
<div class="column is-one-quarter">
2018-04-10 10:45:48 +00:00
<p class="bd-notification is-primary"><code>is-one-quarter</code></p>
2018-04-09 11:45:52 +00:00
</div>
<div class="column is-one-quarter">
2018-04-10 10:45:48 +00:00
<p class="bd-notification is-primary"><code>is-one-quarter</code></p>
2018-04-09 11:45:52 +00:00
</div>
<div class="column is-one-quarter">
2018-04-10 10:45:48 +00:00
<p class="bd-notification is-primary"><code>is-one-quarter</code></p>
2018-04-09 11:45:52 +00:00
</div>
<div class="column is-one-quarter">
2018-04-10 10:45:48 +00:00
<p class="bd-notification is-primary"><code>is-one-quarter</code></p>
2018-04-09 11:45:52 +00:00
</div>
<div class="column is-half">
2018-04-10 10:45:48 +00:00
<p class="bd-notification is-primary"><code>is-half</code></p>
2018-04-09 11:45:52 +00:00
</div>
<div class="column is-one-quarter">
2018-04-10 10:45:48 +00:00
<p class="bd-notification is-primary"><code>is-one-quarter</code></p>
2018-04-09 11:45:52 +00:00
</div>
<div class="column is-one-quarter">
2018-04-10 10:45:48 +00:00
<p class="bd-notification is-primary"><code>is-one-quarter</code></p>
2018-04-09 11:45:52 +00:00
</div>
<div class="column is-one-quarter">
2018-04-10 10:45:48 +00:00
<p class="bd-notification is-primary"><code>is-one-quarter</code></p>
2018-04-09 11:45:52 +00:00
</div>
<div class="column">
2018-04-10 10:45:48 +00:00
<p class="bd-notification is-primary">Auto</p>
2018-04-09 11:45:52 +00:00
</div>
</div>
2017-08-14 22:52:28 +00:00
<div class="bd-highlight-full">
2024-03-21 16:11:54 +00:00
{% highlight html -%}
{{- columns_gapless_multiline -}}
{%- endhighlight %}
2018-04-09 11:45:52 +00:00
</div>
2017-08-14 22:52:28 +00:00
2024-03-21 16:11:54 +00:00
{% include docs/elements/anchor.html name="Variable gap" %}
2017-08-14 22:52:28 +00:00
2018-04-09 11:45:52 +00:00
<div class="content">
<p>
2024-03-21 16:11:54 +00:00
You can specify a <strong>custom column gap</strong> by appending one of <strong>9 modifiers</strong> on the
<code>.columns</code> container.
2018-04-09 11:45:52 +00:00
</p>
<ul>
2024-03-21 16:11:54 +00:00
<li><code>is-0</code> will remove any gap (similar to <code>is-gapless</code>)</li>
<li><code>is-3</code> is the <strong>default value</strong>, equivalent to the <code>0.75rem</code> value</li>
<li><code>is-8</code> is the maximum gap of <code>2rem</code></li>
2018-04-09 11:45:52 +00:00
</ul>
</div>
2017-08-14 22:52:28 +00:00
2024-07-06 14:42:36 +00:00
<div class="bd-highlight-full">
{% highlight html -%}
{{- columns_variable_gap -}}
{%- endhighlight %}
2018-04-09 11:45:52 +00:00
</div>
2017-12-04 21:03:01 +00:00
2024-07-06 14:42:36 +00:00
{% include docs/content/klmn.html %}
2024-03-21 16:11:54 +00:00
{% assign vernum = site.data.meta.version | downcase | remove: '.' | plus: 0 %}
{% if vernum >= 72 %}
2024-03-21 16:11:54 +00:00
{%
2024-07-06 14:42:36 +00:00
include docs/elements/anchor.html name="Breakpoint based column gaps"
2024-03-21 16:11:54 +00:00
%}
2024-03-21 16:11:54 +00:00
<div class="content">
<p>You can define a column gap for each viewport size:</p>
2024-03-21 16:11:54 +00:00
<p>
For example, here's how it looks with the following modifiers:
2024-07-06 14:42:36 +00:00
<code>is-2-mobile is-0-tablet is-3-desktop is-8-widescreen is-1-fullhd</code>
2024-03-21 16:11:54 +00:00
</p>
</div>
2024-03-21 16:11:54 +00:00
<div class="bd-highlight-full">
2024-07-06 14:42:36 +00:00
{%- highlight html -%}
2024-03-21 16:11:54 +00:00
{{- columns_variable_responsive_gaps -}}
2024-07-06 14:42:36 +00:00
{%- endhighlight -%}
</div>
2024-07-06 14:42:36 +00:00
<div class="columns is-1-mobile is-0-tablet is-3-desktop is-8-widescreen is-2-fullhd">
2024-03-21 16:11:54 +00:00
<div class="column">
<p class="bd-notification is-primary">Column</p>
</div>
<div class="column">
<p class="bd-notification is-primary">Column</p>
</div>
<div class="column">
<p class="bd-notification is-primary">Column</p>
</div>
<div class="column">
<p class="bd-notification is-primary">Column</p>
</div>
<div class="column">
<p class="bd-notification is-primary">Column</p>
</div>
<div class="column">
<p class="bd-notification is-primary">Column</p>
</div>
</div>
2024-03-21 16:11:54 +00:00
<div class="message is-info">
<p class="message-body">
If you want to see the difference, resize your browser and see how the
<strong>columns gap</strong> varies.
</p>
</div>
{% endif %}