option to underline links
This commit is contained in:
5 files changed
+29
-1
No files matched your search
@@ -0,0 +1,5 @@
|
||||
---
|
||||
sable: minor
|
||||
---
|
||||
|
||||
Added setting to always underline links.
|
||||
@@ -245,6 +245,7 @@ function SystemThemePreferences() {
|
||||
function ThemeSettings() {
|
||||
const [systemTheme, setSystemTheme] = useSetting(settingsAtom, 'useSystemTheme');
|
||||
const [saturation, setSaturation] = useSetting(settingsAtom, 'saturationLevel');
|
||||
const [underlineLinks, setUnderlineLinks] = useSetting(settingsAtom, 'underlineLinks');
|
||||
|
||||
return (
|
||||
<Box direction="Column" gap="100">
|
||||
@@ -297,6 +298,13 @@ function ThemeSettings() {
|
||||
}
|
||||
/>
|
||||
</SequenceCard>
|
||||
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
||||
<SettingTile
|
||||
title="Underline Links"
|
||||
description="Always show underlines on links in chat."
|
||||
after={<Switch variant="Primary" value={underlineLinks} onChange={setUnderlineLinks} />}
|
||||
/>
|
||||
</SequenceCard>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -31,12 +31,19 @@ export function UnAuthRouteThemeManager() {
|
||||
export function AuthRouteThemeManager({ children }: { children: ReactNode }) {
|
||||
const activeTheme = useActiveTheme();
|
||||
const [saturation] = useSetting(settingsAtom, 'saturationLevel');
|
||||
const [underlineLinks] = useSetting(settingsAtom, 'underlineLinks');
|
||||
|
||||
useEffect(() => {
|
||||
document.body.className = '';
|
||||
document.body.classList.add(configClass, varsClass);
|
||||
document.body.classList.add(...activeTheme.classNames);
|
||||
|
||||
if (underlineLinks) {
|
||||
document.body.classList.add('force-underline-links');
|
||||
} else {
|
||||
document.body.classList.remove('force-underline-links');
|
||||
}
|
||||
|
||||
if (saturation === 0) {
|
||||
document.body.style.filter = 'grayscale(1)';
|
||||
} else if (saturation && saturation < 100) {
|
||||
@@ -44,7 +51,7 @@ export function AuthRouteThemeManager({ children }: { children: ReactNode }) {
|
||||
} else {
|
||||
document.body.style.filter = '';
|
||||
}
|
||||
}, [activeTheme, saturation]);
|
||||
}, [activeTheme, saturation, underlineLinks]);
|
||||
|
||||
return <ThemeContextProvider value={activeTheme}>{children}</ThemeContextProvider>;
|
||||
}
|
||||
@@ -80,6 +80,7 @@ export interface Settings {
|
||||
showPingCounts: boolean;
|
||||
hideReads: boolean;
|
||||
emojiSuggestThreshold: number;
|
||||
underlineLinks: boolean;
|
||||
|
||||
// furry stuff
|
||||
renderAnimals: boolean;
|
||||
@@ -149,6 +150,7 @@ const defaultSettings: Settings = {
|
||||
showPingCounts: true,
|
||||
hideReads: false,
|
||||
emojiSuggestThreshold: 2,
|
||||
underlineLinks: false,
|
||||
|
||||
// furry stuff
|
||||
renderAnimals: true,
|
||||
|
||||
@@ -174,3 +174,9 @@ pre {
|
||||
letter-spacing: -0.01em;
|
||||
font-variant-ligatures: contextual;
|
||||
}
|
||||
|
||||
.force-underline-links a {
|
||||
text-decoration: underline !important;
|
||||
text-decoration-thickness: 1px;
|
||||
text-underline-offset: 2px;
|
||||
}
|
||||
Reference in new issue
Block a user