-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
/
Copy pathgap.html
283 lines (252 loc) · 7.19 KB
/
gap.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
---
title: Columns gap
layout: documentation
doc-tab: columns
doc-subtab: gap
breadcrumb:
- home
- documentation
- columns
- columns-gap
---
{% capture columns_default_gap %}
<div class="columns">
<div class="column">
<p class="bd-notification is-primary">
Default gap
</p>
</div>
<div class="column">
<p class="bd-notification is-primary">
Default gap
</p>
</div>
<div class="column">
<p class="bd-notification is-primary">
Default gap
</p>
</div>
<div class="column">
<p class="bd-notification is-primary">
Default gap
</p>
</div>
</div>
{% endcapture %}
{% capture columns_gapless %}
<div class="columns is-gapless">
<div class="column">
No gap
</div>
<div class="column">
No gap
</div>
<div class="column">
No gap
</div>
<div class="column">
No gap
</div>
</div>
{% endcapture %}
{% capture columns_gapless_multiline %}
<div class="columns is-gapless is-multiline is-mobile">
<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>
</div>
{% endcapture %}
{% capture columns_variable_responsive_gaps %}
<div class="columns is-variable is-1-mobile is-0-tablet is-3-desktop is-8-widescreen is-2-fullhd">
<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 %}
{% include elements/anchor.html name="Default gap" %}
<div class="content">
<p>
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>.
<br>
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.
</p>
</div>
{{ columns_default_gap }}
{% include elements/anchor.html name="Gapless" %}
<div class="content">
<p>
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:
</p>
</div>
<div class="columns is-gapless">
<div class="column">
<p class="bd-notification is-primary">First column</p>
</div>
<div class="column">
<p class="bd-notification is-primary">Second column</p>
</div>
<div class="column">
<p class="bd-notification is-primary">Third column</p>
</div>
<div class="column">
<p class="bd-notification is-primary">Fourth column</p>
</div>
</div>
<div class="highlight-full">
{% highlight html %}{{ columns_gapless }}{% endhighlight %}
</div>
<div class="content">
<p>You can combine it with the <code>is-multiline</code> modifier:</p>
</div>
<div class="columns is-multiline is-mobile is-gapless">
<div class="column is-one-quarter">
<p class="bd-notification is-primary"><code>is-one-quarter</code></p>
</div>
<div class="column is-one-quarter">
<p class="bd-notification is-primary"><code>is-one-quarter</code></p>
</div>
<div class="column is-one-quarter">
<p class="bd-notification is-primary"><code>is-one-quarter</code></p>
</div>
<div class="column is-one-quarter">
<p class="bd-notification is-primary"><code>is-one-quarter</code></p>
</div>
<div class="column is-half">
<p class="bd-notification is-primary"><code>is-half</code></p>
</div>
<div class="column is-one-quarter">
<p class="bd-notification is-primary"><code>is-one-quarter</code></p>
</div>
<div class="column is-one-quarter">
<p class="bd-notification is-primary"><code>is-one-quarter</code></p>
</div>
<div class="column is-one-quarter">
<p class="bd-notification is-primary"><code>is-one-quarter</code></p>
</div>
<div class="column">
<p class="bd-notification is-primary">Auto</p>
</div>
</div>
<div class="highlight-full">
{% highlight html %}{{ columns_gapless_multiline }}{% endhighlight %}
</div>
{% include elements/anchor.html name="Variable gap" %}
<div class="field is-grouped is-grouped-multiline">
<div class="control">
<div class="tags">
<span class="tag is-warning">Experimental</span>
</div>
</div>
</div>
<div class="content">
<p>
You can specify a <strong>custom column gap</strong> by appending one of <strong>9 modifiers</strong> on the <code>.columns</code> container.
</p>
<ul>
<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>
</ul>
<p>
Additionally, <code>.is-variable</code> should be added on the <code>.columns</code> container.
</p>
</div>
{% include content/klmn.html %}
<div class="message is-warning">
<div class="message-body">
<p>
This feature is only available in browsers that support <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables">CSS Variables</a>:
</p>
</div>
</div>
<div class="message is-info">
<div class="message-body">
<p>
If your Sass setup doesn't support CSS Variables, you can <strong>disable this feature</strong> by setting <code>$variable-columns</code> to <code>false</code>.
</p>
</div>
</div>
{% assign vernum = site.data.meta.version | downcase | remove: "." | plus: 0 %}
{% if vernum >= 72 %}
{% include elements/anchor.html name="Breakpoint based column gaps" %}
{% include elements/new-tag.html version="0.7.2" %}
<div class="content">
<p>
You can define a column gap for each viewport size:
</p>
</div>
For example, here's how it looks with the following modifiers: <code>is-variable is-2-mobile is-0-tablet is-3-desktop is-8-widescreen is-1-fullhd</code>
<div class="highlight-full">
{% highlight html %}{{ columns_variable_responsive_gaps }}{% endhighlight %}
</div>
<div class="columns is-variable is-1-mobile is-0-tablet is-3-desktop is-8-widescreen is-2-fullhd">
<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>
<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 %}