Skip to content

Commit

Permalink
Further refinements on select
Browse files Browse the repository at this point in the history
Icon sizing when only label line is present. Color "label" option as red when invalid.
  • Loading branch information
krhoyt committed Jan 16, 2024
1 parent eb84419 commit 11fc7f3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions components/select-option.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ export default class RainforestSelectOption extends HTMLElement {
:host( :not( [description] ) ) p[part=description],
:host( :not( [icon-name] ) ) img[part=icon] { display: none; }
:host( [icon-name]:not( [description] ) ) img[part=icon] {
align-self: center;
height: 16px;
width: 16px;
}
:host( [disabled] ) img {
cursor: not-allowed;
filter:
Expand Down
5 changes: 5 additions & 0 deletions components/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ export default class RainforestSelect extends HTMLElement {
border-left-width: 8px;
}
:host( [invalid] ) p[part=value] {
color: #d91515;
padding: 0 0 0 7px;
}
:host( [invalid] ) rf-select-option::part( item ) {
padding: 2px 0 2px 4px;
}
Expand Down
2 changes: 1 addition & 1 deletion test/select.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<rf-select></rf-select><br>
<rf-select></rf-select><br>
<rf-select></rf-select><br>
<rf-select placeholder="Choose an item" trigger-variant="option"></rf-select>
<rf-select trigger-variant="option"></rf-select>
<br>
<pre>
&lt;rf-icon name="settings"&gt;&lt;/rf-icon&gt;
Expand Down

0 comments on commit 11fc7f3

Please sign in to comment.