From ab38a9e368f86f8aa26cedb32329e805d81c378d Mon Sep 17 00:00:00 2001 From: Ilya Kruchinin Date: Fri, 2 Sep 2022 11:44:35 +0300 Subject: [PATCH 1/5] adding initial class to body programmatically --- public/app.js | 3 +++ public/index.html | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/public/app.js b/public/app.js index b3352ed..74a7ec0 100644 --- a/public/app.js +++ b/public/app.js @@ -14,6 +14,9 @@ const isSolar = localStorage.getItem('isSolar'); if (theme) { body.classList.add(theme); isSolar && body.classList.add('solar'); +} else { + body.classList.add('light'); + localStorage.setItem('theme', 'light'); } // Button Event Handlers diff --git a/public/index.html b/public/index.html index 9027bb0..a5bc4c3 100644 --- a/public/index.html +++ b/public/index.html @@ -15,7 +15,7 @@ - +