Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

FSPT-156 Fix serving static fonts and favicon #382

Merged
merged 2 commits into from
Dec 11, 2024

Conversation

sfount
Copy link
Contributor

@sfount sfount commented Dec 6, 2024

Currently the authenticator app services web pages that fallback on the arial font and don't have the GOV.UK crown as the Favicon. This gives in inconsistent user experience, looks visually broken and doesn't follow the guidance to use "GDS Transport" on gov.uk domains.

Tell the flask app to serve static assets from the /assets path. As we're not customising our styles from the base design system SCSS we'll use the default path included in the pre-built CSS.

The relative paths for the /fonts and /images will now line up and the appropriate font should be used.

Remove custom logic for manipulating the asset path in the CSS thats copied over, that is error prone as evidenced by the fact it would update for the font files but not the favicon. (Instead we adjust where static files are served from Flask).

Network tab before:

Screenshot 2024-12-06 at 17 25 06

Page and network tab after:

Screenshot 2024-12-06 at 17 23 07

samuelhwilliams
samuelhwilliams previously approved these changes Dec 6, 2024
Copy link
Contributor

@samuelhwilliams samuelhwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A gorgeous change 👏 🙇 (although the favicon is still the St Edward's Crown and should now be the Tudor Crown)

image

MarcUsher
MarcUsher previously approved these changes Dec 11, 2024
Currently the authenticator app services web pages that fallback on the
`arial` font and don't have the GOV.UK crown as the Favicon. This gives
in inconsistent user experience, looks visually broken and doesn't
follow the guidance to use "GDS Transport" on gov.uk domains.

Tell the flask app to serve static assets from the `/assets` path. As
we're not customising our styles from the base design system SCSS we'll
use the default path included in the pre-built CSS.

The relative paths for the `/fonts` and `/images` will now line up and
the appropriate font should be used.

Remove custom logic for manipulating the asset path in the CSS thats
copied over, that is error prone as evidenced by the fact it would
update for the font files but not the favicon. (Instead we adjust where
static files are served from Flask).
This updates the design system + jinja to gov uk frontend 4.8. This was
a period before the breaking changes of v5 that bundles the new crown
that services could opt in to.
@sfount sfount merged commit 72209c2 into main Dec 11, 2024
9 checks passed
@sfount sfount deleted the FSPT-156-fix-serving-static-assets-left branch December 11, 2024 15:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants