From ca4db4a19628cfe45846efda3827722bc588b965 Mon Sep 17 00:00:00 2001 From: KimJammer <41841812+kimjammer@users.noreply.github.com> Date: Fri, 27 Dec 2024 12:35:56 -0500 Subject: [PATCH] Revert font-size behavior for non-fancy modes --- src/plugins/synced-lyrics/renderer/renderer.tsx | 15 ++++++++++++--- src/plugins/synced-lyrics/style.css | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/plugins/synced-lyrics/renderer/renderer.tsx b/src/plugins/synced-lyrics/renderer/renderer.tsx index cfbc3824d5..7c90506590 100644 --- a/src/plugins/synced-lyrics/renderer/renderer.tsx +++ b/src/plugins/synced-lyrics/renderer/renderer.tsx @@ -38,7 +38,10 @@ createEffect(() => { root.style.setProperty('--lyrics-active-offset', '0'); break; case 'scale': - root.style.setProperty('--lyrics-font-size', '1.4rem'); + root.style.setProperty( + '--lyrics-font-size', + 'clamp(1.4rem, 1.1vmax, 3rem)', + ); root.style.setProperty( '--lyrics-line-height', 'var(--ytmusic-body-line-height)', @@ -58,7 +61,10 @@ createEffect(() => { root.style.setProperty('--lyrics-active-offset', '0'); break; case 'offset': - root.style.setProperty('--lyrics-font-size', '1.4rem'); + root.style.setProperty( + '--lyrics-font-size', + 'clamp(1.4rem, 1.1vmax, 3rem)', + ); root.style.setProperty( '--lyrics-line-height', 'var(--ytmusic-body-line-height)', @@ -78,7 +84,10 @@ createEffect(() => { root.style.setProperty('--lyrics-active-offset', '5%'); break; case 'focus': - root.style.setProperty('--lyrics-font-size', '1.4rem'); + root.style.setProperty( + '--lyrics-font-size', + 'clamp(1.4rem, 1.1vmax, 3rem)', + ); root.style.setProperty( '--lyrics-line-height', 'var(--ytmusic-body-line-height)', diff --git a/src/plugins/synced-lyrics/style.css b/src/plugins/synced-lyrics/style.css index 0f8c2bb4f3..525e4a2624 100644 --- a/src/plugins/synced-lyrics/style.css +++ b/src/plugins/synced-lyrics/style.css @@ -17,7 +17,7 @@ /* Typography */ --lyrics-font-family: Satoshi, Avenir, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Open Sans, Helvetica Neue, sans-serif; - --lyrics-font-size: 1.4rem; + --lyrics-font-size: clamp(1.4rem, 1.1vmax, 3rem); --lyrics-line-height: var(--ytmusic-body-line-height); --lyrics-width: 100%;