material-bliss-jekyll-theme icon indicating copy to clipboard operation
material-bliss-jekyll-theme copied to clipboard

Using cookies for theme button

Open psprint opened this issue 8 years ago • 1 comments

Hello Could it be possible to save theme in cookies? I've checked that this bool is enough to be changed to make the page start in light theme:

diff --git a/react-dev/components/app.js b/react-dev/components/app.js
index ad93844..e2bb1da 100644
--- a/react-dev/components/app.js
+++ b/react-dev/components/app.js
@@ -85,7 +85,7 @@ const lightMuiTheme = getMuiTheme(null, {
 export default class App extends Component {
   constructor(props) {
     super(props);
-    this.state = { dark: true };
+    this.state = { dark: false };
   }

Maybe it isn't hard to attach a cookie to it?

psprint avatar Mar 17 '17 11:03 psprint

yes! This is a great idea. Consequently, this theme is my first foray into a real Javascript/React theme, so I didn't worry about cookies yet.

I will definitely implement this. Great idea @psprint

I'm currently busy with my job since deadlines are approaching, but I will get to it, no worries.

insipx avatar Mar 17 '17 16:03 insipx