From 461c469289fc35b6d77844d95a07651b82a6b5dc Mon Sep 17 00:00:00 2001 From: sageTheDM Date: Fri, 11 Oct 2024 09:30:37 +0200 Subject: [PATCH] FontSize comments --- app/components/settings/FontSize.tsx | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/app/components/settings/FontSize.tsx b/app/components/settings/FontSize.tsx index d126ca5..2f5ca1f 100644 --- a/app/components/settings/FontSize.tsx +++ b/app/components/settings/FontSize.tsx @@ -2,28 +2,29 @@ import React from 'react'; interface FontSizeSettingProps { - fontSize: string; // The current font size + fontSize: string; // The current font size as a string (e.g., "16px") setFontSize: (newSize: string) => void; // Function to update the font size } const FontSizeSetting: React.FC = ({ fontSize, setFontSize }) => { + // Handle changes to the font size input const handleFontSizeChange = (e: React.ChangeEvent) => { - const newSize = `${e.target.value}px`; - setFontSize(newSize); - document.documentElement.style.setProperty('--font-size', newSize); + const newSize = `${e.target.value}px`; // Create the new font size string + setFontSize(newSize); // Update the font size state + document.documentElement.style.setProperty('--font-size', newSize); // Update the CSS variable }; return ( -
-

Font Size

+
{/* Container for the font size setting */} +

Font Size

{/* Label for the setting */} - {fontSize} + {fontSize} {/* Display the current font size */}
); };