Opened 4 years ago
Last modified 4 years ago
#48630 new enhancement
Twenty Twenty: please use wp_enqueue_style for the fonts
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Bundled Theme | Keywords: | 2nd-opinion dev-feedback |
Focuses: | ui, performance | Cc: |
Description
Please please use wp_enqueue_style for the fonts (not CSS @import
), so that they can be dequeued by a Child Theme or Plugin. (In case the Child Theme or Plugin wants to use different fonts.)
Change History (10)
#2
in reply to:
↑ 1
;
follow-up:
↓ 3
@
4 years ago
Replying to nielslange:
@markhowellsmead Where do you see
@import
statements for fonts?
Sorry, my bad - they're directly-referenced src
s in @font-face
statements.
https://github.com/WordPress/twentytwenty/blob/master/style.css#L254
#3
in reply to:
↑ 2
@
4 years ago
- Keywords needs-patch added
Sorry, my bad - they're directly-referenced
src
s in@font-face
statements.
https://github.com/WordPress/twentytwenty/blob/master/style.css#L254
Don't worry and thanks for clarifying this! 😉 I see what you mean now and will create a patch for that. If the patch gets accepted is another story though. 😁
#5
follow-up:
↓ 6
@
4 years ago
I'm confused as to what the issue here is. If a child theme wants to use different fonts, it can do so simply by defining them as such in the child theme CSS.
#6
in reply to:
↑ 5
@
4 years ago
Replying to Otto42:
I'm confused as to what the issue here is. If a child theme wants to use different fonts, it can do so simply by defining them as such in the child theme CSS.
This true, but the font files from the parent theme will still be loaded, which is a(n albiet minor) performance hit.
#8
@
4 years ago
I agree that non system fonts should be enqueued.
Though I should probably learn more about variable fonts before I open my mouth ;)
@markhowellsmead Where do you see
@import
statements for fonts?