Skip to content

Commit 584cdc4

Browse files
committed
Improve syntax highlighting for comments and diffs
1 parent f155b2f commit 584cdc4

File tree

7 files changed

+122
-93
lines changed

7 files changed

+122
-93
lines changed

src/_design-system/syntax/light.json

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "k-colorable light, based on Min Light",
2+
"name": "k-colorable light",
33
"type": "light",
44
"semanticHighlighting": true,
55
"colors": {
@@ -159,12 +159,6 @@
159159
"foreground": "#2b5581"
160160
}
161161
},
162-
{
163-
"scope": ["comment", "string.quoted.docstring.multi"],
164-
"settings": {
165-
"foreground": "#c2c3c5"
166-
}
167-
},
168162
{
169163
"scope": [
170164
"constant.numeric",
@@ -322,6 +316,46 @@
322316
"settings": {
323317
"foreground": "#990069"
324318
}
319+
},
320+
{
321+
"scope": ["meta.diff.header.git"],
322+
"settings": {
323+
"fontStyle": "underline bold"
324+
}
325+
},
326+
{
327+
"scope": ["meta.diff.index.git", "meta.diff.range"],
328+
"settings": {
329+
"foreground": "#6E7557",
330+
"fontStyle": "italic"
331+
}
332+
},
333+
{
334+
"scope": ["meta.diff.header.from-file"],
335+
"settings": { "foreground": "#BD0026", "fontStyle": "italic" }
336+
},
337+
{
338+
"scope": ["meta.diff.header.to-file"],
339+
"settings": { "foreground": "#558900", "fontStyle": "italic" }
340+
},
341+
{
342+
"scope": ["markup.deleted.diff"],
343+
"settings": { "foreground": "#B31D28" }
344+
},
345+
{
346+
"scope": ["markup.inserted.diff"],
347+
"settings": { "foreground": "#558900" }
348+
},
349+
{
350+
"scope": [
351+
"comment",
352+
"string.quoted.docstring.multi",
353+
"punctuation.definition.comment"
354+
],
355+
"settings": {
356+
"foreground": "#9FA88A",
357+
"fontStyle": "italic"
358+
}
325359
}
326360
]
327361
}

src/app/conf/2025/components/testimonials/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import maskBlur from "./mask.webp"
77
export interface TestimonialsProps extends React.HTMLAttributes<HTMLElement> {}
88

99
export interface Testimonial {
10-
quote: string
10+
quote: React.ReactNode
1111
author: {
1212
name: string
1313
role: string

src/app/conf/_api/sched-client.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,20 @@ function preprocessDescription(description: string | undefined | null): string {
191191

192192
// respecting <li> and <a> tags doesn't make sense, because speakers don't use them consistently
193193
// we'll improve how the descriptions look later down the tree in the session details page
194-
return stripHtml(res).result
194+
return stripHtml(res, {
195+
ignoreTags: [
196+
"a",
197+
"b",
198+
"i",
199+
"em",
200+
"strong",
201+
"code",
202+
"pre",
203+
"ul",
204+
"ol",
205+
"li",
206+
],
207+
}).result
195208
}
196209

197210
function shapeSpeaker(user: SchedSpeaker): SchedSpeaker {

src/components/index-page/quotes-from-the-industry.tsx

Lines changed: 0 additions & 77 deletions
This file was deleted.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import {
2+
TestimonialsList,
3+
type Testimonial,
4+
} from "@/app/conf/2025/components/testimonials"
5+
import { SectionLabel } from "@/app/conf/_design-system/section-label"
6+
7+
import matteoCollina from "./matteo-collina.webp"
8+
9+
const testimonials: Testimonial[] = [
10+
{
11+
quote:
12+
"GraphQL gives us enterprise performance with start-up agility: streamlined queries, lean payloads, live updates, and lightning-fast responses help our customers focus on building their applications, not building around them.",
13+
author: {
14+
name: "Matteo Collina",
15+
role: "Platformatic, Co-Founder & CTO",
16+
avatar: matteoCollina.src,
17+
},
18+
},
19+
{
20+
quote: (
21+
<>
22+
GraphQL is the best developer tool for creating and managing performant
23+
APIs at scale, both for producers and consumers. It can query any source
24+
and expose anything back, including real time data. It gives
25+
understanding of your API usage that no other
26+
spec&nbsp;can&nbsp;provide.
27+
</>
28+
),
29+
author: {
30+
name: "Uri Goldshtein",
31+
role: "The Guild, Founder & CEO",
32+
avatar:
33+
"https://avatars.sched.co/8/2b/14900013/avatar.jpg.320x320px.jpg?9f1",
34+
},
35+
},
36+
{
37+
quote:
38+
"The rich ecosystem of powerful tooling enables companies and organizations to tap into the GraphQL hivemind, delivering delightful, long-lived APIs rapidly without sacrificing performance or scalability. From solo developers to distributed teams in huge companies, GraphQL has proven itself time and time again - if you need a solid, performant, and low-maintenance API for your mobile and web apps, look no further!",
39+
author: {
40+
name: "Benjie Gillam",
41+
role: "Graphile, Director",
42+
avatar: "https://avatars.sched.co/b/99/18743846/avatar.jpg.320x320px.jpg",
43+
},
44+
},
45+
]
46+
47+
export function QuotesFromTheIndustry() {
48+
return (
49+
<div className="gql-container py-8 max-md:px-4 md:pb-16 md:pt-24 md:[mask-image:linear-gradient(to_right,transparent,black_5%,black_95%,transparent)]">
50+
<div className="gql-section !py-0">
51+
<SectionLabel className="max-sm:-ml-1 max-sm:justify-center">
52+
Quotes from the industry
53+
</SectionLabel>
54+
<h2 className="typography-h2 mt-6 text-balance max-sm:text-center">
55+
Loved by world‑class devs
56+
</h2>
57+
</div>
58+
<TestimonialsList
59+
testimonials={testimonials}
60+
className="gql-focus-visible focus-visible:!-outline-offset-4 lg:!mt-0 lg:*:px-16"
61+
/>
62+
</div>
63+
)
64+
}
29.3 KB
Loading

src/components/marked/syntax-highlighting.css

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
1-
/* CodeMirror 6 Syntax Highlighting with Light/Dark Mode Support */
2-
3-
/* CSS Custom Properties for Theme Colors */
41
:root {
5-
/* Light theme colors (matching Shiki light.json) */
6-
--cm-comment: #c2c3c5;
2+
--cm-comment: #6e7557;
73
--cm-punctuation: #6e7557;
84
--cm-keyword: #990069;
95
--cm-def: hsl(var(--color-pri-base));
106
--cm-property: #0e0f0b;
117
--cm-qualifier: #1c92a9;
128
--cm-attribute: #8b2bb9;
139
--cm-number: #1976d2;
14-
--cm-string: #2b5581;
10+
--cm-string: #609a06;
1511
--cm-builtin: #1976d2;
1612
--cm-string-2: #0b7fc7;
1713
--cm-variable: #e10198;
1814
--cm-meta: #b33086;
1915
--cm-atom: #1976d2;
2016

21-
/* Editor UI colors - light theme */
2217
--cm-background: #ffffff;
2318
--cm-foreground: #4f533f;
2419
--cm-gutter-background: #f7f7f7;

0 commit comments

Comments
 (0)