CSSでダークモード


あなたのウェブサイト上でダークモードを達成するために使用するとJSにプラグインの茄多があります.これを行う簡単で単一の方法はCSSルールフィルタを追加することです.以下に例を示します.
<section> This is some text. </section>

<a href = "#'> a Link </a>
html { 
       background: black;
       filter: invert(1); /* This will flip the contents on the page, from black to its inverted color*/
}

a {
    color: green; /* This will render as a light pink or purple*/
}

リンクを緑色にするには、Huey - rotate ()関数をfilterプロパティに追加します.

html { 
       background: black;
       filter: invert(1) hue-rotate(180deg); /* This will flip the color back to its original value.*/
}
このポストのためのインスピレーション
タイムスタンプ: 17 : 29
ハッピーコーディング!😊