fix(web): ensure readable text in code blocks before Shiki loads
Quentin Gliech
and
Claude Opus 4.6 (1M context)
created
Set prose-pre:text-foreground so code blocks have proper contrast
against bg-muted even when Shiki hasn't loaded yet (no .shiki class).
Previously the text color came from prose-invert which could be
near-white in some contexts.
Also add an UnlabeledCodeBlock story to test this case.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@@ -93,3 +93,17 @@ The problem was that \`buildQuery()\` wasn't escaping special characters in labe
Closes #42.`,
},
};
+
+export const UnlabeledCodeBlock: Story = {
+ args: {
+ content: `Here is a code block without a language:
+
+\`\`\`
+# Please enter the title and comment message. The first non-empty line will be
+# used as the title. Lines starting with '#' will be ignored.
+# An empty title aborts the operation.
+\`\`\`
+
+And some text after.`,
+ },
+};