[Issue] Static font name for loading fonts #29515
Labels
Fixed in 2.4.x
The issue has been fixed in 2.4-develop branch
Issue: Format is not valid
Gate 1 Failed. Automatic verification of issue format is failed
Priority: P3
May be fixed according to the position in the backlog.
Severity: S2
Major restrictions or short-term circumventions are required until a fix is available.
This issue is automatically created based on existing pull request: #29210: Static font name for loading fonts
Description (*)
The variable
@font-family-name__base
shouldn't be used when loading the Open Sans font because it's not really something that should change, since the source will still point to the Open Sans font. Using the variable here (can) cause issues when you change the base font (e.g. in a child theme).Example 1:
If your custom theme extends from the Blank Theme and you change the base font with:
This will be the compiled CSS:
Which is already wrong, but doesn't directly lead to problems since 'Trenda' is a custom font and you'll probably do something like this in your theme:
In which case this @font-face block will be included in the compiled CSS later, and your browser will only 'use' this one. However, if you only load the font in regular font-weight here, and you want to show text in bold, the browser will show that text in Open Sans (bold).
Example 2:
If your custom theme extends from the Blank Theme and you want to switch to a 'websafe' font, for example Times New Roman:
Text won't be displayed in the real Times New Roman but in Open Sans because that is loaded under the name 'Times New Roman'.
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
@font-family-name__base
to'Times New Roman'
(either temporary in Blank Theme or in a theme that extends from Blank)Questions or comments
Contribution checklist (*)
The text was updated successfully, but these errors were encountered: