bulma/docs/documentation/start/syntax.html

187 lines
5.2 KiB
HTML
Raw Permalink Normal View History

2020-06-08 09:57:35 +00:00
---
2024-03-21 16:11:54 +00:00
title: Bulma's Modifiers Syntax
layout: docs
theme: start
doc-tab: start
doc-subtab: syntax
2020-06-08 09:57:35 +00:00
breadcrumb:
2024-03-21 16:11:54 +00:00
- home
- documentation
- start
- start-syntax
2020-06-08 09:57:35 +00:00
---
{% capture button_example %}
2024-03-21 16:11:54 +00:00
<button class="button">Button</button>
{% endcapture %} {% capture button_primary_example %}
<button class="button is-primary">Button</button>
{% endcapture %} {% capture button_colors %}
<button class="button is-primary">Button</button>
<button class="button is-link">Button</button>
<button class="button is-info">Button</button>
<button class="button is-success">Button</button>
<button class="button is-warning">Button</button>
<button class="button is-danger">Button</button>
{% endcapture %} {% capture button_sizes %}
<button class="button is-small">Button</button>
<button class="button">Button</button>
<button class="button is-medium">Button</button>
<button class="button is-large">Button</button>
{% endcapture %} {% capture button_states %}
<button class="button is-primary is-outlined">Button</button>
<button class="button is-loading">Button</button>
<button class="button" disabled>Button</button>
{% endcapture %} {% capture button_combinations %}
<button class="button is-primary is-small" disabled>Button</button>
<button class="button is-info is-loading">Button</button>
<button class="button is-danger is-outlined is-large">Button</button>
2020-06-08 09:57:35 +00:00
{% endcapture %}
<div class="columns">
<div class="column">
<p>
2024-03-21 16:11:54 +00:00
Let's start with a simple <strong>button</strong> that uses the
<code>"button"</code> CSS class:
2020-06-08 09:57:35 +00:00
</p>
</div>
2024-03-21 16:11:54 +00:00
<div class="column">
<p>{{button_example}}</p>
</div>
2020-06-08 09:57:35 +00:00
<div class="column is-half">
{% highlight html %}{{button_example}}{% endhighlight %}
</div>
</div>
<div class="columns">
<div class="column">
<p>
2024-03-21 16:11:54 +00:00
By <strong>adding</strong> the <code>"is-primary"</code> CSS class, you
can modify the <strong>color</strong>:
2020-06-08 09:57:35 +00:00
</p>
</div>
2024-03-21 16:11:54 +00:00
<div class="column">
<p>{{button_primary_example}}</p>
</div>
2020-06-08 09:57:35 +00:00
<div class="column is-half">
{% highlight html %}{{button_primary_example}}{% endhighlight %}
</div>
</div>
<div class="columns">
<div class="column">
<div class="content">
<p>You can use one of the <strong>6 main colors</strong>:</p>
<ul>
<li><code>is-primary</code></li>
<li><code>is-link</code></li>
<li><code>is-info</code></li>
<li><code>is-success</code></li>
<li><code>is-warning</code></li>
<li><code>is-danger</code></li>
</ul>
</div>
</div>
<div class="column">
<p class="field">
2021-09-19 00:23:53 +00:00
<button class="button is-primary">Button</button>
2020-06-08 09:57:35 +00:00
</p>
<p class="field">
2021-09-19 00:23:53 +00:00
<button class="button is-link">Button</button>
2020-06-08 09:57:35 +00:00
</p>
<p class="field">
2021-09-19 00:23:53 +00:00
<button class="button is-info">Button</button>
2020-06-08 09:57:35 +00:00
</p>
<p class="field">
2021-09-19 00:23:53 +00:00
<button class="button is-success">Button</button>
2020-06-08 09:57:35 +00:00
</p>
<p class="field">
2021-09-19 00:23:53 +00:00
<button class="button is-warning">Button</button>
2020-06-08 09:57:35 +00:00
</p>
<p class="field">
2021-09-19 00:23:53 +00:00
<button class="button is-danger">Button</button>
2020-06-08 09:57:35 +00:00
</p>
</div>
<div class="column is-half">
<div class="bd-highlight-full">
2020-06-08 09:57:35 +00:00
{% highlight html %}{{ button_colors }}{% endhighlight %}
</div>
</div>
</div>
<div class="columns">
<div class="column">
<div class="content">
<p>You can also alter the <strong>size</strong>:</p>
<ul>
<li><code>is-small</code></li>
<li><code>is-medium</code></li>
<li><code>is-large</code></li>
</ul>
</div>
</div>
<div class="column">
<p class="field">
2021-09-19 00:23:53 +00:00
<button class="button is-small">Button</button>
2020-06-08 09:57:35 +00:00
</p>
<p class="field">
2021-09-19 00:23:53 +00:00
<button class="button">Button</button>
2020-06-08 09:57:35 +00:00
</p>
<p class="field">
2021-09-19 00:23:53 +00:00
<button class="button is-medium">Button</button>
2020-06-08 09:57:35 +00:00
</p>
<p class="field">
2021-09-19 00:23:53 +00:00
<button class="button is-large">Button</button>
2020-06-08 09:57:35 +00:00
</p>
</div>
<div class="column is-half">
{% highlight html %}{{ button_sizes }}{% endhighlight %}
</div>
</div>
<div class="columns">
<div class="column">
<div class="content">
<p>Or the <strong>style</strong> or <strong>state</strong>:</p>
<ul>
<li><code>is-outlined</code></li>
<li><code>is-loading</code></li>
<li><code>[disabled]</code></li>
</ul>
</div>
</div>
<div class="column">
<p class="field">
2021-09-19 00:23:53 +00:00
<button class="button is-primary is-outlined">Button</button>
2020-06-08 09:57:35 +00:00
</p>
<p class="field">
2021-09-19 00:23:53 +00:00
<button class="button is-loading">Button</button>
2020-06-08 09:57:35 +00:00
</p>
<p class="field">
2021-09-19 00:23:53 +00:00
<button class="button" disabled>Button</button>
2020-06-08 09:57:35 +00:00
</p>
</div>
<div class="column is-half">
{% highlight html %}{{ button_states }}{% endhighlight %}
</div>
</div>
<div class="columns">
<div class="column">
<div class="content">
As a result, it's very easy to <strong>combine modifiers:</strong>
</div>
</div>
<div class="column">
<p class="field">
2021-09-19 00:23:53 +00:00
<button class="button is-primary is-small" disabled>Button</button>
2020-06-08 09:57:35 +00:00
</p>
<p class="field">
2021-09-19 00:23:53 +00:00
<button class="button is-info is-loading">Button</button>
2020-06-08 09:57:35 +00:00
</p>
<p class="field">
2021-09-19 00:23:53 +00:00
<button class="button is-danger is-outlined is-large">Button</button>
2020-06-08 09:57:35 +00:00
</p>
</div>
<div class="column is-half">
{% highlight html %}{{ button_combinations }}{% endhighlight %}
</div>
</div>