From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 2C00C1FF13E for ; Fri, 20 Mar 2026 17:08:34 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 9A3291C152; Fri, 20 Mar 2026 17:08:50 +0100 (CET) From: Dominik Csapak To: yew-devel@lists.proxmox.com Subject: [RFC PATCH yew-widget-toolkit 1/3] widget: button: add 'icon_style' property Date: Fri, 20 Mar 2026 17:03:58 +0100 Message-ID: <20260320160816.4113364-2-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260320160816.4113364-1-d.csapak@proxmox.com> References: <20260320160816.4113364-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -1.024 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.408 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.819 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.903 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: UAAIXTA6LWQ2I7VOBSTFYIQBJVVX57GZ X-Message-ID-Hash: UAAIXTA6LWQ2I7VOBSTFYIQBJVVX57GZ X-MailFrom: d.csapak@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Yew framework devel list at Proxmox List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: so one can override the style of the icon, e.g. giving an explicit color without having to create a CSS class for that. Signed-off-by: Dominik Csapak --- src/widget/button.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/widget/button.rs b/src/widget/button.rs index 584f923..85b9e9d 100644 --- a/src/widget/button.rs +++ b/src/widget/button.rs @@ -64,6 +64,11 @@ pub struct Button { #[prop_or_default] pub icon_class: Option, + /// Icon CSS style. + #[prop_or_default] + #[builder(IntoPropValue, into_prop_value)] + pub icon_style: Option, + /// Html tabindex attribute. #[prop_or_default] #[builder(IntoPropValue, into_prop_value)] @@ -236,10 +241,11 @@ impl Component for PwtButton { }; if let Some(icon_class) = &props.icon_class { + let style = props.icon_style.clone(); if !icon_class.is_empty() { // Chromium fires onclick from nested elements, so we need to suppress that manually here children.push(html!{ - + }); } } -- 2.47.3