• Hello.

    Is there a way to change the color of the text to something else when it’s in dark mode?

    My issue is that I’m trying to set the text to black color, but that makes the text impossible to read when in dark mode. So I was wondering if it’s possible to make the text white when in dark mode.

    Thank you.

    • This topic was modified 4 years, 1 month ago by jamiedonovan.
Viewing 1 replies (of 1 total)
  • Theme Author Alexander Agnarson

    (@alxmedia)

    Hi, on line 578 in functions.php you will see:

    
    if ( get_theme_mod( 'wave-style','on' ) != 'on' ) { $classes[] = 'wave-hide'; }
    

    The same way you can add a body class if dark mode is turned on.

    
    if ( get_theme_mod( 'dark','on' ) != 'on' ) { $classes[] = 'dark-enabled'; }
    

    And then use it like…

    
    body.dark-enabled .myclass { color: red; }
    

    If you want to add a class on pressing on the darkmode switch instead, you need to add additional js.

Viewing 1 replies (of 1 total)
  • The topic ‘Changing font color according to dark or light mode’ is closed to new replies.