Make WordPress Core

Ticket #38449: 38449.1.diff

File 38449.1.diff, 13.7 KB (added by Fencer04, 8 years ago)

Created new diff file from root for easier patch installation.

  • wp-content/themes/twentyseventeen/inc/color-patterns.php

     
    1111 * Generate the CSS for the current custom color scheme.
    1212 */
    1313function twentyseventeen_custom_colors_css() {
    14         $hue = get_theme_mod( 'colorscheme_hue', 250 );
     14        $hue = absint( get_theme_mod( 'colorscheme_hue', 250 ) );
    1515
    1616        /**
    1717         * Filter Twenty Seventeen default saturation level.
     
    2020         *
    2121         * @param $saturation integer
    2222         */
    23         $saturation = apply_filters( 'twentyseventeen_custom_colors_saturation', 50 );
     23        $saturation = absint( apply_filters( 'twentyseventeen_custom_colors_saturation', 50 ) );
    2424        $reduced_saturation = ( .8 * $saturation ) . '%';
    2525        $saturation = $saturation . '%';
    2626        $css = '
     
    8282.colors-custom .widget .widget-title a:hover,
    8383.colors-custom .widget ul li a:focus,
    8484.colors-custom .widget ul li a:hover {
    85         color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 0% ); /* base: #000; */
     85        color: hsl( ' . $hue . ', ' . $saturation . ', 0% ); /* base: #000; */
    8686}
    8787
    8888.colors-custom .entry-content a,
     
    9191.colors-custom .site-footer .widget-area a,
    9292.colors-custom .posts-navigation a,
    9393.colors-custom .widget_authors a strong {
    94         -webkit-box-shadow: inset 0 -1px 0 hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 6% ); /* base: rgba(15, 15, 15, 1); */
    95         box-shadow: inset 0 -1px 0 hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 6% ); /* base: rgba(15, 15, 15, 1); */
     94        -webkit-box-shadow: inset 0 -1px 0 hsl( ' . $hue . ', ' . $saturation . ', 6% ); /* base: rgba(15, 15, 15, 1); */
     95        box-shadow: inset 0 -1px 0 hsl( ' . $hue . ', ' . $saturation . ', 6% ); /* base: rgba(15, 15, 15, 1); */
    9696}
    9797
    9898.colors-custom button,
     
    9999.colors-custom input[type="button"],
    100100.colors-custom input[type="submit"],
    101101.colors-custom .entry-footer .edit-link a.post-edit-link {
    102         background-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 13% ); /* base: #222; */
     102        background-color: hsl( ' . $hue . ', ' . $saturation . ', 13% ); /* base: #222; */
    103103}
    104104
    105105.colors-custom input[type="text"]:focus,
     
    141141.colors-custom .post-navigation a:hover .icon,
    142142.colors-custom .site-content .site-content-light,
    143143.colors-custom .twentyseventeen-panel .recent-posts .entry-header .edit-link {
    144         color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 13% ); /* base: #222; */
     144        color: hsl( ' . $hue . ', ' . $saturation . ', 13% ); /* base: #222; */
    145145}
    146146
    147147.colors-custom .entry-content a:focus,
     
    196196.colors-custom .widget .widget-title a:hover,
    197197.colors-custom .widget ul li a:focus,
    198198.colors-custom .widget ul li a:hover {
    199         -webkit-box-shadow: inset 0 0 0 hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 13% ), 0 3px 0 hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 13% );
    200         box-shadow: inset 0 0 0 hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 13% ), 0 3px 0 hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 13% );
     199        -webkit-box-shadow: inset 0 0 0 hsl( ' . $hue . ', ' . $saturation . ', 13% ), 0 3px 0 hsl( ' . $hue . ', ' . $saturation . ', 13% );
     200        box-shadow: inset 0 0 0 hsl( ' . $hue . ', ' . $saturation. ' , 13% ), 0 3px 0 hsl( ' . $hue . ', ' . $saturation . ', 13% );
    201201}
    202202
    203203body.colors-custom,
     
    217217.colors-custom .nav-title,
    218218.colors-custom .comment-body,
    219219.colors-custom .site-content .wp-playlist-light .wp-playlist-current-item .wp-playlist-item-album {
    220         color: hsl( ' . esc_attr( $hue ) . ', ' . $reduced_saturation . ', 20% ); /* base: #333; */
     220        color: hsl( ' . $hue . ', ' . $reduced_saturation . ', 20% ); /* base: #333; */
    221221}
    222222
    223223.colors-custom .social-navigation a:hover,
    224224.colors-custom .social-navigation a:focus {
    225         background: hsl( ' . esc_attr( $hue ) . ', ' . $reduced_saturation . ', 20% ); /* base: #333; */
     225        background: hsl( ' . $hue . ', ' . $reduced_saturation . ', 20% ); /* base: #333; */
    226226}
    227227
    228228.colors-custom input[type="text"]:focus,
     
    242242.colors-custom input[type="color"]:focus,
    243243.colors-custom textarea:focus,
    244244.bypostauthor > .comment-body > .comment-meta > .comment-author .avatar {
    245         border-color: hsl( ' . esc_attr( $hue ) . ', ' . $reduced_saturation . ', 20% ); /* base: #333; */
     245        border-color: hsl( ' . $hue . ', ' . $reduced_saturation . ', 20% ); /* base: #333; */
    246246}
    247247
    248248.colors-custom h2,
     
    270270.colors-custom .site-info a,
    271271.colors-custom .wp-caption,
    272272.colors-custom .gallery-caption {
    273         color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 40% ); /* base: #666; */
     273        color: hsl( ' . $hue . ', ' . $saturation . ', 40% ); /* base: #666; */
    274274}
    275275
    276276.colors-custom abbr,
    277277.colors-custom acronym {
    278         border-bottom-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 40% ); /* base: #666; */
     278        border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 40% ); /* base: #666; */
    279279}
    280280
    281281.colors-custom h5,
     
    295295.colors-custom .navigation-top .current_page_item > a,
    296296.colors-custom .main-navigation a:hover,
    297297.colors-custom .site-content .wp-playlist-light .wp-playlist-current-item .wp-playlist-item-artist {
    298         color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 46% ); /* base: #767676; */
     298        color: hsl( ' . $hue . ', ' . $saturation . ', 46% ); /* base: #767676; */
    299299}
    300300
    301301.colors-custom button:hover,
     
    313313.colors-custom .next.page-numbers:hover,
    314314.colors-custom .site-content .wp-playlist-light .wp-playlist-item:hover,
    315315.colors-custom .site-content .wp-playlist-light .wp-playlist-item:focus {
    316         background: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 46% ); /* base: #767676; */
     316        background: hsl( ' . $hue . ', ' . $saturation . ', 46% ); /* base: #767676; */
    317317}
    318318
    319319.colors-custom button.secondary:hover,
     
    327327.colors-custom input[type="submit"].secondary:hover,
    328328.colors-custom input[type="submit"].secondary:focus,
    329329.colors-custom hr {
    330         background: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 73% ); /* base: #bbb; */
     330        background: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */
    331331}
    332332
    333333.colors-custom input[type="text"],
     
    354354.colors-custom .widget.widget_tag_cloud a:focus,
    355355.colors-custom .wp_widget_tag_cloud a:hover,
    356356.colors-custom .wp_widget_tag_cloud a:focus {
    357         border-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 73% ); /* base: #bbb; */
     357        border-color: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */
    358358}
    359359
    360360.colors-custom thead th {
    361         border-bottom-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 73% ); /* base: #bbb; */
     361        border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */
    362362}
    363363
    364364.colors-custom .entry-footer .cat-links .icon,
    365365.colors-custom .entry-footer .tags-links .icon {
    366         color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 73% ); /* base: #bbb; */
     366        color: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */
    367367}
    368368
    369369.colors-custom button.secondary,
     
    373373.colors-custom input[type="submit"].secondary,
    374374.colors-custom .prev.page-numbers,
    375375.colors-custom .next.page-numbers {
    376         background-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 87% ); /* base: #ddd; */
     376        background-color: hsl( ' . $hue . ', ' . $saturation . ', 87% ); /* base: #ddd; */
    377377}
    378378
    379379.colors-custom .widget .tagcloud a,
    380380.colors-custom .widget.widget_tag_cloud a,
    381381.colors-custom .wp_widget_tag_cloud a {
    382         border-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 87% ); /* base: #ddd; */
     382        border-color: hsl( ' . $hue . ', ' . $saturation . ', 87% ); /* base: #ddd; */
    383383}
    384384
    385385.colors-custom.twentyseventeen-front-page article:not(.has-post-thumbnail):not(:first-child),
    386386.colors-custom .widget ul li {
    387         border-top-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 87% ); /* base: #ddd; */
     387        border-top-color: hsl( ' . $hue . ', ' . $saturation . ', 87% ); /* base: #ddd; */
    388388}
    389389
    390390.colors-custom .widget ul li {
    391         border-bottom-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 87% ); /* base: #ddd; */
     391        border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 87% ); /* base: #ddd; */
    392392}
    393393
    394394.colors-custom pre,
    395395.colors-custom mark,
    396396.colors-custom ins {
    397         background: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 93% ); /* base: #eee; */
     397        background: hsl( ' . $hue . ', ' . $saturation . ', 93% ); /* base: #eee; */
    398398}
    399399
    400400.colors-custom .navigation-top,
     
    403403.colors-custom .comments-pagination,
    404404.colors-custom .entry-footer,
    405405.colors-custom .site-footer {
    406         border-top-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 93% ); /* base: #eee; */
     406        border-top-color: hsl( ' . $hue . ', ' . $saturation . ', 93% ); /* base: #eee; */
    407407}
    408408
    409409.colors-custom .navigation-top,
     
    412412.colors-custom .single-featured-image-header,
    413413.colors-custom .site-content .wp-playlist-light .wp-playlist-item,
    414414.colors-custom tr {
    415         border-bottom-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 93% ); /* base: #eee; */
     415        border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 93% ); /* base: #eee; */
    416416}
    417417
    418418.colors-custom .site-content .wp-playlist-light {
    419         border-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 93% ); /* base: #eee; */
     419        border-color: hsl( ' . $hue . ', ' . $saturation . ', 93% ); /* base: #eee; */
    420420}
    421421
    422422.colors-custom .site-header,
    423423.colors-custom .single-featured-image-header {
    424         background-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 98% ); /* base: #fafafa; */
     424        background-color: hsl( ' . $hue . ', ' . $saturation . ', 98% ); /* base: #fafafa; */
    425425}
    426426
    427427.colors-custom button,
     
    441441.colors-custom.has-header-image .site-title,
    442442.colors-custom.has-header-image .site-title a,
    443443.colors-custom.has-header-image .site-description {
    444         color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 100% ); /* base: #fff; */
     444        color: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */
    445445}
    446446
    447447body.colors-custom,
    448448.colors-custom .navigation-top,
    449449.colors-custom .main-navigation ul {
    450         background: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 100% ); /* base: #fff; */
     450        background: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */
    451451}
    452452
    453453.colors-custom .widget ul li a,
    454454.colors-custom .site-footer .widget-area ul li a {
    455         -webkit-box-shadow: inset 0 -1px 0 hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 100% ); /* base: rgba(255, 255, 255, 1); */
    456         box-shadow: inset 0 -1px 0 hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 100% );  /* base: rgba(255, 255, 255, 1); */
     455        -webkit-box-shadow: inset 0 -1px 0 hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: rgba(255, 255, 255, 1); */
     456        box-shadow: inset 0 -1px 0 hsl( ' . $hue . ', ' . $saturation . ', 100% );  /* base: rgba(255, 255, 255, 1); */
    457457}
    458458
    459459.colors-custom .menu-toggle,
     
    513513
    514514        .colors-custom .nav-links .nav-previous .nav-title .icon,
    515515        .colors-custom .nav-links .nav-next .nav-title .icon {
    516                 color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 20% ); /* base: #222; */
     516                color: hsl( ' . $hue . ', ' . $saturation . ', 20% ); /* base: #222; */
    517517        }
    518518
    519519        .colors-custom .main-navigation li li:hover,
    520520        .colors-custom .main-navigation li li.focus {
    521                 background: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 46% ); /* base: #767676; */
     521                background: hsl( ' . $hue . ', ' . $saturation . ', 46% ); /* base: #767676; */
    522522        }
    523523
    524524        .colors-custom .navigation-top .menu-scroll-down {
    525                 color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 46% ); /* base: #767676; */;
     525                color: hsl( ' . $hue . ', ' . $saturation . ', 46% ); /* base: #767676; */;
    526526        }
    527527
    528528        .colors-custom abbr[title] {
    529                 border-bottom-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 46% ); /* base: #767676; */;
     529                border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 46% ); /* base: #767676; */;
    530530        }
    531531
    532532        .colors-custom .main-navigation ul ul {
    533                 border-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 73% ); /* base: #bbb; */
    534                 background: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 100% ); /* base: #fff; */
     533                border-color: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */
     534                background: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */
    535535        }
    536536
    537537        .colors-custom .main-navigation ul li.menu-item-has-children:before,
    538538        .colors-custom .main-navigation ul li.page_item_has_children:before {
    539                 border-bottom-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 73% ); /* base: #bbb; */
     539                border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */
    540540        }
    541541
    542542        .colors-custom .main-navigation ul li.menu-item-has-children:after,
    543543        .colors-custom .main-navigation ul li.page_item_has_children:after {
    544                 border-bottom-color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 100% ); /* base: #fff; */
     544                border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */
    545545        }
    546546
    547547        .colors-custom .main-navigation li li.focus > a,
     
    553553        .colors-custom .main-navigation li li.current-menu-item a:hover,
    554554        .colors-custom .main-navigation li li.current_page_item a:focus,
    555555        .colors-custom .main-navigation li li.current-menu-item a:focus {
    556                 color: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 100% ); /* base: #fff; */
     556                color: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */
    557557        }
    558558}';
    559559