Skip to content

Commit 2e145ae

Browse files
committed
fix(galley): high-contrast syntax theme on cream paper
The galley blog view was reusing the dark brutalist customTheme, so token colors (orange keywords, pink identifiers) were nearly invisible on the cream paper background. Introduce a dedicated galleyTheme with ink (#1A1613) body text plus muted olive strings, plum keywords, and slate-blue function names — all tested against the #EDE3D2 code block background. chore: bump version to 0.24.27
1 parent 8008a50 commit 2e145ae

4 files changed

Lines changed: 86 additions & 5 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fezcodex",
3-
"version": "0.24.26",
3+
"version": "0.24.27",
44
"private": true,
55
"homepage": "https://fezcode.com",
66
"dependencies": {

src/pages/blog-views/GalleyBlogPostPage.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
ClipboardText,
88
} from '@phosphor-icons/react';
99
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
10-
import { customTheme } from '../../utils/customTheme';
10+
import { galleyTheme } from '../../utils/galleyTheme';
1111
import CodeModal from '../../components/CodeModal';
1212
import Seo from '../../components/Seo';
1313
import { calculateReadingTime } from '../../utils/readingTime';
@@ -197,7 +197,7 @@ const GalleyBlogPostPage = () => {
197197
</span>
198198
</div>
199199
<SyntaxHighlighter
200-
style={customTheme}
200+
style={galleyTheme}
201201
language={match ? match[1] : 'text'}
202202
PreTag="div"
203203
CodeTag="code"

src/utils/galleyTheme.js

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
const base = {
2+
fontFamily:
3+
'"IBM Plex Mono", "JetBrains Mono", Consolas, Monaco, monospace',
4+
textAlign: 'left',
5+
whiteSpace: 'pre',
6+
wordSpacing: 'normal',
7+
wordBreak: 'normal',
8+
wordWrap: 'normal',
9+
lineHeight: '1.55',
10+
MozTabSize: '4',
11+
OTabSize: '4',
12+
tabSize: '4',
13+
WebkitHyphens: 'none',
14+
MozHyphens: 'none',
15+
msHyphens: 'none',
16+
hyphens: 'none',
17+
};
18+
19+
export const galleyTheme = {
20+
'code[class*="language-"]': {
21+
...base,
22+
color: '#1A1613',
23+
background: 'none',
24+
fontSize: '0.92em',
25+
},
26+
'pre[class*="language-"]': {
27+
...base,
28+
color: '#1A1613',
29+
background: '#EDE3D2',
30+
padding: '1em',
31+
margin: '0.5em 0',
32+
overflow: 'auto',
33+
fontSize: '0.92em',
34+
},
35+
'pre[class*="language-"]::selection': {
36+
background: 'rgba(201,100,66,0.25)',
37+
},
38+
'code[class*="language-"]::selection': {
39+
background: 'rgba(201,100,66,0.25)',
40+
},
41+
':not(pre) > code[class*="language-"]': {
42+
color: '#9E4A2F',
43+
background: 'rgba(201,100,66,0.08)',
44+
padding: '0.12em 0.35em',
45+
borderRadius: '2px',
46+
},
47+
comment: { color: '#7A6E5E', fontStyle: 'italic' },
48+
prolog: { color: '#7A6E5E', fontStyle: 'italic' },
49+
doctype: { color: '#7A6E5E', fontStyle: 'italic' },
50+
cdata: { color: '#7A6E5E', fontStyle: 'italic' },
51+
punctuation: { color: '#3A302A' },
52+
namespace: { opacity: '0.7' },
53+
property: { color: '#8A4A1B' },
54+
tag: { color: '#8A4A1B' },
55+
boolean: { color: '#8A4A1B' },
56+
number: { color: '#8A4A1B' },
57+
constant: { color: '#8A4A1B' },
58+
symbol: { color: '#8A4A1B' },
59+
deleted: { color: '#8A4A1B' },
60+
selector: { color: '#5F6F3E' },
61+
'attr-name': { color: '#5F6F3E' },
62+
string: { color: '#5F6F3E' },
63+
char: { color: '#5F6F3E' },
64+
builtin: { color: '#5F6F3E' },
65+
inserted: { color: '#5F6F3E' },
66+
operator: { color: '#9E4A2F' },
67+
entity: { color: '#9E4A2F', cursor: 'help' },
68+
url: { color: '#9E4A2F' },
69+
'.language-css .token.string': { color: '#9E4A2F' },
70+
'.style .token.string': { color: '#9E4A2F' },
71+
atrule: { color: '#6B4AA0' },
72+
'attr-value': { color: '#5F6F3E' },
73+
keyword: { color: '#6B4AA0', fontWeight: '600' },
74+
function: { color: '#3E5F8A', fontWeight: '600' },
75+
'class-name': { color: '#8A4A1B', fontWeight: '600' },
76+
regex: { color: '#6B4AA0' },
77+
important: { color: '#9E4A2F', fontWeight: 'bold' },
78+
variable: { color: '#1A1613' },
79+
bold: { fontWeight: 'bold' },
80+
italic: { fontStyle: 'italic' },
81+
};

0 commit comments

Comments
 (0)