Skip to content

Conversation

@Garderoben
Copy link
Member

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-serif

This 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

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests.

@github-actions github-actions bot added bug Unexpected behavior or functionality not working as intended PR: needs review labels Apr 21, 2025
@sonarqubecloud
Copy link

@codecov
Copy link

codecov bot commented Apr 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.08%. Comparing base (be80b02) to head (74ffeb5).
Report is 4 commits behind head on dev.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ScarletKuro ScarletKuro merged commit 5677a8e into MudBlazor:dev Apr 22, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unexpected behavior or functionality not working as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ThemeProvider does not use CSS reserved font families

2 participants