Skip to content

Commit

Permalink
feat(inline-select): Add inline-select component (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
tw15egan authored and marijohannessen committed May 26, 2017
1 parent d37fc06 commit 6197fda
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/components/select/_select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
display: block;
width: 100%;
padding: .75rem 2.75rem .75rem 1rem;
height: rem(40px);
color: $text-01;
background-color: $field-01;
border: none;
Expand Down Expand Up @@ -72,3 +71,25 @@
}
}
}

.bx--select--inline {
display: flex;
align-items: center;

.bx--label {
white-space: nowrap;
margin: 0 .5rem 0 0;
font-weight: 400;
}

.bx--select-input {
background-color: transparent;
color: $brand-01;
font-weight: 600;

&:disabled ~ * {
opacity: .5;
cursor: not-allowed;
}
}
}
20 changes: 20 additions & 0 deletions src/components/select/inline-select.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<div class="bx--form-item">
<div class="bx--select bx--select--inline">
<label for="select-id" class="bx--label">Select label</label>
<select id="select-id" class="bx--select-input">
<option class="bx--select-option" disabled selected hidden>Pick an option</option>
<option class="bx--select-option" value="solong">A much longer option that is worth having around to check how text flows</option>
<optgroup class="bx--select-optgroup" label="Category 1">
<option class="bx--select-option" value="option1">Option 1</option>
<option class="bx--select-option" value="option2">Option 2</option>
</optgroup>
<optgroup class="bx--select-optgroup" label="Category 2">
<option class="bx--select-option" value="option1">Option 1</option>
<option class="bx--select-option" value="option2">Option 2</option>
</optgroup>
</select>
<svg class="bx--select__arrow">
<use xlink:href="/carbon-icons/bluemix-icons.svg#icon--caret--down"></use>
</svg>
</div>
</div>

0 comments on commit 6197fda

Please sign in to comment.