Skip to content

Commit ddab4de

Browse files
committed
Revert "feat(theme): per-theme font pickers now actually drive terracotta/luxe typography"
This reverts commit 0f9a061.
1 parent 0f9a061 commit ddab4de

2 files changed

Lines changed: 6 additions & 77 deletions

File tree

src/components/Layout.jsx

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -42,55 +42,7 @@ const Layout = ({
4242
toggleSidebar,
4343
isAppFullscreen,
4444
fezcodexTheme,
45-
headerFont,
46-
bodyFont,
4745
} = useVisualSettings();
48-
49-
const FONT_FAMILY = {
50-
'font-sans': "'Space Mono', monospace",
51-
'font-mono': "'JetBrains Mono', monospace",
52-
'font-inter': "'Inter', sans-serif",
53-
'font-arvo': "'Arvo', serif",
54-
'font-playfairDisplay': "'Playfair Display', serif",
55-
'font-syne': "'Syne', sans-serif",
56-
'font-outfit': "'Outfit', sans-serif",
57-
'font-ibm-plex-mono': "'IBM Plex Mono', monospace",
58-
'font-instr-serif': "'Instrument Serif', serif",
59-
'font-nunito': "'Nunito', sans-serif",
60-
'font-fraunces': "'Fraunces', 'Times New Roman', serif",
61-
};
62-
63-
const themedFontCss =
64-
fezcodexTheme === 'terracotta' || fezcodexTheme === 'luxe'
65-
? `
66-
[data-fezcodex-theme="${fezcodexTheme}"],
67-
[data-fezcodex-theme="${fezcodexTheme}"] p,
68-
[data-fezcodex-theme="${fezcodexTheme}"] li,
69-
[data-fezcodex-theme="${fezcodexTheme}"] span,
70-
[data-fezcodex-theme="${fezcodexTheme}"] div,
71-
[data-fezcodex-theme="${fezcodexTheme}"] a,
72-
[data-fezcodex-theme="${fezcodexTheme}"] button,
73-
[data-fezcodex-theme="${fezcodexTheme}"] blockquote {
74-
font-family: ${FONT_FAMILY[bodyFont] || FONT_FAMILY['font-outfit']};
75-
}
76-
[data-fezcodex-theme="${fezcodexTheme}"] h1,
77-
[data-fezcodex-theme="${fezcodexTheme}"] h2,
78-
[data-fezcodex-theme="${fezcodexTheme}"] h3,
79-
[data-fezcodex-theme="${fezcodexTheme}"] h4,
80-
[data-fezcodex-theme="${fezcodexTheme}"] h5,
81-
[data-fezcodex-theme="${fezcodexTheme}"] h6 {
82-
font-family: ${FONT_FAMILY[headerFont] || FONT_FAMILY['font-outfit']};
83-
}
84-
/* Respect explicit monospace labels — mono stays mono regardless */
85-
[data-fezcodex-theme="${fezcodexTheme}"] code,
86-
[data-fezcodex-theme="${fezcodexTheme}"] pre,
87-
[data-fezcodex-theme="${fezcodexTheme}"] kbd,
88-
[data-fezcodex-theme="${fezcodexTheme}"] .font-mono,
89-
[data-fezcodex-theme="${fezcodexTheme}"] .font-ibm-plex-mono {
90-
font-family: 'IBM Plex Mono', 'JetBrains Mono', monospace;
91-
}
92-
`
93-
: '';
9446
const location = useLocation();
9547
const { projects } = useProjects();
9648

@@ -133,7 +85,6 @@ const Layout = ({
13385
<DndProvider>{children}</DndProvider>
13486
) : (
13587
<div
136-
data-fezcodex-theme={fezcodexTheme}
13788
className={`${
13889
fezcodexTheme === 'luxe'
13990
? 'bg-[#F5F5F0]'
@@ -142,7 +93,6 @@ const Layout = ({
14293
: 'bg-[#050505]'
14394
} min-h-screen font-sans flex`}
14495
>
145-
{themedFontCss && <style>{themedFontCss}</style>}
14696
{!hideLayout &&
14797
(fezcodexTheme === 'luxe' ? (
14898
<LuxeSidebar

src/context/VisualSettingsContext.jsx

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,13 @@ export const VisualSettingsProvider = ({ children }) => {
2626
{ id: 'font-fraunces', name: 'Fraunces' },
2727
];
2828

29-
// Font picks are persisted per-theme so switching themes does not reset
30-
// your typography preferences in the other themes.
31-
const [headerFontsByTheme, setHeaderFontsByTheme] = usePersistentState(
32-
'header-fonts-by-theme',
33-
{
34-
brutalist: 'font-outfit',
35-
luxe: 'font-playfairDisplay',
36-
terracotta: 'font-fraunces',
37-
},
29+
const [headerFont, setHeaderFont] = usePersistentState(
30+
'header-font',
31+
'font-outfit',
3832
);
39-
const [bodyFontsByTheme, setBodyFontsByTheme] = usePersistentState(
40-
'body-fonts-by-theme',
41-
{
42-
brutalist: 'font-outfit',
43-
luxe: 'font-outfit',
44-
terracotta: 'font-ibm-plex-mono',
45-
},
33+
const [bodyFont, setBodyFont] = usePersistentState(
34+
'body-font',
35+
'font-outfit',
4636
);
4737
const [isInverted, setIsInverted] = usePersistentState('is-inverted', false);
4838
const [isRetro, setIsRetro] = usePersistentState('is-retro', false);
@@ -111,17 +101,6 @@ export const VisualSettingsProvider = ({ children }) => {
111101
'brutalist',
112102
); // 'brutalist' | 'luxe' | 'terracotta'
113103

114-
// Derived font values for the active theme. Setting these updates only the
115-
// active theme's entry, preserving the other themes' picks.
116-
const headerFont =
117-
headerFontsByTheme?.[fezcodexTheme] || 'font-outfit';
118-
const bodyFont =
119-
bodyFontsByTheme?.[fezcodexTheme] || 'font-outfit';
120-
const setHeaderFont = (value) =>
121-
setHeaderFontsByTheme((prev) => ({ ...(prev || {}), [fezcodexTheme]: value }));
122-
const setBodyFont = (value) =>
123-
setBodyFontsByTheme((prev) => ({ ...(prev || {}), [fezcodexTheme]: value }));
124-
125104
// URL Parameter Observer - Consumes ?fezTheme=... and ?fezBlogMode=...
126105
useEffect(() => {
127106
const params = new URLSearchParams(window.location.search);

0 commit comments

Comments
 (0)