From 5f2b84089961e10ffe0df82c2c7b53d552dee1d9 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Thu, 17 Jul 2025 22:37:16 -0400 Subject: [PATCH] Add styling to icons in state color button module --- bubble/State Color Button/code.js | 7 +++++++ bubble/State Color Button/import.yaml | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/bubble/State Color Button/code.js b/bubble/State Color Button/code.js index 2743725..fa3ea86 100644 --- a/bubble/State Color Button/code.js +++ b/bubble/State Color Button/code.js @@ -21,6 +21,13 @@ mainButton.style.transition = 'background-color 1s'; } + // Icon color + const icon = card?.querySelector('.bubble-icon'); + if (icon) { + icon.style.color = state === 'on' ? on_color : 'var(--bubble-main-icon-color)'; + icon.style.transition = 'color 1s'; + } + // Unavailable state if (mainButton && state === 'unavailable') { mainButton.style.opacity = '0.5'; diff --git a/bubble/State Color Button/import.yaml b/bubble/State Color Button/import.yaml index ba40af6..14cb57d 100644 --- a/bubble/State Color Button/import.yaml +++ b/bubble/State Color Button/import.yaml @@ -1,6 +1,6 @@ state_color_button: name: State Color Button - version: 1.1.2 + version: 1.1.3 creator: Tony Stork supported: - button @@ -37,6 +37,13 @@ state_color_button: mainButton.style.transition = 'background-color 1s'; } + // Icon color + const icon = card?.querySelector('.bubble-icon'); + if (icon) { + icon.style.color = state === 'on' ? on_color : 'var(--bubble-main-icon-color)'; + icon.style.transition = 'color 1s'; + } + // Unavailable state if (mainButton && state === 'unavailable') { mainButton.style.opacity = '0.5';