Skip to content

Allow running callbacks when button is clicked #88

Open
@kdheepak

Description

@kdheepak

Thanks for maintaining darkmode.js.

This is a feature request. It would be nice to run some additional custom javascript code on light / dark mode toggle. For example, a user might want to toggle the theme of their comments using this:

const iframe = document.querySelector("iframe.giscus-frame");
iframe.contentWindow.postMessage({giscus: {setConfig: {theme: "dark"}}}, "https://giscus.app/");

It would be great if the constructor accepted a callback that was called in the on click handler for the button for toggling the light / dark mode.

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