Automatic contrast color picking (fixes #43)

This commit is contained in:
daudix
2024-12-23 22:48:34 +03:00
parent b4734dd6e1
commit 08860f5974
8 changed files with 25 additions and 98 deletions

View File

@ -7,16 +7,6 @@
{%- else -%}
--accent-color: {{ config.extra.accent_color | default(value="#6f8396") | safe }};
{%- endif -%}
{%- if page.extra.fix_contrast -%}
--contrast-color: rgb(0 0 0 / 0.8);
{%- elif section.extra.fix_contrast -%}
--contrast-color: rgb(0 0 0 / 0.8);
{%- elif config.extra.fix_contrast -%}
--contrast-color: rgb(0 0 0 / 0.8);
{%- else -%}
--contrast-color: #fff;
{%- endif -%}
}
{%- if page.extra.accent_color_dark -%}
@ -51,18 +41,6 @@
}
{%- endif -%}
{%- if page.extra.fix_contrast_dark or section.extra.fix_contrast_dark or 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.debug.layout -%}
*,
*::before,