-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add example of select-only combobox (pull #1396) Resolves issue #1026 by adding a new select-only combobox example. Co-authored-by: Valerie Young <valerie@bocoup.com> Co-authored-by: Matt King <a11yThinker@gmail.com> Co-authored-by: Carolyn MacLeod <Carolyn_MacLeod@ca.ibm.com>
- Loading branch information
1 parent
c9074f4
commit fbc730a
Showing
11 changed files
with
1,005 additions
and
6 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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,103 @@ | ||
.combo *, | ||
.combo *::before, | ||
.combo *::after { | ||
box-sizing: border-box; | ||
} | ||
|
||
.combo { | ||
display: block; | ||
margin-bottom: 1.5em; | ||
max-width: 400px; | ||
position: relative; | ||
} | ||
|
||
.combo::after { | ||
border-bottom: 2px solid rgba(0, 0, 0, 0.75); | ||
border-right: 2px solid rgba(0, 0, 0, 0.75); | ||
content: ''; | ||
display: block; | ||
height: 12px; | ||
pointer-events: none; | ||
position: absolute; | ||
right: 16px; | ||
top: 50%; | ||
transform: translate(0, -65%) rotate(45deg); | ||
width: 12px; | ||
} | ||
|
||
.combo-input { | ||
background-color: #f5f5f5; | ||
border: 2px solid rgba(0, 0, 0, 0.75); | ||
border-radius: 4px; | ||
display: block; | ||
font-size: 1em; | ||
min-height: calc(1.4em + 26px); | ||
padding: 12px 16px 14px; | ||
text-align: left; | ||
width: 100%; | ||
} | ||
|
||
.open .combo-input { | ||
border-radius: 4px 4px 0 0; | ||
} | ||
|
||
.combo-input:focus { | ||
border-color: #0067b8; | ||
box-shadow: 0 0 4px 2px #0067b8; | ||
outline: 4px solid transparent; | ||
} | ||
|
||
.combo-label { | ||
display: block; | ||
font-size: 20px; | ||
font-weight: 100; | ||
margin-bottom: 0.25em; | ||
} | ||
|
||
.combo-menu { | ||
background-color: #f5f5f5; | ||
border: 1px solid rgba(0, 0, 0, 0.75); | ||
border-radius: 0 0 4px 4px; | ||
display: none; | ||
max-height: 300px; | ||
overflow-y:scroll; | ||
left: 0; | ||
position: absolute; | ||
top: 100%; | ||
width: 100%; | ||
z-index: 100; | ||
} | ||
|
||
.open .combo-menu { | ||
display: block; | ||
} | ||
|
||
.combo-option { | ||
padding: 10px 12px 12px; | ||
} | ||
|
||
.combo-option:hover { | ||
background-color: rgba(0, 0, 0, 0.1); | ||
} | ||
|
||
.combo-option.option-current { | ||
outline: 3px solid #0067b8; | ||
outline-offset: -3px; | ||
} | ||
|
||
.combo-option[aria-selected="true"] { | ||
padding-right: 30px; | ||
position: relative; | ||
} | ||
|
||
.combo-option[aria-selected="true"]::after { | ||
border-bottom: 2px solid #000; | ||
border-right: 2px solid #000; | ||
content: ''; | ||
height: 16px; | ||
position: absolute; | ||
right: 15px; | ||
top: 50%; | ||
transform: translate(0, -50%) rotate(45deg); | ||
width: 8px; | ||
} |
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
Oops, something went wrong.