Automate font icon hash bust variable setting

Created on 13 March 2025, 20 days ago

Problem/Motivation

If theme uses custom font icon feature then when new icons are added or old one changes you also need to tell browser to cache bust that font asset and that is done with `$bs-icon-font-hash`. This SASS variable you need to manually increment/change each time you change something in generated font icons asset. Additionally if you are using preload feature you need to change hash value also there.

This is a bit of manual work that needs to be done each time icons are updated. It is not difficult but devs (including me) will forget it.

@Berdir has idea how we could automate this. Instead of manually assigning a hash value to `$bs-icon-font-hash` we could do it automatically - when generating font icons file we also generate hash value from font icon asset file content and then generator would also replace or add hash values to SASS `$bs-icon-font-hash` and in preload font url. Currently we can have hash value in yaml file and in SASS var file. But we will soon drop yaml support for SASS vars override in 📌 Remove theme-options.yml feature Active which would make this code simpler.

Not sure for now where should this be added in bs_lib drush generator code or maybe in gulp task for font icon generation. We figure where it is more easier to be implemented when we start working on this.

This depends on 📌 Remove theme-options.yml feature Active which needs to be done first.

Feature request
Status

Active

Version

2.0

Component

BS Base

Created by

🇷🇸Serbia pivica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024