Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

favicon: add light & dark option for OS's prefered color scheme #553

Merged
merged 3 commits into from
Jun 5, 2023

Conversation

tlindsay42
Copy link

{{- if (fileExists "/static/images/favicon-dark.svg") }}
<link href="{{ "images/favicon-dark.svg" | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="icon" type="image/svg+xml" media="(prefers-color-scheme: dark)">
{{- end }}
{{- else if (fileExists "/static/images/favicon.svg") }}
Copy link
Owner

Choose a reason for hiding this comment

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

This should also be supported for the other file types. Not just SVG

Because this would mean to duplicate a lot of code, the better way would be to refactor the code using a parameterized inline template

@tlindsay42 tlindsay42 requested a review from McShelby June 2, 2023 00:20
@McShelby McShelby merged commit b705e0b into McShelby:main Jun 5, 2023
@McShelby McShelby added this to the 5.16.0 milestone Jun 6, 2023
@McShelby McShelby added the feature New feature or request label Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

favicon: add light & dark option for OS's preferred color scheme
2 participants