Update CSS and configuration for theme opacity and color management
This commit is contained in:
@ -42,18 +42,41 @@
|
||||
:root {
|
||||
--primary-color: {{ config.extra.primary_color | default(value="#6f8396") | safe }};
|
||||
--contrast-color: {% if config.extra.fix_contrast %}rgb(0 0 0 / 0.8){% else %}#fff{% endif %};
|
||||
--color-opacity: {{ config.extra.color_opacity | default(value="0.1") }};
|
||||
}
|
||||
|
||||
{%- if config.extra.primary_color_dark %}
|
||||
[data-theme="dark"] {
|
||||
--primary-color: {{ config.extra.primary_color_dark | safe }};
|
||||
--contrast-color: {% if config.extra.fix_contrast_dark %}rgb(0 0 0 / 0.8){% else %}#fff{% endif %};
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root:not([data-theme="light"]) {
|
||||
--primary-color: {{ config.extra.primary_color_dark | safe }};
|
||||
--contrast-color: {% if config.extra.fix_contrast_dark %}rgb(0 0 0 / 0.8){% else %}#fff{% endif %};
|
||||
}
|
||||
}
|
||||
{%- endif %}
|
||||
|
||||
{%- if config.extra.fix_contrast_dark %}
|
||||
[data-theme="dark"] {
|
||||
--contrast-color: rgb(0 0 0 / 0.8);
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root:not([data-theme="light"]) {
|
||||
--contrast-color: rgb(0 0 0 / 0.8);
|
||||
}
|
||||
}
|
||||
{%- endif %}
|
||||
|
||||
{%- if config.extra.color_opacity_dark %}
|
||||
[data-theme="dark"] {
|
||||
--color-opacity: {{ config.extra.color_opacity_dark | default(value="0.1") }};
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root:not([data-theme="light"]) {
|
||||
--color-opacity: {{ config.extra.color_opacity_dark | default(value="0.1") }};
|
||||
}
|
||||
}
|
||||
{%- endif %}
|
||||
|
@ -78,7 +78,7 @@
|
||||
{%- if config.languages | length > 0 %}
|
||||
{%- include "partials/language_switcher.html" %}
|
||||
{%- endif -%}
|
||||
{%- if config.extra.nav.show_theme_switcher %}
|
||||
{%- if config.extra.default_theme or config.extra.nav.show_theme_switcher %}
|
||||
<li id="theme-switcher">
|
||||
<details>
|
||||
<summary class="circle" title="{{ macros_translate::translate(key='theme', default='Theme', language_strings=language_strings) }}">
|
||||
|
Reference in New Issue
Block a user