Skip to content

Commit

Permalink
feat(dropdown): support dropup option (#658)
Browse files Browse the repository at this point in the history
Fixes #618.
  • Loading branch information
asudoh authored and marijohannessen committed Mar 20, 2018
1 parent 43eded4 commit 1392cf4
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/components/dropdown/_dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@
}
}

.#{$prefix}--dropdown--up {
&.#{$prefix}--dropdown--open:focus {
box-shadow: 0 1px 0 0 $brand-01, 1px 0 0 0 $brand-01, -1px 0 0 0 $brand-01;

.#{$prefix}--dropdown-list {
box-shadow: 0 -1px 0 0 $brand-01, 1px 0 0 0 $brand-01, -1px 0 0 0 $brand-01;
}
}

.#{$prefix}--dropdown-list {
bottom: 2.5rem;
}
}

.#{$prefix}--dropdown__arrow {
fill: $brand-01;
position: absolute;
Expand Down
25 changes: 25 additions & 0 deletions src/components/dropdown/dropdown--up.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<ul data-dropdown data-value class="bx--dropdown bx--dropdown--up" tabindex="0">
<li class="bx--dropdown-text">Dropdown label</li>
<svg class="bx--dropdown__arrow" width="10" height="5" viewBox="0 0 10 5" fill-rule="evenodd">
<path d="M10 0L5 5 0 0z"></path>
</svg>
<li>
<ul class="bx--dropdown-list">
<li data-option data-value="all" class="bx--dropdown-item">
<a class="bx--dropdown-link" href="javascript:void(0)">Option 1</a>
</li>
<li data-option data-value="cloudFoundry" class="bx--dropdown-item">
<a class="bx--dropdown-link" href="javascript:void(0)">Option 2</a>
</li>
<li data-option data-value="staging" class="bx--dropdown-item">
<a class="bx--dropdown-link" href="javascript:void(0)">Option 3</a>
</li>
<li data-option data-value="dea" class="bx--dropdown-item">
<a class="bx--dropdown-link" href="javascript:void(0)">Option 4</a>
</li>
<li data-option data-value="router" class="bx--dropdown-item">
<a class="bx--dropdown-link" href="javascript:void(0)">Option 5</a>
</li>
</ul>
</li>
</ul>

0 comments on commit 1392cf4

Please sign in to comment.