basxsoftwareassociation / bread

Engine to create database applications based on Django and the IBM Carbon Design System
BSD 3-Clause "New" or "Revised" License
19 stars 2 forks source link

Remove references to fonts.gstatic.com and use local static files #136

Closed saemideluxe closed 2 years ago

saemideluxe commented 2 years ago

Instead of relying on Google's CDN we can serve fonts files via django-static. The files are already inside bread/static/fonts, we only need to change the scss files. The relevant files are inside bread/static/design/carbon_design/scss/globals/scss/vendor/@carbon/type/scss:

We can remove the "woff" support, as it only for really old browsers (roughly 2015 ear) or Internet Explorer. Only woff2 is required. And we can assume a fixed static url /static/ (normally we should rely on djangos configuration of the url prefix for static urls). This is not optimal, but this is practice the only value used and we can work-around in other cases.