Browse Source

Add comments for extra CSS functionality.

Jeff Ong 5 years ago
parent
commit
41b34d72d6

+ 2 - 1
seedlet/inc/wpcom-colors.php

@@ -450,7 +450,8 @@ add_color_rule( 'fg2', '#FAFBF6', array(
 ), __( 'Tertiary Color' ) );
 
 /**
- * Custom CSS
+ * Custom CSS. 
+ * The plugin takes the body of this function and applies it in a style tag in the document head.
  */
 function seedlet_custom_colors_extra_css() {
 	$colors_array = get_theme_mod( 'colors_manager' );

+ 2 - 2
seedlet/inc/wpcom-customize-preview.js

@@ -18,8 +18,8 @@
 		} );
 	} );
 
-	// The wpcom colors plugin does not handle live updates of extra CSS.
-	// This function provides the CSS updates via JavaScript.
+	// Since the plugin handles customizer preview updates via the postMessage transport,
+	// we need to manually override the "extra CSS" when a user selects a different color palette.
 	wp.customize( 'colors_manager[colors]', function( value ) {
 		value.bind( function( to ) {
 			const { bg, fg1, fg2 } = to;

+ 1 - 0
seedlet/inc/wpcom-editor-colors.php

@@ -221,6 +221,7 @@ add_color_rule( 'fg2', '#FAFBF6', array(
 
 /**
  * Custom CSS
+ * The plugin takes the body of this function and applies it in a style tag in the document head.
  */
 function seedlet_custom_colors_extra_css() {
 	$colors_array = get_theme_mod( 'colors_manager' );