-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[flutter_markdown] remove backgroundColor from code text theme to enable code selection highlight #7090
[flutter_markdown] remove backgroundColor from code text theme to enable code selection highlight #7090
Conversation
I'll defer to @stuartmorgan if this is the best approach. |
I'm not familiar with this portion of the framework, so I'm not a good authority for this. @HosamHasanRamadan I would suggest asking for feedback on this in the |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, the ideal long-term solution would be to rework this API to use WidgetSpan
objects for code snippets, to give full control over the background's padding and border radius.
If that's a bit too much work for your schedule, I think a less disruptive workaround would be to make the following change:
code: theme.textTheme.bodyMedium!.copyWith(
- backgroundColor: theme.cardTheme.color ?? theme.cardColor,
backgroundColor: theme.cardTheme.color,
fontFamily: 'monospace',
fontSize: theme.textTheme.bodyMedium!.fontSize! * 0.85,
),
We're already planning to get rid of that field at some point (see flutter/flutter#91772), so I'd be down with allowing selection highlight visibility by preemptively removing the theme.cardColor
reference here.
LGTM once @nate-thegrate's request is integrated. |
@nate-thegrate Ok , I will update the PR. |
@nate-thegrate What about Cupertino theme color ?
|
It looks like the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like Linux repo_checks is failing since this PR currently doesn't include a changelog update.
I imagine we'll be good to land this change once that's addressed :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the contribution!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PTAL @stuartmorgan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…eme to enable code selection highlight (flutter/packages#7090)
…eme to enable code selection highlight (flutter/packages#7090)
flutter/packages@f38b780...0321757 2024-09-26 [email protected] Roll Flutter from 538e742 to fa402c8 (19 revisions) (flutter/packages#7713) 2024-09-26 [email protected] [flutter_markdown] remove backgroundColor from code text theme to enable code selection highlight (flutter/packages#7090) 2024-09-26 10687576 [email protected] [interactive_media_ads] Adds internal wrapper for iOS native `IMAFriendlyObstruction` (flutter/packages#7696) 2024-09-26 [email protected] Add a `@SuppressWarnings` in advance (flutter/packages#7712) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/ doc/main/autoroll/README.md
…r#155832) flutter/packages@f38b780...0321757 2024-09-26 [email protected] Roll Flutter from 538e742 to fa402c8 (19 revisions) (flutter/packages#7713) 2024-09-26 [email protected] [flutter_markdown] remove backgroundColor from code text theme to enable code selection highlight (flutter/packages#7090) 2024-09-26 10687576 [email protected] [interactive_media_ads] Adds internal wrapper for iOS native `IMAFriendlyObstruction` (flutter/packages#7696) 2024-09-26 [email protected] Add a `@SuppressWarnings` in advance (flutter/packages#7712) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/ doc/main/autoroll/README.md
fixes: flutter/flutter#150053
related to : flutter/flutter#96112
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style, or this PR is exempt from CHANGELOG changes.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.