From 11fc7f3441dac4eba2ae576342181697d2658a39 Mon Sep 17 00:00:00 2001 From: Kevin Hoyt Date: Tue, 16 Jan 2024 10:39:46 -0700 Subject: [PATCH] Further refinements on select Icon sizing when only label line is present. Color "label" option as red when invalid. --- components/select-option.js | 6 ++++++ components/select.js | 5 +++++ test/select.html | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/components/select-option.js b/components/select-option.js index 3c05464..0f25239 100644 --- a/components/select-option.js +++ b/components/select-option.js @@ -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: diff --git a/components/select.js b/components/select.js index 9aa91d2..a179761 100644 --- a/components/select.js +++ b/components/select.js @@ -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; } diff --git a/test/select.html b/test/select.html index 9f0c2f7..23b4976 100644 --- a/test/select.html +++ b/test/select.html @@ -22,7 +22,7 @@


- +
 <rf-icon name="settings"></rf-icon>