-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
💥 SharePoint Framework
Developer environment
None
What browser(s) / client(s) have you tested
- 💥 Internet Explorer
- 💥 Microsoft Edge
- 💥 Google Chrome
- 💥 FireFox
- 💥 Safari
- mobile (iOS/iPadOS)
- mobile (Android)
- not applicable
- other (enter in the "Additional environment details" area below)
Additional environment details
- SPFx 1.21.1
Describe the bug / error
Hi,
We have noticed that the default state of brand center custom font CSS variables is different depending on whether or not a font has ever been applied. It is undefined when no custom fonts have ever been applied. Once you apply a font and then reset it back to default, they are still present, but empty. Expectation would be that when resetting back to default those variables are undefined. This helps us with custom solutions that have custom fonts defined as a CSS variable fallback.
Thanks!
Steps to reproduce
- Upon initial loading of a page where no fonts have ever been applied, all the CSS variables (e.g. --fontFamilyCustomFont1600, etc) are undefined (as expected). This helps us with our custom solutions where we may have custom fonts defined as a fallback.
- Apply a custom font package from the brand center and you see all the CSS variables defined (as expected).
- Set the site collection font back to "Microsoft default: Segoe UI" and on page load we can see that the font CSS variables are not undefined, but still populated as empty. Because they are empty, our fallbacks don't apply correctly and it ends up inheriting default fonts.
Expected behavior
Our expectation would be that when resetting fonts back to default that the CSS variable behavior is the same as the initial state where those variables are undefined. This ensures we have consistent fallback behavior in our custom solutions for the "default" scenario where no custom fonts are actually being applied through a font package.