Skip to content

Commit

Permalink
ダークモードのデフォルト設定をOSのテーマと連動するようにした (Closed #2)
Browse files Browse the repository at this point in the history
初回アクセス時(Cookie に settings がない状態)にブラウザがダークモードならダークモードで、それ以外ならライトモードに設定します
  • Loading branch information
tsukumijima committed Mar 20, 2021
1 parent 94b8d1f commit f235dc2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@

<script>

// 個人設定のデフォルト値
// 個人設定の初期値
settings = {
twitter_show: true,
comment_show: true,
dark_theme: false,
dark_theme: matchMedia('(prefers-color-scheme: dark)').matches, // ダークモードなら true になる
subchannel_show: false,
list_view: false,
logo_show: true,
Expand Down

0 comments on commit f235dc2

Please sign in to comment.