-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from khang-nd/combobox
feat: add combobox, listbox components
- Loading branch information
Showing
7 changed files
with
208 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
:root { | ||
--combobox-chevron-size: 4px; | ||
} | ||
|
||
.combobox { | ||
position: relative; | ||
display: inline-block; | ||
|
||
input[type="text"] { | ||
padding-right: 20px; | ||
width: 100%; | ||
} | ||
|
||
button { | ||
position: absolute; | ||
right: 0; | ||
padding: 0; | ||
min-width: 16px; | ||
border-top-left-radius: 0; | ||
border-bottom-left-radius: 0; | ||
|
||
&::before { | ||
content: ""; | ||
position: absolute; | ||
top: calc(50% - var(--combobox-chevron-size) / 4); | ||
left: calc(50% - var(--combobox-chevron-size)); | ||
border: var(--combobox-chevron-size) solid transparent; | ||
border-top-color: #000; | ||
border-radius: 2px; | ||
} | ||
|
||
&:focus { | ||
box-shadow: none; | ||
outline: none; | ||
} | ||
} | ||
} |
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,34 @@ | ||
[role="listbox"], | ||
select[multiple] { | ||
background: #fff; | ||
border: 1px solid #c0c1cd; | ||
display: block; | ||
font: var(--font); | ||
overflow-y: scroll; | ||
|
||
&.has-shadow { | ||
box-shadow: 4px 4px 3px -2px #999; | ||
} | ||
|
||
&.has-hover { | ||
li:hover { | ||
background-color: #2a90ff; | ||
color: #fff; | ||
} | ||
} | ||
|
||
&:focus { | ||
outline: none; | ||
} | ||
|
||
[role="option"], | ||
option { | ||
padding: 2px; | ||
|
||
&[aria-selected], | ||
&:focus { | ||
background-color: #2a90ff; | ||
color: #fff; | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
select { | ||
select:not([multiple]) { | ||
font: var(--font); | ||
padding: 2px 3px; | ||
border: var(--button-border); | ||
|
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
@import "_collapse.scss"; | ||
|
||
:root { | ||
--treeview-square-size: 8px; | ||
--treeview-spacing: 20px; | ||
|
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
d58e1a4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
7css – ./
7css-khangnd.vercel.app
7css-git-main-khangnd.vercel.app
7css.vercel.app