Merge branch 'custom_header_fix' of https://github.com/iamtakashi/_s

into iamtakashi-custom_header_fix

Conflicts:
	inc/custom-header.php
This commit is contained in:
obenland 2013-05-28 09:31:59 -07:00
commit f0ed253d5b
4 changed files with 90 additions and 63 deletions

View File

@ -107,7 +107,7 @@ function _s_header_style() {
?> ?>
.site-title, .site-title,
.site-description { .site-description {
position: absolute !important; position: absolute;
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */ clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
clip: rect(1px, 1px, 1px, 1px); clip: rect(1px, 1px, 1px, 1px);
} }
@ -160,19 +160,13 @@ if ( ! function_exists( '_s_admin_header_image' ) ) :
* @see _s_custom_header_setup(). * @see _s_custom_header_setup().
*/ */
function _s_admin_header_image() { function _s_admin_header_image() {
$header_text_color = get_header_textcolor(); $style = sprintf( ' style="color:#%s;"', get_header_textcolor() );
$header_image = get_header_image();
?> ?>
<div id="headimg"> <div id="headimg">
<?php
if ( 'blank' == $header_text_color || '' == $header_text_color )
$style = ' style="display:none;"';
else
$style = ' style="color:#' . $header_text_color . ';"';
?>
<h1 class="displaying-header-text"><a id="name"<?php echo $style; ?> onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1> <h1 class="displaying-header-text"><a id="name"<?php echo $style; ?> onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
<div class="displaying-header-text" id="desc"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></div> <div class="displaying-header-text" id="desc"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></div>
<?php $header_image = get_header_image(); <?php if ( ! empty( $header_image ) ) : ?>
if ( ! empty( $header_image ) ) : ?>
<img src="<?php echo esc_url( $header_image ); ?>" alt="" /> <img src="<?php echo esc_url( $header_image ); ?>" alt="" />
<?php endif; ?> <?php endif; ?>
</div> </div>

View File

@ -21,6 +21,6 @@ add_action( 'customize_register', '_s_customize_register' );
* Binds JS handlers to make Theme Customizer preview reload changes asynchronously. * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
*/ */
function _s_customize_preview_js() { function _s_customize_preview_js() {
wp_enqueue_script( '_s_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20130304', true ); wp_enqueue_script( '_s_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20130508', true );
} }
add_action( 'customize_preview_init', '_s_customize_preview_js' ); add_action( 'customize_preview_init', '_s_customize_preview_js' );

View File

@ -19,7 +19,18 @@
// Header text color. // Header text color.
wp.customize( 'header_textcolor', function( value ) { wp.customize( 'header_textcolor', function( value ) {
value.bind( function( to ) { value.bind( function( to ) {
$( '.site-title a, .site-description' ).css( 'color', to ); if ( 'blank' == to ) {
$( '.site-title, .site-description' ).css( {
'clip': 'rect(1px, 1px, 1px, 1px)',
'position': 'absolute'
} );
} else {
$( '.site-title, .site-description' ).css( {
'clip': 'auto',
'color': to,
'position': 'relative'
} );
}
} ); } );
} ); } );
} )( jQuery ); } )( jQuery );

124
style.css
View File

@ -15,41 +15,22 @@ Use it to make something cool, have fun, and share what you've learned with othe
_s is based on Underscores http://underscores.me/, (C) 2012-2013 Automattic, Inc. _s is based on Underscores http://underscores.me/, (C) 2012-2013 Automattic, Inc.
Resetting and rebuilding styles have been helped along thanks to the fine work of Resetting and rebuilding styles have been helped along thanks to the fine work of
Eric Meyer http://meyerweb.com/eric/tools/css/reset/index.html Nicolas Gallagher and Jonathan Neal http://necolas.github.io/normalize.css/
along with Nicolas Gallagher and Jonathan Neal http://necolas.github.com/normalize.css/
and Blueprint http://www.blueprintcss.org/
*/ */
/* =Reset /* =Reset
-------------------------------------------------------------- */ -------------------------------------------------------------- */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
border: 0;
font-family: inherit;
font-size: 100%;
font-style: inherit;
font-weight: inherit;
margin: 0;
outline: 0;
padding: 0;
vertical-align: baseline;
}
html { html {
font-size: 62.5%; /* Corrects text resizing oddly in IE6/7 when body font-size is set using em units http://clagnut.com/blog/348/#c790 */ font-size: 62.5%; /* Corrects text resizing oddly in IE6/7 when body font-size is set using em units. http://clagnut.com/blog/348/#c790 */
overflow-y: scroll; /* Keeps page centred in all browsers regardless of content height */ overflow-y: scroll; /* Keeps page centred in all browsers regardless of content height. */
-webkit-text-size-adjust: 100%; /* Prevents iOS text size adjust after orientation change, without disabling user zoom */ -webkit-text-size-adjust: 100%; /* Prevents iOS text size adjust after orientation change, without disabling user zoom. */
-ms-text-size-adjust: 100%; /* www.456bereastreet.com/archive/201012/controlling_text_size_in_safari_for_ios_without_disabling_user_zoom/ */ -ms-text-size-adjust: 100%; /* www.456bereastreet.com/archive/201012/controlling_text_size_in_safari_for_ios_without_disabling_user_zoom/ */
} }
body { body {
background: #fff; background: #fff;
margin: 0;
} }
article, article,
aside, aside,
@ -62,10 +43,29 @@ nav,
section { section {
display: block; display: block;
} }
audio,
canvas,
video {
display: inline-block;
}
audio:not([controls]) {
display: none;
height: 0;
}
[hidden] {
display: none;
}
svg:not(:root) {
overflow: hidden;
}
legend {
border: 0;
padding: 0;
}
ol, ul { ol, ul {
list-style: none; list-style: none;
} }
table { /* tables still need 'cellspacing="0"' in the markup */ table { /* Tables still need 'cellspacing="0"' in the markup. */
border-collapse: separate; border-collapse: separate;
border-spacing: 0; border-spacing: 0;
} }
@ -78,7 +78,7 @@ q:before, q:after {
content: ""; content: "";
} }
blockquote, q { blockquote, q {
quotes: "" ""; quotes: "\201C" "\201D" "\2018" "\2019";
} }
a:focus { a:focus {
outline: thin dotted; outline: thin dotted;
@ -111,9 +111,15 @@ textarea {
h1,h2,h3,h4,h5,h6 { h1,h2,h3,h4,h5,h6 {
clear: both; clear: both;
} }
h1 {
font-size: 2em;
margin: 0.67em 0;
}
hr { hr {
background-color: #ccc; background-color: #ccc;
border: 0; border: 0;
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 1px; height: 1px;
margin-bottom: 1.5em; margin-bottom: 1.5em;
} }
@ -152,12 +158,12 @@ blockquote {
margin: 0 1.5em; margin: 0 1.5em;
} }
address { address {
font-style: italic;
margin: 0 0 1.5em; margin: 0 0 1.5em;
} }
pre { pre {
background: #eee; background: #eee;
font-family: "Courier 10 Pitch", Courier, monospace; font-family: "Courier 10 Pitch", Courier, monospace;
font-size: 15px;
font-size: 1.5rem; font-size: 1.5rem;
line-height: 1.6; line-height: 1.6;
margin-bottom: 1.6em; margin-bottom: 1.6em;
@ -168,7 +174,7 @@ pre {
code, kbd, tt, var { code, kbd, tt, var {
font: 15px Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; font: 15px Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace;
} }
abbr, acronym { abbr[title], acronym {
border-bottom: 1px dotted #666; border-bottom: 1px dotted #666;
cursor: help; cursor: help;
} }
@ -210,18 +216,31 @@ img {
height: auto; /* Make sure images are scaled correctly. */ height: auto; /* Make sure images are scaled correctly. */
max-width: 100%; /* Adhere to container width. */ max-width: 100%; /* Adhere to container width. */
} }
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
legend {
border: 0;
padding: 0;
}
button, button,
input, input,
select, select,
textarea { textarea {
font-size: 100%; /* Corrects font size not being inherited in all browsers */ font-family: inherit;
margin: 0; /* Addresses margins set differently in IE6/7, F3/4, S5, Chrome */ font-size: 100%; /* Corrects font size not being inherited in all browsers. */
vertical-align: baseline; /* Improves appearance and consistency in all browsers */ margin: 0; /* Addresses margins set differently in F3/4, S5, Chrome. */
*vertical-align: middle; /* Improves appearance and consistency in all browsers */ vertical-align: baseline; /* Improves appearance and consistency in all browsers. */
} }
button, button,
input { input {
line-height: normal; /* Addresses FF3/4 setting line-height using !important in the UA stylesheet */ line-height: normal; /* Addresses FF3/4 setting line-height using !important in the UA stylesheet. */
}
button,
select {
text-transform: none;
} }
button, button,
html input[type="button"], html input[type="button"],
@ -233,9 +252,8 @@ input[type="submit"] {
background: #e6e6e6; background: #e6e6e6;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 15px 17px rgba(255, 255, 255, 0.5), inset 0 -5px 12px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 15px 17px rgba(255, 255, 255, 0.5), inset 0 -5px 12px rgba(0, 0, 0, 0.05);
color: rgba(0, 0, 0, .8); color: rgba(0, 0, 0, .8);
cursor: pointer; /* Improves usability and consistency of cursor style between image-type 'input' and others */ cursor: pointer; /* Improves usability and consistency of cursor style between image-type 'input' and others. */
-webkit-appearance: button; /* Corrects inability to style clickable 'input' types in iOS */ -webkit-appearance: button; /* Corrects inability to style clickable 'input' types in iOS. */
font-size: 12px;
font-size: 1.2rem; font-size: 1.2rem;
line-height: 1; line-height: 1;
padding: .6em 1em .4em; padding: .6em 1em .4em;
@ -259,22 +277,26 @@ input[type="submit"]:active {
border-color: #aaa #bbb #bbb #bbb; border-color: #aaa #bbb #bbb #bbb;
box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.5), inset 0 2px 5px rgba(0, 0, 0, 0.15); box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.5), inset 0 2px 5px rgba(0, 0, 0, 0.15);
} }
button[disabled],
html input[disabled] {
cursor: default;
}
input[type="checkbox"], input[type="checkbox"],
input[type="radio"] { input[type="radio"] {
box-sizing: border-box; /* Addresses box sizing set to content-box in IE8/9 */ box-sizing: border-box; /* Addresses box sizing set to content-box in IE9. */
padding: 0; /* Addresses excess padding in IE8/9 */ padding: 0; /* Addresses excess padding in IE9. */
} }
input[type="search"] { input[type="search"] {
-webkit-appearance: textfield; /* Addresses appearance set to searchfield in S5, Chrome */ -webkit-appearance: textfield; /* Addresses appearance set to searchfield in S5, Chrome. */
-webkit-box-sizing: content-box; /* Addresses box sizing set to border-box in S5, Chrome (include -moz to future-proof) */ -webkit-box-sizing: content-box; /* Addresses box sizing set to border-box in S5, Chrome (include -moz to future-proof). */
-moz-box-sizing: content-box; -moz-box-sizing: content-box;
box-sizing: content-box; box-sizing: content-box;
} }
input[type="search"]::-webkit-search-decoration { /* Corrects inner padding displayed oddly in S5, Chrome on OSX */ input[type="search"]::-webkit-search-decoration { /* Corrects inner padding displayed oddly in S5, Chrome on OSX. */
-webkit-appearance: none; -webkit-appearance: none;
} }
button::-moz-focus-inner, button::-moz-focus-inner,
input::-moz-focus-inner { /* Corrects inner padding and border displayed oddly in FF3/4 www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/ */ input::-moz-focus-inner { /* Corrects inner padding and border displayed oddly in FF3/4. www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/ */
border: 0; border: 0;
padding: 0; padding: 0;
} }
@ -301,9 +323,9 @@ input[type="search"] {
padding: 3px; padding: 3px;
} }
textarea { textarea {
overflow: auto; /* Removes default vertical scrollbar in IE6/7/8/9 */ overflow: auto; /* Removes default vertical scrollbar in IE9. */
padding-left: 3px; padding-left: 3px;
vertical-align: top; /* Improves readability and alignment in all browsers */ vertical-align: top; /* Improves readability and alignment in all browsers. */
width: 98%; width: 98%;
} }
@ -337,7 +359,7 @@ a:active {
margin: 0 auto; margin: 0 auto;
} }
/* Text meant only for screen readers */ /* Text meant only for screen readers. */
.screen-reader-text { .screen-reader-text {
clip: rect(1px, 1px, 1px, 1px); clip: rect(1px, 1px, 1px, 1px);
position: absolute !important; position: absolute !important;
@ -534,7 +556,7 @@ a:active {
.site-content .gallery-columns-4 .gallery-item img { .site-content .gallery-columns-4 .gallery-item img {
} }
/* Make sure embeds and iframes fit their containers */ /* Make sure embeds and iframes fit their containers. */
embed, embed,
iframe, iframe,
object { object {
@ -575,7 +597,7 @@ object {
margin: 0 0 1.5em; margin: 0 0 1.5em;
} }
/* Make sure select elements fit in widgets */ /* Make sure select elements fit in widgets. */
.widget select { .widget select {
max-width: 100%; max-width: 100%;
} }
@ -589,12 +611,12 @@ object {
----------------------------------------------- */ ----------------------------------------------- */
/* Globally hidden elements when Infinite Scroll is supported and in use. */ /* Globally hidden elements when Infinite Scroll is supported and in use. */
.infinite-scroll .navigation-paging, /* Older / Newer Posts Navigation (always hidden) */ .infinite-scroll .navigation-paging, /* Older / Newer Posts Navigation (always hidden). */
.infinite-scroll.neverending .site-footer { /* Theme Footer (when set to scrolling) */ .infinite-scroll.neverending .site-footer { /* Theme Footer (when set to scrolling). */
display: none; display: none;
} }
/* When Infinite Scroll has reached its end we need to re-display elements that were hidden (via .neverending) before */ /* When Infinite Scroll has reached its end we need to re-display elements that were hidden (via .neverending) before. */
.infinity-end.neverending .site-footer { .infinity-end.neverending .site-footer {
display: block; display: block;
} }