Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
<?php
|
|
|
|
/**
|
2014-11-25 15:57:24 -05:00
|
|
|
* Custom Header functionality for Twenty Fifteen
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
*
|
|
|
|
* @package WordPress
|
|
|
|
* @subpackage Twenty_Fifteen
|
|
|
|
* @since Twenty Fifteen 1.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set up the WordPress core custom header feature.
|
|
|
|
*
|
|
|
|
* @uses twentyfifteen_header_style()
|
|
|
|
*/
|
|
|
|
function twentyfifteen_custom_header_setup() {
|
2017-11-30 18:11:00 -05:00
|
|
|
$color_scheme = twentyfifteen_get_color_scheme();
|
|
|
|
$default_text_color = trim( $color_scheme[4], '#' );
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
|
2017-11-30 18:11:00 -05:00
|
|
|
add_theme_support(
|
2018-08-16 21:51:36 -04:00
|
|
|
'custom-header',
|
2020-07-01 09:52:01 -04:00
|
|
|
/**
|
2020-08-10 20:34:08 -04:00
|
|
|
* Filters Twenty Fifteen custom-header support arguments.
|
2020-07-01 09:52:01 -04:00
|
|
|
*
|
|
|
|
* @since Twenty Fifteen 1.0
|
|
|
|
*
|
|
|
|
* @param array $args {
|
|
|
|
* An array of custom-header support arguments.
|
|
|
|
*
|
|
|
|
* @type string $default_text_color Default color of the header text.
|
|
|
|
* @type int $width Width in pixels of the custom header image. Default 954.
|
|
|
|
* @type int $height Height in pixels of the custom header image. Default 1300.
|
|
|
|
* @type string $wp-head-callback Callback function used to styles the header image and text
|
|
|
|
* displayed on the blog.
|
|
|
|
* }
|
|
|
|
*/
|
2018-08-16 21:51:36 -04:00
|
|
|
apply_filters(
|
|
|
|
'twentyfifteen_custom_header_args',
|
|
|
|
array(
|
2017-11-30 18:11:00 -05:00
|
|
|
'default-text-color' => $default_text_color,
|
|
|
|
'width' => 954,
|
|
|
|
'height' => 1300,
|
|
|
|
'wp-head-callback' => 'twentyfifteen_header_style',
|
|
|
|
)
|
|
|
|
)
|
|
|
|
);
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
}
|
|
|
|
add_action( 'after_setup_theme', 'twentyfifteen_custom_header_setup' );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Convert HEX to RGB.
|
|
|
|
*
|
|
|
|
* @since Twenty Fifteen 1.0
|
|
|
|
*
|
|
|
|
* @param string $color The original color, in 3- or 6-digit hexadecimal form.
|
2014-11-25 15:57:24 -05:00
|
|
|
* @return array Array containing RGB (red, green, and blue) values for the given
|
|
|
|
* HEX code, empty array otherwise.
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
*/
|
|
|
|
function twentyfifteen_hex2rgb( $color ) {
|
|
|
|
$color = trim( $color, '#' );
|
|
|
|
|
2021-07-10 14:43:57 -04:00
|
|
|
if ( strlen( $color ) === 3 ) {
|
2017-11-30 18:11:00 -05:00
|
|
|
$r = hexdec( substr( $color, 0, 1 ) . substr( $color, 0, 1 ) );
|
|
|
|
$g = hexdec( substr( $color, 1, 1 ) . substr( $color, 1, 1 ) );
|
|
|
|
$b = hexdec( substr( $color, 2, 1 ) . substr( $color, 2, 1 ) );
|
2021-07-10 14:43:57 -04:00
|
|
|
} elseif ( strlen( $color ) === 6 ) {
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
$r = hexdec( substr( $color, 0, 2 ) );
|
|
|
|
$g = hexdec( substr( $color, 2, 2 ) );
|
|
|
|
$b = hexdec( substr( $color, 4, 2 ) );
|
|
|
|
} else {
|
|
|
|
return array();
|
|
|
|
}
|
|
|
|
|
2017-11-30 18:11:00 -05:00
|
|
|
return array(
|
|
|
|
'red' => $r,
|
|
|
|
'green' => $g,
|
|
|
|
'blue' => $b,
|
|
|
|
);
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( ! function_exists( 'twentyfifteen_header_style' ) ) :
|
2017-11-30 18:11:00 -05:00
|
|
|
/**
|
|
|
|
* Styles the header image and text displayed on the blog.
|
|
|
|
*
|
|
|
|
* @since Twenty Fifteen 1.0
|
|
|
|
*
|
|
|
|
* @see twentyfifteen_custom_header_setup()
|
|
|
|
*/
|
|
|
|
function twentyfifteen_header_style() {
|
|
|
|
$header_image = get_header_image();
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
|
2017-11-30 18:11:00 -05:00
|
|
|
// If no custom options for text are set, let's bail.
|
|
|
|
if ( empty( $header_image ) && display_header_text() ) {
|
|
|
|
return;
|
|
|
|
}
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
|
2017-11-30 18:11:00 -05:00
|
|
|
// If we get this far, we have custom styles. Let's do this.
|
|
|
|
?>
|
|
|
|
<style type="text/css" id="twentyfifteen-header-css">
|
|
|
|
<?php
|
2014-11-25 09:47:22 -05:00
|
|
|
// Short header for when there is no Custom Header and Header Text is hidden.
|
|
|
|
if ( empty( $header_image ) && ! display_header_text() ) :
|
2018-08-16 21:51:36 -04:00
|
|
|
?>
|
2014-11-25 09:47:22 -05:00
|
|
|
.site-header {
|
|
|
|
padding-top: 14px;
|
|
|
|
padding-bottom: 14px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.site-branding {
|
|
|
|
min-height: 42px;
|
|
|
|
}
|
|
|
|
|
|
|
|
@media screen and (min-width: 46.25em) {
|
|
|
|
.site-header {
|
|
|
|
padding-top: 21px;
|
|
|
|
padding-bottom: 21px;
|
|
|
|
}
|
|
|
|
.site-branding {
|
|
|
|
min-height: 56px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@media screen and (min-width: 55em) {
|
|
|
|
.site-header {
|
|
|
|
padding-top: 25px;
|
|
|
|
padding-bottom: 25px;
|
|
|
|
}
|
|
|
|
.site-branding {
|
|
|
|
min-height: 62px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@media screen and (min-width: 59.6875em) {
|
|
|
|
.site-header {
|
|
|
|
padding-top: 0;
|
|
|
|
padding-bottom: 0;
|
|
|
|
}
|
|
|
|
.site-branding {
|
|
|
|
min-height: 0;
|
|
|
|
}
|
|
|
|
}
|
2018-08-16 21:51:36 -04:00
|
|
|
<?php
|
2014-11-25 09:47:22 -05:00
|
|
|
endif;
|
|
|
|
|
|
|
|
// Has a Custom Header been added?
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
if ( ! empty( $header_image ) ) :
|
2018-08-16 21:51:36 -04:00
|
|
|
?>
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
.site-header {
|
2015-07-06 13:27:26 -04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* No shorthand so the Customizer can override individual properties.
|
|
|
|
* @see https://core.trac.wordpress.org/ticket/31460
|
|
|
|
*/
|
|
|
|
background-image: url(<?php header_image(); ?>);
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
background-position: 50% 50%;
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
-webkit-background-size: cover;
|
|
|
|
-moz-background-size: cover;
|
|
|
|
-o-background-size: cover;
|
|
|
|
background-size: cover;
|
|
|
|
}
|
|
|
|
|
|
|
|
@media screen and (min-width: 59.6875em) {
|
|
|
|
body:before {
|
2015-07-06 13:27:26 -04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* No shorthand so the Customizer can override individual properties.
|
|
|
|
* @see https://core.trac.wordpress.org/ticket/31460
|
|
|
|
*/
|
|
|
|
background-image: url(<?php header_image(); ?>);
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
background-position: 100% 50%;
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
-webkit-background-size: cover;
|
|
|
|
-moz-background-size: cover;
|
|
|
|
-o-background-size: cover;
|
|
|
|
background-size: cover;
|
|
|
|
border-right: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.site-header {
|
|
|
|
background: transparent;
|
|
|
|
}
|
|
|
|
}
|
2018-08-16 21:51:36 -04:00
|
|
|
<?php
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
endif;
|
|
|
|
|
|
|
|
// Has the text been hidden?
|
|
|
|
if ( ! display_header_text() ) :
|
2018-08-16 21:51:36 -04:00
|
|
|
?>
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
.site-title,
|
|
|
|
.site-description {
|
|
|
|
clip: rect(1px, 1px, 1px, 1px);
|
|
|
|
position: absolute;
|
|
|
|
}
|
|
|
|
<?php endif; ?>
|
|
|
|
</style>
|
2018-08-16 21:51:36 -04:00
|
|
|
<?php
|
2017-11-30 18:11:00 -05:00
|
|
|
}
|
2020-01-28 19:45:18 -05:00
|
|
|
endif; // twentyfifteen_header_style()
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Enqueues front-end CSS for the header background color.
|
|
|
|
*
|
|
|
|
* @since Twenty Fifteen 1.0
|
2014-11-25 15:57:24 -05:00
|
|
|
*
|
|
|
|
* @see wp_add_inline_style()
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
*/
|
|
|
|
function twentyfifteen_header_background_color_css() {
|
2014-11-03 16:59:22 -05:00
|
|
|
$color_scheme = twentyfifteen_get_color_scheme();
|
|
|
|
$default_color = $color_scheme[1];
|
2014-12-16 16:35:23 -05:00
|
|
|
$header_background_color = get_theme_mod( 'header_background_color', $default_color );
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
|
|
|
|
// Don't do anything if the current color is the default.
|
2014-11-03 16:59:22 -05:00
|
|
|
if ( $header_background_color === $default_color ) {
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
$css = '
|
|
|
|
/* Custom Header Background Color */
|
|
|
|
body:before,
|
|
|
|
.site-header {
|
|
|
|
background-color: %1$s;
|
|
|
|
}
|
|
|
|
|
|
|
|
@media screen and (min-width: 59.6875em) {
|
2014-11-03 12:01:23 -05:00
|
|
|
.site-header,
|
|
|
|
.secondary {
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
background-color: transparent;
|
|
|
|
}
|
|
|
|
|
|
|
|
.widget button,
|
|
|
|
.widget input[type="button"],
|
|
|
|
.widget input[type="reset"],
|
|
|
|
.widget input[type="submit"],
|
|
|
|
.widget_calendar tbody a,
|
|
|
|
.widget_calendar tbody a:hover,
|
|
|
|
.widget_calendar tbody a:focus {
|
|
|
|
color: %1$s;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
';
|
|
|
|
|
|
|
|
wp_add_inline_style( 'twentyfifteen-style', sprintf( $css, $header_background_color ) );
|
|
|
|
}
|
|
|
|
add_action( 'wp_enqueue_scripts', 'twentyfifteen_header_background_color_css', 11 );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enqueues front-end CSS for the sidebar text color.
|
|
|
|
*
|
|
|
|
* @since Twenty Fifteen 1.0
|
|
|
|
*/
|
|
|
|
function twentyfifteen_sidebar_text_color_css() {
|
2014-11-03 16:59:22 -05:00
|
|
|
$color_scheme = twentyfifteen_get_color_scheme();
|
|
|
|
$default_color = $color_scheme[4];
|
2014-12-16 16:35:23 -05:00
|
|
|
$sidebar_link_color = get_theme_mod( 'sidebar_textcolor', $default_color );
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
|
|
|
|
// Don't do anything if the current color is the default.
|
2014-11-03 16:59:22 -05:00
|
|
|
if ( $sidebar_link_color === $default_color ) {
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// If we get this far, we have custom styles. Let's do this.
|
|
|
|
$sidebar_link_color_rgb = twentyfifteen_hex2rgb( $sidebar_link_color );
|
|
|
|
$sidebar_text_color = vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.7)', $sidebar_link_color_rgb );
|
|
|
|
$sidebar_border_color = vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.1)', $sidebar_link_color_rgb );
|
|
|
|
$sidebar_border_focus_color = vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.3)', $sidebar_link_color_rgb );
|
|
|
|
|
|
|
|
$css = '
|
|
|
|
/* Custom Sidebar Text Color */
|
2014-11-04 13:42:22 -05:00
|
|
|
.site-title a,
|
|
|
|
.site-description,
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
.secondary-toggle:before {
|
|
|
|
color: %1$s;
|
|
|
|
}
|
|
|
|
|
2014-11-04 13:42:22 -05:00
|
|
|
.site-title a:hover,
|
|
|
|
.site-title a:focus {
|
|
|
|
color: %2$s;
|
|
|
|
}
|
|
|
|
|
2014-11-03 12:01:23 -05:00
|
|
|
.secondary-toggle {
|
|
|
|
border-color: %3$s;
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
}
|
|
|
|
|
2014-11-03 12:01:23 -05:00
|
|
|
.secondary-toggle:hover,
|
|
|
|
.secondary-toggle:focus {
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
border-color: %4$s;
|
|
|
|
}
|
|
|
|
|
2014-11-03 12:01:23 -05:00
|
|
|
.site-title a {
|
|
|
|
outline-color: %4$s;
|
|
|
|
}
|
|
|
|
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
@media screen and (min-width: 59.6875em) {
|
2014-11-03 12:01:23 -05:00
|
|
|
.secondary a,
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
.dropdown-toggle:after,
|
|
|
|
.widget-title,
|
2014-11-03 12:01:23 -05:00
|
|
|
.widget blockquote cite,
|
|
|
|
.widget blockquote small {
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
color: %1$s;
|
|
|
|
}
|
|
|
|
|
|
|
|
.widget button,
|
|
|
|
.widget input[type="button"],
|
|
|
|
.widget input[type="reset"],
|
|
|
|
.widget input[type="submit"],
|
|
|
|
.widget_calendar tbody a {
|
|
|
|
background-color: %1$s;
|
|
|
|
}
|
|
|
|
|
2014-11-03 12:01:23 -05:00
|
|
|
.textwidget a {
|
|
|
|
border-color: %1$s;
|
|
|
|
}
|
|
|
|
|
|
|
|
.secondary a:hover,
|
|
|
|
.secondary a:focus,
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
.main-navigation .menu-item-description,
|
|
|
|
.widget,
|
|
|
|
.widget blockquote,
|
|
|
|
.widget .wp-caption-text,
|
|
|
|
.widget .gallery-caption {
|
|
|
|
color: %2$s;
|
|
|
|
}
|
|
|
|
|
2014-11-03 12:01:23 -05:00
|
|
|
.widget button:hover,
|
|
|
|
.widget button:focus,
|
|
|
|
.widget input[type="button"]:hover,
|
|
|
|
.widget input[type="button"]:focus,
|
|
|
|
.widget input[type="reset"]:hover,
|
|
|
|
.widget input[type="reset"]:focus,
|
|
|
|
.widget input[type="submit"]:hover,
|
|
|
|
.widget input[type="submit"]:focus,
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
.widget_calendar tbody a:hover,
|
|
|
|
.widget_calendar tbody a:focus {
|
|
|
|
background-color: %2$s;
|
|
|
|
}
|
|
|
|
|
|
|
|
.widget blockquote {
|
|
|
|
border-color: %2$s;
|
|
|
|
}
|
|
|
|
|
|
|
|
.main-navigation ul,
|
|
|
|
.main-navigation li,
|
|
|
|
.secondary-toggle,
|
2014-11-03 12:01:23 -05:00
|
|
|
.widget input,
|
|
|
|
.widget textarea,
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
.widget table,
|
|
|
|
.widget th,
|
|
|
|
.widget td,
|
|
|
|
.widget pre,
|
|
|
|
.widget li,
|
2014-11-03 12:01:23 -05:00
|
|
|
.widget_categories .children,
|
|
|
|
.widget_nav_menu .sub-menu,
|
|
|
|
.widget_pages .children,
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
.widget abbr[title] {
|
|
|
|
border-color: %3$s;
|
|
|
|
}
|
|
|
|
|
|
|
|
.dropdown-toggle:hover,
|
|
|
|
.dropdown-toggle:focus,
|
|
|
|
.widget hr {
|
|
|
|
background-color: %3$s;
|
|
|
|
}
|
|
|
|
|
|
|
|
.widget input:focus,
|
|
|
|
.widget textarea:focus {
|
|
|
|
border-color: %4$s;
|
|
|
|
}
|
2014-11-03 12:01:23 -05:00
|
|
|
|
|
|
|
.sidebar a:focus,
|
|
|
|
.dropdown-toggle:focus {
|
|
|
|
outline-color: %4$s;
|
|
|
|
}
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
}
|
|
|
|
';
|
|
|
|
|
|
|
|
wp_add_inline_style( 'twentyfifteen-style', sprintf( $css, $sidebar_link_color, $sidebar_text_color, $sidebar_border_color, $sidebar_border_focus_color ) );
|
|
|
|
}
|
2014-12-10 08:39:24 -05:00
|
|
|
add_action( 'wp_enqueue_scripts', 'twentyfifteen_sidebar_text_color_css', 11 );
|