Theme Customizer: Live Preview CSS by Media Query
-
I’m using the Theme Customization API to allow changes to all website colors. My website is responsive and the navigation changes for mobile devices. My CSS looks similar to the following:
nav { background-color: #fff; } @media only screen and max-width 767px { nav { background-color: #b00; } }
I set them all up as follows, but I’m not able to figure out how to make this bind to a media query.
wp.customize( 'background_color', function( value ) { value.bind( function( newval ) { $('nav').css('background-color', newval ); } ); } );
Any help would be appreciated.
Thanks
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Theme Customizer: Live Preview CSS by Media Query’ is closed to new replies.