Skip to content

chore: remove unused Google Fonts links#2714

Merged
mroderick merged 1 commit into
masterfrom
remove-unused-google-fonts
Jul 16, 2026
Merged

chore: remove unused Google Fonts links#2714
mroderick merged 1 commit into
masterfrom
remove-unused-google-fonts

Conversation

@mroderick

@mroderick mroderick commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

In preparing for adopting better security headers, I discovered that these fonts are unused and dead weight (and a privacy concern).

Problem

Two Google Fonts are loaded from fonts.googleapis.com in app/views/layouts/application.html.haml:

  • Open Sans (/css?family=Open+Sans:400,300)
  • Material Icons (/icon?family=Material+Icons)

This triggers requests to fonts.googleapis.com (serves @font-face CSS) and fonts.gstatic.com (serves the actual font files), which is a GDPR concern — user IPs and user-agent data are sent to Google without consent.

We investigated whether Fontsource or another approach was needed, but the fonts turned out to be fully unused.

Investigation

Both fonts are unreferenced in any CSS

Check Result
font-family: 'Open Sans' in SCSS/CSS Not found
font-family: 'Material Icons' in SCSS/CSS Not found
@font-face declarations None
Referenced in JavaScript Not found
Referenced by any gem (Bootstrap, etc.) Not found

Bootstrap 5 uses a system font stack (system-ui, -apple-system, ...). No custom $font-family-* overrides exist in the project SCSS.

Git history confirms they're dead

Open Sans

  • Apr 2015 — Added to layout and used as $body-font-family in Foundation (foundation_and_overrides.scss)
  • Sep 2022 — Entire Foundation file deleted during Bootstrap 5 migration (36758d5e). Last CSS reference removed.
  • Dead for ~4 years.

Material Icons

  • Feb 2019<link> added to layout (15a70da3)
  • Never referenced in any CSS in the project's entire history.
  • Dead for ~7.5 years.

Font Awesome 5 is already self-hosted via the font_awesome5_rails gem — no CDN issue.
Plausible analytics is also self-hosted (/js/script.js, /api/event) — no GDPR concern.

Change

Removed two <link> tags from app/views/layouts/application.html.haml. That's it — no visual change, no regression risk on the rendering front.

GDPR Risk Resolved

Domain Purpose After this PR
fonts.googleapis.com Serves @font-face CSS No longer requested
fonts.gstatic.com Serves .woff2 font files No longer requested (triggered by the CSS above)

Open Sans and Material Icons were loaded from fonts.googleapis.com but
neither font is referenced by font-family anywhere in the application:

- Open Sans was last used as the Foundation body font — removed in 2022
  when Foundation was deleted during the Bootstrap 5 migration
- Material Icons was added in 2019 and never referenced in any CSS

Font Awesome 5 is already self-hosted via the font_awesome5_rails gem.
Plausible analytics is also self-hosted.

Removing these two tags eliminates all external font requests, resolving
the GDPR concern with no visual change.
@mroderick
mroderick marked this pull request as ready for review July 16, 2026 13:05

@KimberleyCook KimberleyCook left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Niiiiice!!

@mroderick
mroderick merged commit 67acb14 into master Jul 16, 2026
9 checks passed
@mroderick
mroderick deleted the remove-unused-google-fonts branch July 16, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants