-
-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve the colors of inline code and code blocks #363
Comments
Our default theme does not care much about the brightness and the base app theme. We need to improve it but for now it's better to customize it the way you want. |
In the meantime, if it can be useful to anyone: here is how I customized the theme in my material 3 app. Inline code and code blocks look great in light, dark and black theme, with or without dynamic colors. I also made the text colors the same. @override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final fleatherThemeFallback = FleatherThemeData.fallback(context);
return FleatherTheme(
data: fleatherThemeFallback.copyWith(
inlineCode: InlineCodeThemeData(
backgroundColor: theme.colorScheme.surfaceContainerHigh, // Changed
radius: fleatherThemeFallback.inlineCode.radius,
style: fleatherThemeFallback.inlineCode.style.copyWith(
color: theme.colorScheme.primary, // Changed
),
heading1: fleatherThemeFallback.inlineCode.heading1,
heading2: fleatherThemeFallback.inlineCode.heading2,
heading3: fleatherThemeFallback.inlineCode.heading3,
),
code: TextBlockTheme(
decoration: fleatherThemeFallback.code.decoration!.copyWith(
color: theme.colorScheme.surfaceContainerHigh, // Changed
),
style: fleatherThemeFallback.code.style.copyWith(
color: theme.colorScheme.primary, // Changed
),
spacing: fleatherThemeFallback.code.spacing,
),
),
child: FleatherField(
controller: FleatherController(),
),
);
} |
Thanks! I haven't checked it yet but do you want to create a PR? @maelchiotti |
Yeah why not! That would be my first ever! I'll fork the repo and check that my modifications do work properly |
Steps to Reproduce
I find the colors of inline code and code blocks make them hard to use:
Environment
The text was updated successfully, but these errors were encountered: