stylix font size

This commit is contained in:
2025-09-29 16:42:44 +02:00
parent 5cea889af3
commit dd6feb4170
3 changed files with 25 additions and 13 deletions

View File

@@ -38,7 +38,17 @@ def generate_stylix_css():
# Default font # Default font
font_family = fonts.get("sansSerif", "sans-serif") 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 # Generate GTK CSS with Stylix colors
css_content = f"""/* Stylix-generated theme */ css_content = f"""/* Stylix-generated theme */
@@ -80,7 +90,7 @@ def generate_stylix_css():
#bat-label {{ #bat-label {{
color: #{colors["base05"]}; color: #{colors["base05"]};
font-size: 14px; font-size: {font_size}px;
}} }}
#bat-label.battery-low {{ #bat-label.battery-low {{
@@ -143,6 +153,7 @@ def generate_stylix_css():
#calendar-title {{ #calendar-title {{
color: #{colors["base05"]}; color: #{colors["base05"]};
font-weight: bold; font-weight: bold;
font-size: {large_font}px;
margin-bottom: 8px; margin-bottom: 8px;
}} }}
@@ -175,7 +186,7 @@ def generate_stylix_css():
.event-title {{ .event-title {{
font-weight: bold; font-weight: bold;
font-size: 12px; font-size: {font_size}px;
}} }}
.event-title.upcoming {{ .event-title.upcoming {{
@@ -187,7 +198,7 @@ def generate_stylix_css():
}} }}
.event-time {{ .event-time {{
font-size: 11px; font-size: {small_font}px;
}} }}
.event-time.upcoming {{ .event-time.upcoming {{
@@ -199,7 +210,7 @@ def generate_stylix_css():
}} }}
.event-location {{ .event-location {{
font-size: 11px; font-size: {small_font}px;
}} }}
.event-location.upcoming {{ .event-location.upcoming {{

View File

@@ -19,6 +19,7 @@
#calendar-title { #calendar-title {
color: var(--foreground); color: var(--foreground);
font-weight: bold; font-weight: bold;
font-size: 1.1em;
margin-bottom: 8px; margin-bottom: 8px;
} }
@@ -31,7 +32,7 @@
#no-events { #no-events {
color: var(--muted); color: var(--muted);
font-size: 12px; font-size: 0.85em;
padding: 4px; padding: 4px;
} }
@@ -53,7 +54,7 @@
.event-title { .event-title {
font-weight: bold; font-weight: bold;
font-size: 12px; font-size: 1em;
} }
.event-title.upcoming { .event-title.upcoming {
@@ -65,7 +66,7 @@
} }
.event-time { .event-time {
font-size: 11px; font-size: 0.85em;
} }
.event-time.upcoming { .event-time.upcoming {
@@ -77,7 +78,7 @@
} }
.event-location { .event-location {
font-size: 11px; font-size: 0.85em;
} }
.event-location.upcoming { .event-location.upcoming {

View File

@@ -29,7 +29,7 @@ stylix:
serif: "Times New Roman" serif: "Times New Roman"
monospace: "JetBrains Mono" monospace: "JetBrains Mono"
sizes: sizes:
desktop: 12 desktop: 14
applications: 12 applications: 14
terminal: 11 terminal: 16
popups: 10 popups: 14