Fix vimeo and youtube shoertcodes in dark mode

This commit is contained in:
Ratan Kulshreshtha 2021-06-11 01:54:44 +05:30
parent 678f038308
commit 3596d4c1b9
4 changed files with 13 additions and 4 deletions

View File

@ -26,5 +26,12 @@ section
img[theme="dark"],
picture[theme="dark"],
pre[theme="dark"],
video[theme="dark"]
filter: invert(1) hue-rotate(180deg);
.vimeo[theme="dark"],
.youtube[theme="dark"],
.chart[theme="dark"]
filter: invert(1) hue-rotate(180deg);

View File

@ -218,13 +218,15 @@ $(document).ready(function () {
) {
localStorage.setItem("theme", "dark");
$("body").attr("theme", "dark");
$("img, picture, video").attr("theme", "dark");
$("img, picture, video, pre").attr("theme", "dark");
$(".vimeo, .youtube, .chart").attr("theme", "dark");
$("#dark-mode").attr("title", "Switch to light theme");
} else {
localStorage.setItem("theme", "light");
$("body").removeAttr("theme", "dark");
$("img, picture, video").removeAttr("theme", "dark");
$("img, picture, video, pre").removeAttr("theme", "dark");
$(".vimeo, .youtube, .chart").removeAttr("theme", "dark");
$("#dark-mode").attr("title", "Switch to dark theme");
}

View File

@ -1,4 +1,4 @@
<div class="is-flex is-justify-content-center is-align-items-center">
<div class="vimeo is-flex is-justify-content-center is-align-items-center">
<iframe
width="848" height="510"
title="vimeo-player"

View File

@ -1,4 +1,4 @@
<div class="is-flex is-justify-content-center is-align-items-center">
<div class="youtube is-flex is-justify-content-center is-align-items-center">
<iframe
width="848" height="510"
src="https://www.youtube.com/embed/{{id}}"