Skip to content

Commit 1f8fe66

Browse files
remove ThemeData.cardColor from code background color when using material theme
1 parent 2bb797b commit 1f8fe66

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

packages/flutter_markdown/lib/src/style_sheet.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ class MarkdownStyleSheet {
104104
p: theme.textTheme.bodyMedium,
105105
pPadding: EdgeInsets.zero,
106106
code: theme.textTheme.bodyMedium!.copyWith(
107+
backgroundColor: theme.cardTheme.color,
107108
fontFamily: 'monospace',
108109
fontSize: theme.textTheme.bodyMedium!.fontSize! * 0.85,
109110
),
@@ -280,6 +281,7 @@ class MarkdownStyleSheet {
280281
p: theme.textTheme.bodyMedium,
281282
pPadding: EdgeInsets.zero,
282283
code: theme.textTheme.bodyMedium!.copyWith(
284+
backgroundColor: theme.cardTheme.color,
283285
fontFamily: 'monospace',
284286
fontSize: theme.textTheme.bodyMedium!.fontSize! * 0.85,
285287
),

packages/flutter_markdown/test/style_sheet_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ void defineTests() {
150150
expect(
151151
style.code!.fontSize, theme.textTheme.bodyMedium!.fontSize! * 0.85);
152152
expect(style.code!.fontFamily, 'monospace');
153+
expect(style.code!.backgroundColor, theme.cardTheme.color);
153154

154155
// H1
155156
expect(style.h1, theme.textTheme.headlineSmall);

0 commit comments

Comments
 (0)