Emilance / Javascript-Calculator-App

A calculator app built with HTML & CSS & JS
https://emmycalculatorapp.netlify.app
23 stars 42 forks source link

Added the Theme Auto-detection Functionality #72

Closed Olulanke-Mainasara closed 1 year ago

Olulanke-Mainasara commented 1 year ago

I'm really glad I could contribute to the project, hope to do more soon🚀

netlify[bot] commented 1 year ago

Deploy Preview for emmycalculatorapp ready!

Name Link
Latest commit fd3c0bfa5be8202f37518d150614cfc3f2929a65
Latest deploy log https://app.netlify.com/sites/emmycalculatorapp/deploys/63e04a03a4e9b6000964e81c
Deploy Preview https://deploy-preview-72--emmycalculatorapp.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Emilance commented 1 year ago

@Olulanke-Mainasara, it's nice to have you here ☺️☺️. thank you

Kindly explain your changes clearly to make it easy for maintainer to decipher your contribution

Olulanke-Mainasara commented 1 year ago

Sure, no problem

So I noticed that the theme of the app was defaulting to “light” mode when the app is opened in the browser, and even after the user changes it to “dark” mode, it still defaults back to “light” mode if the page is reloaded.

So what I did was I gave the app the ability to check if the users device theme is “dark” or “light”, and then set the theme of the app accordingly. I also added the ability for the theme chosen by the user to persist, so that on page reload, the theme doesn’t just default to “light” mode.

Hope this explains it😅

Emilance commented 1 year ago

Nice feature🥰, tested on the ephemeral environment. I appreciate your contribution @Olulanke-Mainasara