This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Add Class Dark or Light to body tag

  • Creator
    Topic
  • #3882
    mharpen
    Participant

    Hi J. It would be helpful if the body tag included a class “light” or “dark” so we could customize our css based on which theme color option is selected. For example: One of my css customizations is to darken the border-color and color of textboxes and select elements for the “light” color theme option. I can’t find a way using just css to use a different color if the theme color is “dark”. Any suggestions for now? Thanks a ton as always!

    input, textarea, select {color:#888; border-color:#888}
Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #3897
    Jason Bobich
    Keymaster

    Hello,

    I’m not sure this would really be relevant to the average person because on everyone’s site, you’re either going to have it set one way or the other. So, there wouldn’t really be any reason to style things different based on the option.

    But this would be is very easy to do. You’d just filter WordPress’s “body_class” something like this:

    function my_body_class( $classes ) {
    	$classes[] = themeblvd_get_option( 'body_style' );
    	return $classes;
    }
    add_filter( 'body_class', 'my_body_class' );
Viewing 1 replies (of 1 total)
  • The forum ‘Alyeska Responsive WordPress Theme’ is closed to new topics and replies.