Requested by Razem
Preloaded fonts include in Vartheme so it’s already properly used with preload https://web.dev/preload-critical-assets/
Problem/Motivation
Preload critical assets to improve loading speed
Preload W3C Candidate Recommendation 26 June 2019
Proposed resolution
Follow the new way in the new Drupal default front end theme Olivero
{% include '@olivero/includes/preload.twig' with { olivero_path: olivero_path } only %}
https://git.drupalcode.org/project/drupal/-/blob/9.2.x/core/themes/olive...
https://git.drupalcode.org/project/drupal/-/blob/9.2.x/core/themes/olive...
Should have in Vartheme BS4 and VARTHEM_BS4_SUBTHEME
And the include
{%- include '@vartheme_bs4/includes/preload.twig' with { vartheme_bs4_path: vartheme_bs4_path, html_dir: html_attributes['dir'] } only -%}
{%- include '@VARTHEME_BS4_SUBTHEME/includes/preload.twig' with { VARTHEME_BS4_SUBTHEME_path: VARTHEME_BS4_SUBTHEME_path, html_dir: html_attributes['dir'] } only -%}
Themes should be able to add their preload assets as they like
Remaining tasks
- Change
- Test
- Rrelease
User interface changes
Faster load of face fonts
or could be used for any other preloaded assets
API changes
None
Data model changes
None
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | Can-I-use-preload.png | 409.39 KB | rajab natshah |

Comments
Comment #2
rajab natshahComment #3
rajab natshahComment #4
rajab natshahComment #5
rajab natshahComment #6
rajab natshahComment #7
rajab natshahComment #8
rajab natshahComment #9
rajab natshahComment #10
rajab natshahComment #14
rajab natshahComment #15
rajab natshahComment #16
rajab natshahComment #17
rajab natshah