Skip to content

Use localStorage instead of cookies to store darkMode #30

@TheKingDave

Description

@TheKingDave

I would recommend using localStorage instead of cookies to store the darkMode state.

This stores the data only on the client and does not send it to the server all the time.
It is easier to work with because it does not need additional parsing, or serialization.
Additionally it is also well supported and meets the IE11 requirement.

Example with darkMode:

// Set darkMode
window.localStorage.setItem('darkModeOn', this.darkModeOn);
// Get darkMode
window.localStorage.getItem('darkModeOn');

I am very willing to create a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions