• The Open Market

    (@jhutson323)


    I’m kind of a noob, but hear me out.

    I’ve got a couple frontend elements on mobile that I set up with PHP and CSS (see mobile header). I’m unable to target this element or it’s contents with css directly on the dracula plugin.

    Is there a “listener” I can add to my php (and JS? JQ?) to change the color and/or formatting, etc. when dracula dark mode is active?

    Thanks!

    PS, this plugin is way better than it’s biggest competitor, WP Dark Mode. It’s not even close.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Sazzad Hossain

    (@sazzad11)

    Hi The Open Market team,

    Please note that the Dracula Dark Mode functionality is entirely handled on the frontend using JavaScript, and there are no PHP listeners involved.

    The frontend includes two custom event listeners:

    // Dracula Enable
    document.addEventListener('dracula:enable', () => {
    // Perform actions when Dracula mode is enabled
    console.log('Dracula Enable');
    });

    // Dracula Disable
    document.addEventListener('dracula:disable', () => {
    // Perform actions when Dracula mode is disabled
    console.log('Dracula Disable');
    });

    These listeners respond to custom events:

    dracula:enable – Fired when dark mode is activated.

    dracula:disable – Fired when dark mode is deactivated.

    You can hook into these events to trigger any additional logic or UI updates as needed.

    Addendum
    I cleared the browser cache and tried again. But now the wheel next to Add to Menu keeps spinning forever and the window for the Pro version installation no longer appears.

    Sorry, I replied to the wrong topic.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Dracula Dark Mode php listener?’ is closed to new replies.