bulma/docs/documentation/overview/modular.html

101 lines
2.3 KiB
HTML
Raw Normal View History

2016-09-23 21:08:03 +00:00
---
2017-07-29 12:02:00 +00:00
title: Modularity
2016-09-23 21:08:03 +00:00
layout: documentation
doc-tab: overview
doc-subtab: modular
---
2018-03-26 13:46:39 +00:00
{% include subnav/subnav-overview.html %}
2016-09-23 21:08:03 +00:00
<section class="section">
<div class="container">
<h1 class="title">Modular</h1>
<h2 class="subtitle">Just import what you <strong>need</strong></h2>
<hr>
<div class="content">
<p>
Bulma consists of <strong>39</strong> <code>.sass</code> files that you can import <strong>individually.</strong>
2016-09-23 21:08:03 +00:00
</p>
<p>
For example, let's say you only want the Bulma <strong>columns.</strong>
<br>
The file is located in the <code>bulma/sass/grid</code> folder.
<br>
2016-10-16 18:15:56 +00:00
Simply <strong>import</strong> the utilities dependencies, and then the files you need directly:
2016-09-23 21:08:03 +00:00
</p>
{% highlight sass %}
2016-12-16 09:58:47 +00:00
@import "bulma/sass/utilities/_all"
2016-10-16 18:15:56 +00:00
@import "bulma/sass/grid/columns"
2016-09-23 21:08:03 +00:00
{% endhighlight %}
<p>
Now you can use the classes <code>.columns</code> (for the container) and <code>.column</code> directly:
</p>
{% highlight html %}
<div class="columns">
<div class="column">1</div>
<div class="column">2</div>
<div class="column">3</div>
<div class="column">4</div>
<div class="column">5</div>
</div>
{% endhighlight %}
<hr>
<p>
What if you only want the <strong>button</strong> styles instead?
</p>
{% highlight sass %}
2017-01-30 17:42:10 +00:00
@import "bulma/sass/utilities/_all"
2016-09-23 21:08:03 +00:00
@import "bulma/sass/elements/button.sass"
{% endhighlight %}
<p>
You can now use the <code>.button</code> class, and all its modifiers:
</p>
<ul>
<li>
<code>.is-active</code>
</li>
<li>
<code>.is-primary</code>,
<code>.is-info</code>,
<code>.is-success</code>...
</li>
<li>
<code>.is-small</code>,
<code>.is-medium</code>,
<code>.is-large</code>
</li>
<li>
<code>.is-outlined</code>,
<code>.is-inverted</code>,
<code>.is-link</code>
</li>
<li>
<code>.is-loading</code>,
<code>[disabled]</code>
2016-09-23 21:08:03 +00:00
</li>
</ul>
{% highlight html %}
<a class="button">
Button
</a>
<a class="button is-primary">
Primary button
</a>
<a class="button is-large">
Large button
</a>
<a class="button is-loading">
Loading button
</a>
{% endhighlight %}
</div>
</div>
</section>