Allow setting different primary color for dark mode (fixes #35)
This commit is contained in:
@ -4,6 +4,9 @@
|
||||
<meta name="description" content="{{ config.description }}" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="theme-color" content="{{ config.extra.primary_color | default(value='#9a9996') }}" />
|
||||
{%- if config.extra.primary_color_dark %}
|
||||
<meta name="theme-color" content="{{ config.extra.primary_color_dark }}" media="(prefers-color-scheme:dark)" />
|
||||
{%- endif %}
|
||||
<link rel="canonical" href="{{ current_url | default(value='/') | safe }}" />
|
||||
<title>{% include "partials/title.html" %}</title>
|
||||
|
||||
@ -37,6 +40,15 @@
|
||||
--primary-color: {{ config.extra.primary_color | default(value="#9a9996") }};
|
||||
--primary-color-alpha: {{ config.extra.primary_color_alpha | default(value="rgba(154, 153, 150, 0.2)") }};
|
||||
}
|
||||
|
||||
{%- if config.extra.primary_color_dark %}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--primary-color: {{ config.extra.primary_color_dark }};
|
||||
--primary-color-alpha: {{ config.extra.primary_color_dark_alpha }};
|
||||
}
|
||||
}
|
||||
{%- endif %}
|
||||
</style>
|
||||
|
||||
{%- if config.extra.goatcounter %}
|
||||
|
Reference in New Issue
Block a user