Skip to content

Commit 199dd66

Browse files
committed
Fix light mode visibility and broken tab indentation
- Scope header dark background to slate scheme only so light mode uses the proper light background - Add explicit light mode styles for h1, h2, h3, tables, code, sidebar, admonitions, search, and footer - Remove gradient text on h1 in light mode (use solid dark color) - Fix broken Java code tab in message_queues.md where lines 245-287 lost their 4-space indentation, causing raw HTML rendering Made-with: Cursor
1 parent a978ba0 commit 199dd66

File tree

2 files changed

+128
-43
lines changed

2 files changed

+128
-43
lines changed

docs/advanced/message_queues.md

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -242,49 +242,48 @@ flowchart TD
242242
}
243243

244244
public void close() { producer.close(); }
245-
}
246-
247-
// Consumer — processes order events with at-least-once semantics
248-
public class OrderEventConsumer implements Runnable {
249-
private final KafkaConsumer<String, String> consumer;
250-
private final OrderProcessor processor;
251-
private volatile boolean running = true;
252-
253-
public OrderEventConsumer(String bootstrapServers, String groupId,
254-
String topic, OrderProcessor processor) {
255-
this.processor = processor;
256-
Properties props = new Properties();
257-
props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
258-
props.put(ConsumerConfig.GROUP_ID_CONFIG, groupId);
259-
props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName());
260-
props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName());
261-
props.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, false); // manual commit
262-
props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
263-
props.put(ConsumerConfig.MAX_POLL_RECORDS_CONFIG, 100);
264-
265-
this.consumer = new KafkaConsumer<>(props);
266-
consumer.subscribe(List.of(topic));
267245
}
268-
269-
@Override
270-
public void run() {
271-
while (running) {
272-
ConsumerRecords<String, String> records = consumer.poll(Duration.ofMillis(500));
273-
for (ConsumerRecord<String, String> record : records) {
274-
try {
275-
processor.process(record.key(), record.value(), record.offset());
276-
} catch (Exception e) {
277-
// send to dead-letter queue for manual inspection
278-
publishToDeadLetterQueue(record, e);
246+
247+
// Consumer — processes order events with at-least-once semantics
248+
public class OrderEventConsumer implements Runnable {
249+
private final KafkaConsumer<String, String> consumer;
250+
private final OrderProcessor processor;
251+
private volatile boolean running = true;
252+
253+
public OrderEventConsumer(String bootstrapServers, String groupId,
254+
String topic, OrderProcessor processor) {
255+
this.processor = processor;
256+
Properties props = new Properties();
257+
props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
258+
props.put(ConsumerConfig.GROUP_ID_CONFIG, groupId);
259+
props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName());
260+
props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName());
261+
props.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, false); // manual commit
262+
props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
263+
props.put(ConsumerConfig.MAX_POLL_RECORDS_CONFIG, 100);
264+
265+
this.consumer = new KafkaConsumer<>(props);
266+
consumer.subscribe(List.of(topic));
267+
}
268+
269+
@Override
270+
public void run() {
271+
while (running) {
272+
ConsumerRecords<String, String> records = consumer.poll(Duration.ofMillis(500));
273+
for (ConsumerRecord<String, String> record : records) {
274+
try {
275+
processor.process(record.key(), record.value(), record.offset());
276+
} catch (Exception e) {
277+
publishToDeadLetterQueue(record, e);
278+
}
279279
}
280+
consumer.commitSync();
280281
}
281-
consumer.commitSync(); // commit after successful processing
282+
consumer.close();
282283
}
283-
consumer.close();
284+
285+
public void shutdown() { running = false; }
284286
}
285-
286-
public void shutdown() { running = false; }
287-
}
288287
```
289288

290289
=== "Go"

docs/assets/css/theme.css

Lines changed: 91 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
}
5050

5151
/* ── Header ───────────────────────────────────────────────────── */
52-
.md-header {
52+
[data-md-color-scheme="slate"] .md-header {
5353
background: rgba(12, 10, 29, 0.85) !important;
5454
backdrop-filter: blur(20px) saturate(180%);
5555
-webkit-backdrop-filter: blur(20px) saturate(180%);
@@ -58,9 +58,11 @@
5858
}
5959

6060
[data-md-color-scheme="default"] .md-header {
61-
background: rgba(250, 249, 255, 0.85) !important;
62-
border-bottom: 1px solid rgba(124, 58, 237, 0.1);
63-
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
61+
background: rgba(250, 249, 255, 0.92) !important;
62+
backdrop-filter: blur(16px);
63+
-webkit-backdrop-filter: blur(16px);
64+
border-bottom: 1px solid rgba(0, 0, 0, 0.08);
65+
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
6466
}
6567

6668
.md-header__title {
@@ -118,12 +120,19 @@
118120
letter-spacing: -0.04em;
119121
line-height: 1.2;
120122
margin-bottom: 0.6em;
123+
}
124+
125+
[data-md-color-scheme="slate"] .md-typeset h1 {
121126
background: var(--sdi-gradient-primary);
122127
-webkit-background-clip: text;
123128
-webkit-text-fill-color: transparent;
124129
background-clip: text;
125130
}
126131

132+
[data-md-color-scheme="default"] .md-typeset h1 {
133+
color: #1e1b4b;
134+
}
135+
127136
.md-typeset h2 {
128137
font-weight: 700;
129138
font-size: 1.5em;
@@ -153,10 +162,22 @@
153162
font-weight: 600;
154163
font-size: 1.15em;
155164
margin-top: 2.2em;
156-
color: var(--md-accent-fg-color);
157165
letter-spacing: -0.01em;
158166
}
159167

168+
[data-md-color-scheme="slate"] .md-typeset h3 {
169+
color: var(--md-accent-fg-color);
170+
}
171+
172+
[data-md-color-scheme="default"] .md-typeset h3 {
173+
color: #4338ca;
174+
}
175+
176+
[data-md-color-scheme="default"] .md-typeset h2 {
177+
color: #1e1b4b;
178+
border-bottom: 1px solid rgba(0, 0, 0, 0.08);
179+
}
180+
160181
.md-typeset h4 {
161182
font-weight: 600;
162183
font-size: 1em;
@@ -516,6 +537,71 @@
516537
background: var(--sdi-gradient-primary) !important;
517538
}
518539

540+
/* ── Light mode — Tables ─────────────────────────────────────── */
541+
[data-md-color-scheme="default"] .md-typeset table:not([class]) {
542+
border: 1px solid rgba(0, 0, 0, 0.08);
543+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
544+
}
545+
546+
[data-md-color-scheme="default"] .md-typeset table:not([class]) th {
547+
background: rgba(99, 102, 241, 0.05);
548+
color: #4338ca;
549+
border-bottom: 1px solid rgba(0, 0, 0, 0.08);
550+
}
551+
552+
[data-md-color-scheme="default"] .md-typeset table:not([class]) td {
553+
border-bottom: 1px solid rgba(0, 0, 0, 0.04);
554+
}
555+
556+
[data-md-color-scheme="default"] .md-typeset table:not([class]) tbody tr:hover td {
557+
background: rgba(99, 102, 241, 0.03);
558+
}
559+
560+
/* ── Light mode — Code ───────────────────────────────────────── */
561+
[data-md-color-scheme="default"] .md-typeset pre {
562+
border: 1px solid rgba(0, 0, 0, 0.06);
563+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
564+
}
565+
566+
[data-md-color-scheme="default"] .md-typeset :not(pre) > code {
567+
background: rgba(99, 102, 241, 0.06);
568+
color: #4338ca;
569+
border: 1px solid rgba(99, 102, 241, 0.1);
570+
}
571+
572+
/* ── Light mode — Sidebar ────────────────────────────────────── */
573+
[data-md-color-scheme="default"] .md-sidebar {
574+
border-right: 1px solid rgba(0, 0, 0, 0.04);
575+
}
576+
577+
[data-md-color-scheme="default"] .md-nav__link--active {
578+
background: rgba(99, 102, 241, 0.06);
579+
border-left: 2px solid var(--md-accent-fg-color);
580+
}
581+
582+
/* ── Light mode — Admonitions ────────────────────────────────── */
583+
[data-md-color-scheme="default"] .md-typeset .admonition,
584+
[data-md-color-scheme="default"] .md-typeset details {
585+
border: 1px solid rgba(0, 0, 0, 0.06);
586+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
587+
}
588+
589+
/* ── Light mode — Search ─────────────────────────────────────── */
590+
[data-md-color-scheme="default"] .md-search__form {
591+
border: 1px solid rgba(0, 0, 0, 0.08);
592+
border-radius: var(--sdi-radius);
593+
}
594+
595+
/* ── Light mode — Footer ─────────────────────────────────────── */
596+
[data-md-color-scheme="default"] .md-footer {
597+
border-top: 1px solid rgba(0, 0, 0, 0.06);
598+
}
599+
600+
/* ── Light mode — h2 underline ───────────────────────────────── */
601+
[data-md-color-scheme="default"] .md-typeset h2::after {
602+
background: linear-gradient(135deg, #4338ca, #0891b2);
603+
}
604+
519605
/* ── Navigation Path (Breadcrumbs) ────────────────────────────── */
520606
.md-path {
521607
font-size: 0.72rem;

0 commit comments

Comments
 (0)