Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Commit

Permalink
PostMessage in Primary Color
Browse files Browse the repository at this point in the history
Can only do it with Primary Color because pseudo elements don't work
with JS' CSS: #57
  • Loading branch information
HardeepAsrani committed Jul 3, 2018
1 parent 79dc621 commit e3b9107
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions inc/customizer.php
Expand Up @@ -446,6 +446,7 @@ function amadeus_customize_register( $wp_customize ) {
array(
'default' => '#618EBA',
'sanitize_callback' => 'sanitize_hex_color',
'transport' => 'postMessage',
)
);
$wp_customize->add_control(
Expand Down
7 changes: 7 additions & 0 deletions js/customizer.js
Expand Up @@ -27,6 +27,13 @@



//Primary color
wp.customize('primary_color',function( value ) {
value.bind( function( newval ) {
$('a, a:hover, .main-navigation a:hover, .nav-next a:hover, .nav-previous a:hover, .social-navigation li a:hover').css('color', newval );
$('button, .button, input[type="button"], input[type="reset"], input[type="submit"], .entry-thumb-inner').css('background-color', newval );
} );
});
//Social background
wp.customize('social_bg',function( value ) {
value.bind( function( newval ) {
Expand Down

0 comments on commit e3b9107

Please sign in to comment.