Twenty Fifteen: Minor formatting and docs tweaks, clearer variable name.

Props celloexpressions, see #29988


Built from https://develop.svn.wordpress.org/trunk@30305


git-svn-id: http://core.svn.wordpress.org/trunk@30304 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Ian Stewart 2014-11-11 19:36:23 +00:00
parent 87bd82a0ab
commit 1317409eda
4 changed files with 18 additions and 11 deletions

View File

@ -17,8 +17,8 @@
function twentyfifteen_customize_register( $wp_customize ) {
$color_scheme = twentyfifteen_get_color_scheme();
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
// Add color scheme setting and control.
$wp_customize->add_setting( 'color_scheme', array(
@ -254,7 +254,7 @@ function twentyfifteen_customize_control_js() {
add_action( 'customize_controls_enqueue_scripts', 'twentyfifteen_customize_control_js' );
/**
* Binds JS handlers to make Customizer preview reload changes asynchronously.
* Binds JS handlers to make the Customizer preview reload changes asynchronously.
*
* @since Twenty Fifteen 1.0
*/
@ -266,6 +266,9 @@ add_action( 'customize_preview_init', 'twentyfifteen_customize_preview_js' );
/**
* Output an Underscore template for generating CSS for the color scheme.
*
* The template generates the css dynamically for instant display in the Customizer preview,
* and to be saved in a `theme_mod` for display on the front-end.
*
* @since Twenty Fifteen 1.0
*/
function twentyfifteen_color_scheme_css_template() {
@ -512,7 +515,7 @@ function twentyfifteen_color_scheme_css_template() {
/* Sidebar Text Color */
.site-title a:hover,
.site-title a:focus {
color: {{ data.sidebar_textcolor2 }};
color: {{ data.secondary_sidebar_textcolor }};
}
/* Sidebar Border Color */
@ -592,7 +595,7 @@ function twentyfifteen_color_scheme_css_template() {
.widget blockquote,
.widget .wp-caption-text,
.widget .gallery-caption {
color: {{ data.sidebar_textcolor2 }};
color: {{ data.secondary_sidebar_textcolor }};
}
.widget button:hover,
@ -605,11 +608,11 @@ function twentyfifteen_color_scheme_css_template() {
.widget input[type="submit"]:focus,
.widget_calendar tbody a:hover,
.widget_calendar tbody a:focus {
background-color: {{ data.sidebar_textcolor2 }};
background-color: {{ data.secondary_sidebar_textcolor }};
}
.widget blockquote {
border-color: {{ data.sidebar_textcolor2 }};
border-color: {{ data.secondary_sidebar_textcolor }};
}
/* Sidebar Border Color */

View File

@ -1,6 +1,7 @@
/* global colorScheme */
/**
* Add a listener to the Color Scheme control to update other color controls to new values/defaults.
* Also trigger an update of the Color Scheme CSS when a color is changed.
*/
( function( api ) {
@ -45,6 +46,7 @@
}
} );
// Generate the CSS for the current Color Scheme.
function getCSS() {
var scheme = api( 'color_scheme' )(),
colors = _.object( colorSchemeKeys, colorScheme[ scheme ].colors );
@ -58,7 +60,7 @@
colors['secondary_textcolor'] = Color( colors.textcolor ).toCSS( 'rgba', 0.7 );
colors['border_color'] = Color( colors.textcolor ).toCSS( 'rgba', 0.1 );
colors['border_focus_color'] = Color( colors.textcolor ).toCSS( 'rgba', 0.3 );
colors['sidebar_textcolor2'] = Color( colors.sidebar_textcolor ).toCSS( 'rgba', 0.7 );
colors['secondary_sidebar_textcolor'] = Color( colors.sidebar_textcolor ).toCSS( 'rgba', 0.7 );
colors['sidebar_border_color'] = Color( colors.sidebar_textcolor ).toCSS( 'rgba', 0.1 );
colors['sidebar_border_focus_color'] = Color( colors.sidebar_textcolor ).toCSS( 'rgba', 0.3 );

View File

@ -10,19 +10,21 @@
.find( '#twentyfifteen-color-scheme-css' );
}
// Site title and description.
// Site title.
wp.customize( 'blogname', function( value ) {
value.bind( function( to ) {
$( '.site-title a' ).text( to );
} );
} );
// Site tagline.
wp.customize( 'blogdescription', function( value ) {
value.bind( function( to ) {
$( '.site-description' ).text( to );
} );
} );
// Color Scheme CSS.
wp.customize( 'color_scheme_css', function( value ) {
value.bind( function( to ) {
$style.html( to );

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.1-alpha-30304';
$wp_version = '4.1-alpha-30305';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.