Use <picture> for theme-specific images on site

This commit is contained in:
hensm
2019-05-22 16:09:56 +01:00
parent 0bee1d1f1b
commit db647e2295
2 changed files with 4 additions and 8 deletions

View File

@@ -309,12 +309,6 @@ body {
background-color: var(--grey-10-a10); background-color: var(--grey-10-a10);
} }
:root.theme-light .img-dark,
:root.theme-dark .img-light {
display: none;
}
.footer { .footer {
align-items: center; align-items: center;

View File

@@ -67,8 +67,10 @@
<details class="faq card" open> <details class="faq card" open>
<summary class="faq__summary">How do I cast something?</summary> <summary class="faq__summary">How do I cast something?</summary>
<div class="faq__content"> <div class="faq__content">
<img src="images/menu_light.png" alt="Media context menu" class="img-light" style="float: right"> <picture style="float: right">
<img src="images/menu_dark.png" alt="Media context menu" class="img-dark" style="float: right"> <source srcset="images/menu_light.png" alt="Media context menu" media="(prefers-color-scheme: light)">
<img src="images/menu_dark.png" alt="Media context menu">
</picture>
<p> <p>
Ignore the toolbar button for now, it's just a placeholder for development. Ignore the toolbar button for now, it's just a placeholder for development.
</p> </p>