---
{% capture dropdown_example %}
-<div class="dropdown">
+<div class="dropdown is-active">
<div class="dropdown-trigger">
<a class="button">
<span>Dropdown button</span>
<a class="dropdown-item">
Other dropdown item
</a>
+ <a class="dropdown-item is-active">
+ Active dropdown item
+ </a>
+ <a class="dropdown-item">
+ Other dropdown item
+ </a>
<hr class="dropdown-divider">
<a class="dropdown-item">
With a divider
</div>
{% endcapture %}
+{% capture dropdown_content_example %}
+<div class="dropdown is-active">
+ <div class="dropdown-trigger">
+ <a class="button is-info">
+ <span>Content</span>
+ <span class="icon is-small">
+ <i class="fa fa-angle-down"></i>
+ </span>
+ </a>
+ </div>
+ <div class="dropdown-menu">
+ <div class="dropdown-content">
+ <div class="dropdown-item">
+ <p>You can insert <strong>any type of content</strong> within the dropdown menu.</p>
+ </div>
+ <hr class="dropdown-divider">
+ <div class="dropdown-item">
+ <p>You simply need to use a <code><div></code> instead.</p>
+ </div>
+ <hr class="dropdown-divider">
+ <a class="dropdown-item">
+ This is a link
+ </a>
+ </div>
+ </div>
+</div>
+{% endcapture %}
+
{% capture dropdown_click_example %}
<div class="dropdown">
<div class="dropdown-trigger">
</div>
</div>
- {{dropdown_click_example}}
- {{dropdown_info_example}}
+ <hr>
+
+ <h3 class="title">
+ Dropdown content
+ </h3>
+
+ <div class="content">
+ <p>
+ While the <code>dropdown-item</code> can be used as an anchor link <code><a></code>, you can also use a <code><div></code> and insert almost <strong>any type of content</strong>.
+ </p>
+ </div>
+
+ <div class="columns">
+ <div class="column is-half">
+ {{dropdown_content_example}}
+ </div>
+ <div class="column is-half">
+ {% highlight html %}{{dropdown_content_example}}{% endhighlight %}
+ </div>
+ </div>
+
+ <hr>
+
+ <h3 class="title">
+ Hoverable or Toggable
+ </h3>
+
+ <div class="content">
+ <p>
+ The <code>dropdown</code> component has <strong>2 additional modifiers</strong>
+ </p>
+ <ul>
+ <li>
+ <code>is-hoverable</code>: the dropdown will show up when <strong>hovering</strong> the <code>dropdown-trigger</code>
+ </li>
+ <li>
+ <code>is-active</code>: the dropdown will show up <strong>all the time</strong>
+ </li>
+ </ul>
+ </div>
+
+ <div class="message is-success">
+ <p class="message-body">
+ While the CSS <code>:hover</code> implementation works perfectly, the <code>is-active</code> class is available for users who want to control the display of the dropdown with <strong>JavaScript</strong>.
+ </p>
+ </div>
+
+ <div class="columns">
+ <div class="column is-half">
+ {{dropdown_click_example}}{{dropdown_info_example}}
+ </div>
+ <div class="column is-half">
+ {% highlight html %}{{dropdown_click_example}}{{dropdown_info_example}}{% endhighlight %}
+ </div>
+ </div>
</div>
</section>
$dropdown-item: $grey-dark !default
$dropdown-item-hover: $black !default
$dropdown-item-hover-background: $background !default
-$dropdown-item-active: $black !default
-$dropdown-item-active-background: transparent !default
+$dropdown-item-active: $primary-invert !default
+$dropdown-item-active-background: $primary !default
$dropdown-divider-background: $border !default
a.dropdown-item
padding-right: 3rem
white-space: nowrap
- &:hover,
- &.is-active
+ &:hover
background-color: $dropdown-item-hover-background
color: $dropdown-item-hover
+ &.is-active
+ background-color: $dropdown-item-active-background
+ color: $dropdown-item-active
.dropdown-divider
background-color: $dropdown-divider-background