Skip to content

Commit 4743c42

Browse files
committed
Fix dark mode support for blog posts
The Rust blog has a light/dark mode switcher people are relying on. Right now, generating a blog post and copying it as-is makes those blog posts unreadable when dark mode is enabled. Eric Huss fixed that manually for the September and October updates: rust-lang/blog.rust-lang.org@823ab65 This is using that same fix at the source.
1 parent 2cbdd42 commit 4743c42

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

templates/goal_card.hbs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<!-- Goal Information Table -->
99

10-
<table style="width: 100%; border-collapse: collapse; background: white;">
10+
<table style="width: 100%; border-collapse: collapse; background: var(--body-background-color);">
1111
<tr style="border-bottom: 1px solid #eee;">
1212
<td style="padding: 8px 16px; font-weight: bold; width: 80px; color: #666;">Progress</td>
1313
<td style="padding: 8px 16px;">{{>progress is_closed=is_closed progress=progress}}</td>
@@ -32,15 +32,15 @@
3232

3333
<!-- TL;DR Section -->
3434
{{#if tldr}}
35-
<div style="padding: 12px 16px; background: #f8f9fa; border-bottom: 1px solid #eee;">
35+
<div style="padding: 12px 16px; background: var(--blockquote-bg-color); border-bottom: 1px solid #eee;">
3636
<strong>TL;DR.</strong> {{{markdown_to_html tldr}}}
3737
</div>
3838
{{/if}}
3939

4040
<!-- Help Wanted Section -->
4141
{{#if has_help_wanted}}
4242
{{#each help_wanted}}
43-
<div style="padding: 12px 16px; background: #fff3cd; border-bottom: 1px solid #eee; border-left: 4px solid #ffc107;">
43+
<div style="padding: 12px 16px; background: #fff3cd; border-bottom: 1px solid #eee; border-left: 4px solid #ffc107; color: black;">
4444
<strong>Help wanted:</strong> {{{markdown_to_html text}}}
4545
</div>
4646
{{/each}}
@@ -49,14 +49,14 @@
4949
<!-- Updates Section -->
5050
{{#if comments}}
5151
<details style="border-top: 1px solid #eee;">
52-
<summary style="padding: 10px 16px; background: #f5f5f5; cursor: pointer; list-style: none; outline: none;">
52+
<summary style="padding: 10px 16px; background: var(--blockquote-bg-color); cursor: pointer; list-style: none; outline: none;">
5353
<span style="font-weight: bold;">{{{markdown_to_html details_summary}}}</span>
5454
</summary>
55-
<div style="padding: 12px 16px; background: white;">
55+
<div style="padding: 12px 16px; background: var(--body-background-color);">
5656
{{#each comments}}
5757
<div style="margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid #f0f0f0;">
5858
<a href="{{url}}" style="color: #0366d6; font-weight: 500; text-decoration: none;">Comment by {{author}} posted on {{created_at}}:</a>
59-
<div style="margin-top: 8px; padding: 12px; background: #f8f9fa; border-left: 4px solid #e1e4e8; border-radius: 0 6px 6px 0;">
59+
<div style="margin-top: 8px; padding: 12px; background: var(--blockquote-bg-color); border-left: 4px solid #e1e4e8; border-radius: 0 6px 6px 0;">
6060
{{{markdown_to_html body}}}
6161
</div>
6262
</div>
@@ -65,7 +65,7 @@
6565
</details>
6666
{{else}}
6767
<details style="border-top: 1px solid #eee;">
68-
<summary style="padding: 10px 16px; background: #f5f5f5; cursor: pointer; list-style: none; outline: none;">
68+
<summary style="padding: 10px 16px; background: var(--blockquote-bg-color); cursor: pointer; list-style: none; outline: none;">
6969
<span style="font-weight: bold;">{{details_summary}}</span>
7070
</summary>
7171
</details>

0 commit comments

Comments
 (0)