diff --git a/bar/modules/stylix.py b/bar/modules/stylix.py index 35638a9..7f74c63 100644 --- a/bar/modules/stylix.py +++ b/bar/modules/stylix.py @@ -38,7 +38,17 @@ def generate_stylix_css(): # Default font font_family = fonts.get("sansSerif", "sans-serif") - font_size = fonts.get("sizes", {}).get("applications", 14) + font_sizes = fonts.get("sizes", {}) + # Use desktop font size for the bar, fallback to applications, then default + font_size = font_sizes.get("desktop", font_sizes.get("applications", 14)) + + # Calculate relative font sizes + small_font = max(int(font_size * 0.85), 10) # Minimum 10px + large_font = int(font_size * 1.1) + + # Debug logging + from loguru import logger + logger.info(f"[Stylix] Using font sizes - Base: {font_size}px, Small: {small_font}px, Large: {large_font}px") # Generate GTK CSS with Stylix colors css_content = f"""/* Stylix-generated theme */ @@ -80,7 +90,7 @@ def generate_stylix_css(): #bat-label {{ color: #{colors["base05"]}; - font-size: 14px; + font-size: {font_size}px; }} #bat-label.battery-low {{ @@ -143,6 +153,7 @@ def generate_stylix_css(): #calendar-title {{ color: #{colors["base05"]}; font-weight: bold; + font-size: {large_font}px; margin-bottom: 8px; }} @@ -175,7 +186,7 @@ def generate_stylix_css(): .event-title {{ font-weight: bold; - font-size: 12px; + font-size: {font_size}px; }} .event-title.upcoming {{ @@ -187,7 +198,7 @@ def generate_stylix_css(): }} .event-time {{ - font-size: 11px; + font-size: {small_font}px; }} .event-time.upcoming {{ @@ -199,7 +210,7 @@ def generate_stylix_css(): }} .event-location {{ - font-size: 11px; + font-size: {small_font}px; }} .event-location.upcoming {{ diff --git a/bar/styles/calendar.css b/bar/styles/calendar.css index 182c14c..846104b 100644 --- a/bar/styles/calendar.css +++ b/bar/styles/calendar.css @@ -19,6 +19,7 @@ #calendar-title { color: var(--foreground); font-weight: bold; + font-size: 1.1em; margin-bottom: 8px; } @@ -31,7 +32,7 @@ #no-events { color: var(--muted); - font-size: 12px; + font-size: 0.85em; padding: 4px; } @@ -53,7 +54,7 @@ .event-title { font-weight: bold; - font-size: 12px; + font-size: 1em; } .event-title.upcoming { @@ -65,7 +66,7 @@ } .event-time { - font-size: 11px; + font-size: 0.85em; } .event-time.upcoming { @@ -77,7 +78,7 @@ } .event-location { - font-size: 11px; + font-size: 0.85em; } .event-location.upcoming { diff --git a/example-stylix-dev.yaml b/example-stylix-dev.yaml index e550c64..10ad564 100644 --- a/example-stylix-dev.yaml +++ b/example-stylix-dev.yaml @@ -29,7 +29,7 @@ stylix: serif: "Times New Roman" monospace: "JetBrains Mono" sizes: - desktop: 12 - applications: 12 - terminal: 11 - popups: 10 \ No newline at end of file + desktop: 14 + applications: 14 + terminal: 16 + popups: 14 \ No newline at end of file