diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-10 10:02:44 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-10 10:02:44 +0100 |
| commit | 5ebfb5850713c038e37baddbadde3320aca2c4e4 (patch) | |
| tree | a2842edacb1e7f93f34d2492c6cab9f8cd51dbe7 /tests | |
| parent | 2c7cef2024c201fa9c7c406954121de337071689 (diff) | |
| download | deck-it-5ebfb5850713c038e37baddbadde3320aca2c4e4.tar.gz deck-it-5ebfb5850713c038e37baddbadde3320aca2c4e4.zip | |
fix: follow UDT's font size and live theme changes
UDT gives font sizes to keystone's fonts page, which writes
~/.config/keystone/fonts.json. deck-it hardcoded px sizes, so changing
the size on the fonts page did nothing on the tablet. theme.css now
carries --udt-font-size (override.deckit, else base, 8 to 40px, as
quickshell checks) on html, and deck.css sizes text in rem, scaled from
the old 14px design.
The page loaded theme.css once, so a scheme, wallpaper or size change
reached the tablet only after a reload. The shell now re-reads it every
5s and on visibility, swapping it into a <style> only when it changed,
and sets meta theme-color from --udt-base instead of Macchiato's
hardcoded base.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_theme.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_theme.py b/tests/test_theme.py index c1fe1de..f14b0f1 100644 --- a/tests/test_theme.py +++ b/tests/test_theme.py @@ -55,6 +55,16 @@ class Theme(unittest.TestCase): for index, value in enumerate(["#111111", "#222222", "#333333"], 1): self.assertIn(f"--udt-border-{index}: {value}", out) + def test_font_size_prefers_override_then_base(self): + self.assertEqual(theme.parse_font_size('{"base": 16, "override": {"deckit": 18.6}}'), 19) + self.assertEqual(theme.parse_font_size('{"base": 16, "override": {"rofi": 14}}'), 16) + for bad in ('{"base": 99}', '{"base": "16"}', "not json", "[]"): + self.assertIsNone(theme.parse_font_size(bad)) + + def test_css_exposes_font_size(self): + self.assertIn("--udt-font-size: 17px", theme.css({}, None, font_size=17)) + self.assertIn(f"--udt-font-size: {theme.FONT_SIZE}px", theme.css({}, None)) + def test_load_falls_back_when_files_are_missing(self): saved = (theme.PALETTE_PATH, theme.ACCENT_PATH) theme.PALETTE_PATH = Path("/nonexistent/palette.rasi") |
