• Resolved Maison da Silva

    (@maisondasilva)


    It would be cool to have the option to Auto theme, instead of choosing Light or Dark, in my case my theme has automatic mode!

    I just enabled the invisible option as a workaround!
    Thanks

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor kaggdesign

    (@kaggdesign)

    The dark mode settings depend on the theme/”dark mode plugin” installed. Which one do you use?

    Thread Starter Maison da Silva

    (@maisondasilva)

    My theme has both dark and light modes, which apply depending on the mode the device is in. Can you apply this to your plugin?

    Plugin Contributor kaggdesign

    (@kaggdesign)

    What is the Theme name, where can I download it for testing?

    Thread Starter Maison da Silva

    (@maisondasilva)

    Plugin Contributor kaggdesign

    (@kaggdesign)

    I know all of that. Different plugins and themes add different classes to different elements to turn on dark theme.

    Can you provide a link to a page using your custom theme with dark mode switcher?

    Thread Starter Maison da Silva

    (@maisondasilva)

    I added you on Skype, can I send link there?

    Plugin Contributor kaggdesign

    (@kaggdesign)

    Yes.

    Plugin Contributor kaggdesign

    (@kaggdesign)

    I have added dark mode support for
    WP 2021 theme
    WP Dark Mode plugin
    WP Droit plugin

    As your theme is custom, I cannot include support for it in the plugin with 50,000+ installs. Instead, I have added a JS filter, which can be used to follow dark mode settings on your website.

    When v3.5.0 is released, you can set Auto for the hCaptcha theme on the General settings page.

    After that, you can add the following file to your wp-content/mu-plugins folder. You should see dark hCaptcha in a dark theme, then.

    <?php
    function my_print_scripts() {
        ?>
        <script>
            document.addEventListener( 'DOMContentLoaded', function() {
                const callback = ( darkData ) => {
                    darkData['blog-stream'] = {
                        // Blogstream theme.
                        darkStyleId: 'blogstream-style-css',
                        darkElement: document.body,
                        darkClass: 'dark',
                    };
    
                    console.log( 'Data added.' );
    
                    return darkData;
                };
    
                window.hCaptcha.hooks.addFilter( 'hcaptcha.darkData', 'hcaptcha', callback );
            } );
        </script>
        <?php
    }
    
    add_action( 'wp_print_scripts', 'my_print_scripts' );
    • This reply was modified 11 months, 3 weeks ago by kaggdesign.
    • This reply was modified 11 months, 3 weeks ago by kaggdesign.
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Theme Auto for Light or Dark’ is closed to new replies.