Reading
{/* Serif font toggle */}
updatePrefs({ serifFont: v })}
label="Serif Font"
/>
{/* Justify text toggle */}
updatePrefs({ justified: v })}
label="Justify Text"
/>
{/* Font size slider */}
Font Size
{currentFontSizeLabel}
A
{
const idx = parseInt(e.target.value, 10);
updatePrefs({ fontSize: FONT_SIZES[idx].value });
}}
className="flex-1 h-1.5 accent-primary cursor-pointer"
/>
A
)}
);
}
/** Conditionally render `children` through a React portal to document.body.
* When `portal` is false (or SSR), children render in place. We use this
* to escape stacking + overflow contexts (e.g. inside the sidebar) without
* duplicating the panel JSX. */
function MaybePortal({
portal,
children,
}: {
portal: boolean;
children: React.ReactNode;
}) {
if (portal && typeof document !== "undefined") {
return createPortal(children, document.body);
}
return <>{children}>;
}