public inbox for yew-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH yew-widget-toolkit/yew-widget-toolkit-assets 0/2] Make the menu option indet match the icon width.
@ 2026-12-01 12:47 Shannon Sterz
  2026-12-01 12:47 ` [PATCH yew-widget-toolkit-assets 1/2] navigation: menu: use a css variable for the font-size of nav icons Shannon Sterz
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Shannon Sterz @ 2026-12-01 12:47 UTC (permalink / raw)
  To: yew-devel

Changelog
---------

* v1: https://lore.proxmox.com/yew-devel/20261201110250.105081-1-s.sterz@proxmox.com/T/

+ changes since v1 (thanks @ Dominik Csapak):

    - use a css variable to store icon font-size and reuse it for the
      width calculation


pwt-assets:

Shannon Sterz (1):
  navigation: menu: use a css variable for the font-size of nav icons

 scss/_nav.scss | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)


yew-comp:

Shannon Sterz (1):
  widget: navigation drawer: match menu item indents with the icon width

 src/widget/nav/navigation_drawer.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


Summary over all repositories:
  2 files changed, 4 insertions(+), 2 deletions(-)

-- 
Generated by murpp 0.12.0




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH yew-widget-toolkit-assets 1/2] navigation: menu: use a css variable for the font-size of nav icons
  2026-12-01 12:47 [PATCH yew-widget-toolkit/yew-widget-toolkit-assets 0/2] Make the menu option indet match the icon width Shannon Sterz
@ 2026-12-01 12:47 ` Shannon Sterz
  2026-12-01 12:47 ` [PATCH yew-widget-toolkit 2/2] widget: navigation drawer: match menu item indents with the icon width Shannon Sterz
  2026-12-01 14:42 ` applied: [PATCH yew-widget-toolkit/yew-widget-toolkit-assets 0/2] Make the menu option indet match " Thomas Lamprecht
  2 siblings, 0 replies; 4+ messages in thread
From: Shannon Sterz @ 2026-12-01 12:47 UTC (permalink / raw)
  To: yew-devel

So we can access it from other places and avoid having to hard code
the value in dependent projects.

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
---
 scss/_nav.scss | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scss/_nav.scss b/scss/_nav.scss
index 8954c8e..01f3f20 100644
--- a/scss/_nav.scss
+++ b/scss/_nav.scss
@@ -125,6 +125,8 @@
     @include color-scheme-vars(surface);
     @include accent-color-scheme-vars(#{$default-accent-color}-container);
 
+    --pwt-nav-menu-icon-font-size: #{map-get($font-size, "title-medium")};
+
     background: var(--pwt-color-background);
     color: var(--pwt-color);
 
@@ -191,7 +193,7 @@
 }
 
 .pwt-nav-menu-icon {
-    font-size: map-get($font-size, "title-medium");
+    font-size: var(--pwt-nav-menu-icon-font-size);
     line-height: map-get($line-height, "title-medium");
 }
 
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH yew-widget-toolkit 2/2] widget: navigation drawer: match menu item indents with the icon width
  2026-12-01 12:47 [PATCH yew-widget-toolkit/yew-widget-toolkit-assets 0/2] Make the menu option indet match the icon width Shannon Sterz
  2026-12-01 12:47 ` [PATCH yew-widget-toolkit-assets 1/2] navigation: menu: use a css variable for the font-size of nav icons Shannon Sterz
@ 2026-12-01 12:47 ` Shannon Sterz
  2026-12-01 14:42 ` applied: [PATCH yew-widget-toolkit/yew-widget-toolkit-assets 0/2] Make the menu option indet match " Thomas Lamprecht
  2 siblings, 0 replies; 4+ messages in thread
From: Shannon Sterz @ 2026-12-01 12:47 UTC (permalink / raw)
  To: yew-devel

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
---
 src/widget/nav/navigation_drawer.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/widget/nav/navigation_drawer.rs b/src/widget/nav/navigation_drawer.rs
index ab8ac2e8..1e884972 100644
--- a/src/widget/nav/navigation_drawer.rs
+++ b/src/widget/nav/navigation_drawer.rs
@@ -264,7 +264,7 @@ impl PwtNavigationDrawer {
             .onkeydown(onkeydown)
             // add indentation
             .with_optional_child((indent_level > 0).then(|| {
-                html! {<span style={format!("width: {}rem", (indent_level as f32) * 1.0)}/>}
+                html! {<span style={format!("width: calc(var(--pwt-nav-menu-icon-font-size) * {indent_level})")}/>}
             }))
             // add optional icon on the left
             .with_optional_child(
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* applied: [PATCH yew-widget-toolkit/yew-widget-toolkit-assets 0/2] Make the menu option indet match the icon width.
  2026-12-01 12:47 [PATCH yew-widget-toolkit/yew-widget-toolkit-assets 0/2] Make the menu option indet match the icon width Shannon Sterz
  2026-12-01 12:47 ` [PATCH yew-widget-toolkit-assets 1/2] navigation: menu: use a css variable for the font-size of nav icons Shannon Sterz
  2026-12-01 12:47 ` [PATCH yew-widget-toolkit 2/2] widget: navigation drawer: match menu item indents with the icon width Shannon Sterz
@ 2026-12-01 14:42 ` Thomas Lamprecht
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Lamprecht @ 2026-12-01 14:42 UTC (permalink / raw)
  To: yew-devel, Shannon Sterz

On Tue, 01 Dec 2026 13:47:51 +0100, Shannon Sterz wrote:
> Changelog
> ---------
> 
> * v1: https://lore.proxmox.com/yew-devel/20261201110250.105081-1-s.sterz@proxmox.com/T/
> 
> + changes since v1 (thanks @ Dominik Csapak):
> 
> [...]

Applied this one now with merge conflict due to my earlier applying of v1
resolved, thanks!

[yew-widget-toolkit] applied to ui/proxmox-yew-widget-toolkit (master)
[1/1] widget: navigation drawer: match menu item indents with the icon width
      commit: ee9bb0a7b2abda86f27b89d4eae45a23970464ec

[yew-widget-toolkit-assets] applied to ui/proxmox-yew-widget-toolkit-assets.git (master)
[1/1] navigation: menu: use a css variable for the font-size of nav icons
      commit: 18453d6665ce93ab67faed7ce289509000448134




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-12-01 14:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 12:47 [PATCH yew-widget-toolkit/yew-widget-toolkit-assets 0/2] Make the menu option indet match the icon width Shannon Sterz
2026-12-01 12:47 ` [PATCH yew-widget-toolkit-assets 1/2] navigation: menu: use a css variable for the font-size of nav icons Shannon Sterz
2026-12-01 12:47 ` [PATCH yew-widget-toolkit 2/2] widget: navigation drawer: match menu item indents with the icon width Shannon Sterz
2026-12-01 14:42 ` applied: [PATCH yew-widget-toolkit/yew-widget-toolkit-assets 0/2] Make the menu option indet match " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal