/** * Add custom styles using the primary color to header. * * @since 1.0.0 * @access public * @return string */ function yarn_custom_styles() { $hex = get_theme_mod('color_primary', ''); $rgb = join(', ', hybrid_hex_to_rgb($hex)); $output = "<style>\n \t\t\t\t.more-link { background-color: rgba( {$rgb}, 0.75); }\n \t\t\t\t.plural .format-link, .plural .entry.format-link > .wrap { background-color: #{$hex}; }\n \t\t\t\t</style>"; echo $output; }
/** * Formats the primary styles for output. * * @since 1.0.0 * @access public * @return string */ public function get_primary_styles() { $style = ''; $hex = get_theme_mod('color_primary', ''); $rgb = join(', ', hybrid_hex_to_rgb($hex)); /* Color. */ $style .= "a, .wp-playlist-light .wp-playlist-playing { color: rgba( {$rgb}, 0.75 ); } "; $style .= "a:hover, a:focus, legend, mark, .comment-respond .required, pre, \r\n\t\t\t\t.form-allowed-tags code, pre code, \r\n\t\t\t\t.wp-playlist-light .wp-playlist-item:hover, \r\n\t\t\t\t.wp-playlist-light .wp-playlist-item:focus,\r\n\t\t\t\t.mejs-button button:hover::after, .mejs-button button:focus::after,\r\n\t\t\t\t.mejs-overlay-button:hover::after, .mejs-overlay-button:focus::after \r\n\t\t\t\t{ color: #{$hex}; } "; /* Background color. */ $style .= "input[type='submit'], input[type='reset'], input[type='button'], button, .page-links a, \r\n\t\t\t\t.comment-reply-link, .comment-reply-login, .wp-calendar td.has-posts a, #menu-sub-terms li a\r\n\t\t\t\t{ background-color: rgba( {$rgb}, 0.8 ); } "; $style .= "legend, mark, pre, .form-allowed-tags code { background-color: rgba( {$rgb}, 0.1 ); } "; $style .= "input[type='submit']:hover, input[type='submit']:focus, \r\n\t\t\t\tinput[type='reset']:hover, input[type='reset']:focus, \r\n\t\t\t\tinput[type='button']:hover, input[type='button']:focus, \r\n\t\t\t\tbutton:hover, button:focus, \r\n\t\t\t\t.page-links a:hover, .page-links a:focus, \r\n\t\t\t\t.wp-calendar td.has-posts a:hover, .wp-calendar td.has-posts a:focus, \r\n\t\t\t\t.widget-title > .wrap,\r\n\t\t\t\t#comments-number > .wrap, #reply-title > .wrap, .attachment-meta-title > .wrap, \r\n\t\t\t\t.widget_search > .search-form, \r\n\t\t\t\t#menu-sub-terms li a:hover, #menu-sub-terms li a:focus, \r\n\t\t\t\t.comment-reply-link:hover, .comment-reply-link:focus, \r\n\t\t\t\t.comment-reply-login:hover, .comment-reply-login:focus, \r\n\t\t\t\t.mejs-time-rail .mejs-time-loaded, .skip-link .screen-reader-text\r\n\t\t\t\t{ background-color: #{$hex}; } "; /* Firefox chokes on this rule and drops the rule set, so we're separating it. */ $style .= "::selection { background-color: #{$hex}; } "; /* border-color */ $style .= "legend { border-color: rgba( {$rgb}, 0.15 ); } "; /* border-top-color */ $style .= "body { border-top-color: #{$hex}; } "; /* Border bottom color. */ $style .= ".entry-content a, .entry-summary a, .comment-content a { border-bottom-color: rgba( {$rgb}, 0.15 ); } "; $style .= ".entry-content a:hover, .entry-content a:focus, \r\n\t\t .entry-summary a:hover, .entry-summary a:focus, \r\n\t\t .comment-content a:hover, .comment-content a:focus\r\n\t\t { border-bottom-color: rgba( {$rgb}, 0.75 ); } "; $style .= "body, .widget-title, #comments-number, #reply-title,\r\n\t\t\t\t.attachment-meta-title { border-bottom-color: #{$hex}; } "; /* border-color */ $style .= "blockquote { background-color: rgba( {$rgb}, 0.85 ); } "; $style .= "blockquote blockquote { background-color: rgba( {$rgb}, 0.9 ); } "; /* outline-color */ $style .= "blockquote { outline-color: rgba( {$rgb}, 0.85); } "; return str_replace(array("\r", "\n", "\t"), '', $style); }
/** * Callback function for outputting the custom header CSS to `admin_head` on "Appearance > Custom Header". See * the `css/admin-custom-header.css` file for all the style rules specific to this screen. * * @since 1.0.0 * @access public * @return void */ function saga_custom_header_admin_head() { if (!display_header_text()) { return; } $hex = get_header_textcolor(); if (empty($hex)) { return; } $rgb = hybrid_hex_to_rgb($hex); $style = "#site-title, #site-title a { color: #{$hex} }"; $style .= "#site-description { color: rgba( {$rgb['r']}, {$rgb['g']}, {$rgb['b']}, 0.75 ); }"; /* Get the background color. */ $color = get_background_color(); if (!empty($color)) { $style .= "div.wordpress{ background: #{$color}; }"; } echo "\n" . '<style type="text/css" id="custom-header-css">' . trim($style) . '</style>' . "\n"; }
/** * Formats the primary styles for output. * * @since 1.0.0 * @access public * @return string */ public function get_menu_styles() { $style = ''; $hex = get_theme_mod('color_menu', ''); $rgb = join(', ', hybrid_hex_to_rgb($hex)); /* === Background Color === */ $style .= "\r\n\t\t\t\t.menu-toggle button:hover,\r\n\t\t\t\t.menu-toggle button:focus,\r\n\t\t\t\t#menu-primary li a:hover,\r\n\t\t\t\t#menu-primary li a:focus,\r\n\t\t\t\t.loop-pagination a:hover,\r\n\t\t\t\t.loop-pagination a:focus,\r\n\t\t\t\t.loop-pagination .current\r\n\t\t\t\t{ background-color: #{$hex}; }\r\n\t\t\t"; $style .= ".menu-toggle button, #menu-primary li a { background: rgba( {$rgb}, 0.95 ); }"; $style .= ".loop-pagination span, .loop-pagination a { background: rgba( {$rgb}, 0.9 ); }"; /* Return the styles. */ return str_replace(array("\r", "\n", "\t"), '', $style); }