Added support for #only-light and #only-dark image hash fragments

This commit is contained in:
squidfunk 2021-12-11 15:22:13 +01:00
parent 90410f3910
commit e3fba7ac7d
10 changed files with 23 additions and 8 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -34,10 +34,10 @@
{% endif %}
{% endblock %}
{% block styles %}
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.4a1f2921.min.css' | url }}">
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.eee90d4d.min.css' | url }}">
{% if config.theme.palette %}
{% set palette = config.theme.palette %}
<link rel="stylesheet" href="{{ 'assets/stylesheets/palette.9204c3b2.min.css' | url }}">
<link rel="stylesheet" href="{{ 'assets/stylesheets/palette.dc90facb.min.css' | url }}">
{% if palette.primary %}
{% import "partials/palette.html" as map %}
{% set primary = map.primary(

View File

@ -439,6 +439,11 @@ kbd {
}
}
// Hide images for dark mode
img[src$="#only-dark"] {
display: none;
}
// Figure
figure {
display: flow-root;

View File

@ -95,5 +95,15 @@
// Typeset color shades
--md-typeset-a-color: hsla(#{hex2hsl($clr-indigo-400)}, 1);
}
// Hide images for light mode
img[src$="#only-light"] {
display: none;
}
// Show images for dark mode
img[src$="#only-dark"] {
display: initial;
}
}
}