Skip to content

Commit

Permalink
content [nfc]: Reassert normal font weight for plain code-block text
Browse files Browse the repository at this point in the history
I *think* it's not possible for a code block to appear in a bold
context. In particular I haven't found a way to put one inside a
spoiler header.

Anyway, just in case it does end up being possible somehow, might as
well clobber the bold with normal weight, to make sure the code
block's bold spans remain distinct from non-bold spans. It's
convenient (and cheap) to that here in the CodeBlockTextStyles
constructor.
  • Loading branch information
chrisbobbe committed Jun 6, 2024
1 parent 88c2755 commit 61fe10a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/widgets/code_block.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class CodeBlockTextStyles {
plain: kMonospaceTextStyle
.merge(const TextStyle(
fontSize: 0.825 * kBaseFontSize,
height: 1.4)),
height: 1.4))
.merge(weightVariableTextStyle(context)),

// .hll { background-color: hsl(60deg 100% 90%); }
hll: TextStyle(backgroundColor: const HSLColor.fromAHSL(1, 60, 1, 0.90).toColor()),
Expand Down

0 comments on commit 61fe10a

Please sign in to comment.