bufferhead-code / nightowl

Add Dark Mode to your website semi-automatically.
198 stars 16 forks source link

Issue #3 Ability to set a mode #5

Closed LucGzy closed 11 months ago

LucGzy commented 11 months ago

This code allows you to set a default mode for first visits using window.defaultMode = "dark"; or window.defaultMode = "light"; in the script tag, keeping things a one liner import as well as they are in the same tag than the original. Also i mentionned first visit because locally stored value will ALWAYS overwrite this value. If left empty the default behavior apply (aka system/browser pref).

bufferhead-code commented 11 months ago

hi, thank you for the contribution.

i just added formatting to the main branch. could you please merge back the main branch into this one, and after resolving the conflicts, run npm run format and npm run lint