Skip to content

Use theme-aware SVG favicon for Predbat web UI#3935

Open
jim-ip wants to merge 2 commits into
springfall2008:mainfrom
jim-ip:feature/svg-favicon-dark-mode
Open

Use theme-aware SVG favicon for Predbat web UI#3935
jim-ip wants to merge 2 commits into
springfall2008:mainfrom
jim-ip:feature/svg-favicon-dark-mode

Conversation

@jim-ip
Copy link
Copy Markdown

@jim-ip jim-ip commented May 17, 2026

Summary

Predbat currently uses bat_logo_light.png as the web favicon in both light mode and dark mode.

On dark browser tab backgrounds this results in a dark icon on a dark background because the favicon does not adapt to the active colour scheme.

Changes

  • Add docs/images/bat_logo.svg as a theme-aware favicon asset
  • Update apps/predbat/web_helper.py to use the SVG favicon first
  • Keep the existing bat_logo_light.png as a PNG fallback

Current behaviour

The HTML currently emits:

<link rel="icon" type="image/png" href="https://raw.githubusercontent.com/springfall2008/batpred/refs/heads/main/docs/images/bat_logo_light.png">

So both light mode and dark mode use the same light-mode PNG favicon.

Proposed behavior

The HTML will emit:

<link rel="icon" type="image/svg+xml" href="https://raw.githubusercontent.com/springfall2008/batpred/refs/heads/main/docs/images/bat_logo.svg">
<link rel="icon" type="image/png" href="https://raw.githubusercontent.com/springfall2008/batpred/refs/heads/main/docs/images/bat_logo_light.png">

This allows supported browsers to use the theme-aware SVG favicon while preserving PNG fallback compatibility.

@jim-ip jim-ip marked this pull request as ready for review May 17, 2026 10:19
Comment thread docs/images/bat_logo.svg
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Minor changes made to smooth out some of the vector curves where there were some indentations

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.

1 participant