-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
MudThemeProvider: Only wrap multi-word font names in quotes in CSS font-family declarations #11214
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
Merged
+33
−28
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 tasks
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #11214 +/- ##
=======================================
Coverage 91.08% 91.08%
=======================================
Files 436 436
Lines 14143 14144 +1
Branches 2731 2731
=======================================
+ Hits 12882 12883 +1
Misses 639 639
Partials 622 622 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ScarletKuro
approved these changes
Apr 22, 2025
This was referenced Aug 1, 2025
Closed
This was referenced Aug 14, 2025
This was referenced Aug 25, 2025
This was referenced Sep 3, 2025
This was referenced Sep 8, 2025
This was referenced Sep 22, 2025
This was referenced Oct 1, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



Description
Currently MudBlazor adds quotations around every font name in the font family, this works for everything except the generic family names that is often used as fallbacks.
Example, this would still display Roboto as font:
'sans-serif', 'Roboto'This can be solved in different ways, one would be to have a list of all generic/system fonts and then skip the wraps for this font but then we would need to keep that list updated etc, another way would be to change the MudTheme's FontFamily Array to just a string but that would be a breaking change, and i prefer the array way.
I chose to only wrap the font name with quotes if the font name is more than one word, this automatically fixes the issue since the generic family names uses - rather than spaces.
Before:
'Public Sans', 'Roboto', 'Arial', 'sans-serif'After:
'Public Sans', Roboto, Arial, sans-serifThis change does not technically break anything but rather fix the broken behavior, however if someone would have configured there theme to something like this (unlikly)
'sans-serif', 'Roboto'then it will now display sans-serif instead of Roboto.fixes #5606
How Has This Been Tested?
visually, manually
Type of Changes
Checklist
dev).