-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(select): Styled select elements, both inline and as a list item
- Loading branch information
1 parent
9725793
commit 8a12f2d
Showing
4 changed files
with
194 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
|
||
/** | ||
* Select | ||
* -------------------------------------------------- | ||
*/ | ||
|
||
|
||
// shared styles for transparent select elements | ||
.select-inline select, | ||
.item-select select { | ||
@include appearance(none); | ||
border: none; | ||
background: transparent; | ||
color: #333; | ||
|
||
// hack to hide default dropdown arrow in FF | ||
text-indent: 1px; | ||
text-overflow: ''; | ||
|
||
white-space: nowrap; | ||
font-size: $font-size-base; | ||
} | ||
|
||
.select-inline { | ||
position: relative; | ||
display: inline-block; | ||
overflow: hidden; | ||
border: $input-border-width solid $input-border; | ||
border-radius: 2px; | ||
background-color: $input-bg; | ||
color: $input-color; | ||
|
||
vertical-align: middle; | ||
font-size: $font-size-base; | ||
line-height: $font-size-base + 2; | ||
|
||
select { | ||
padding: 6px 25px 7px 8px; | ||
} | ||
} | ||
|
||
.select-inline + .select-inline { | ||
margin-left: 6px; | ||
} | ||
|
||
.item-select { | ||
position: static; // required for Android 2.3 | ||
|
||
select { | ||
position: absolute; | ||
top: 0; | ||
right: 0; | ||
padding: ($item-padding - 2) ($item-padding * 3) ($item-padding) 5px; | ||
width: 100%; | ||
direction: rtl; // right align the select text | ||
|
||
&:focus { | ||
min-width: 20%; | ||
width: auto; // shrink width when opened | ||
} | ||
} | ||
} | ||
|
||
|
||
// shared styles for dropdown arrow | ||
.select-inline:after, | ||
.item-select:after { | ||
position: absolute; | ||
top: 50%; | ||
margin-top: -3px; | ||
width: 0; | ||
height: 0; | ||
border-top: 5px solid; | ||
border-right: 5px solid rgba(0, 0, 0, 0); | ||
border-left: 5px solid rgba(0, 0, 0, 0); | ||
color: #999; | ||
content: ""; | ||
pointer-events: none; | ||
} | ||
|
||
.select-inline:after { | ||
right: 7px; | ||
} | ||
|
||
.item-select:after { | ||
right: $item-padding; | ||
} | ||
|
||
select { | ||
&[multiple], | ||
&[size] { | ||
height: auto; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,7 @@ | |
"toggle", | ||
"radio", | ||
"range", | ||
"select", | ||
"progress", | ||
|
||
// Buttons | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters