Index: src/wp-content/themes/twentytwenty/.stylelintrc.json =================================================================== --- src/wp-content/themes/twentytwenty/.stylelintrc.json (revision 46568) +++ src/wp-content/themes/twentytwenty/.stylelintrc.json (working copy) @@ -1,12 +1,12 @@ -{ - "extends": [ - "stylelint-config-wordpress" - ], - "plugins": ["stylelint-a11y"], - "rules": { - "font-family-no-missing-generic-family-keyword": null, - "no-descending-specificity": null, - "a11y/no-outline-none": true, - "a11y/selector-pseudo-class-focus": true - } -} +{ + "extends": [ + "stylelint-config-wordpress" + ], + "plugins": ["stylelint-a11y"], + "rules": { + "font-family-no-missing-generic-family-keyword": null, + "no-descending-specificity": null, + "a11y/no-outline-none": true, + "a11y/selector-pseudo-class-focus": true + } +} Index: src/wp-content/themes/twentytwenty/assets/css/editor-style-block-rtl.css =================================================================== --- src/wp-content/themes/twentytwenty/assets/css/editor-style-block-rtl.css (revision 46568) +++ src/wp-content/themes/twentytwenty/assets/css/editor-style-block-rtl.css (working copy) @@ -12,7 +12,6 @@ } .editor-styles-wrapper > * { - color: #000; font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, sans-serif; font-size: 18px; } @@ -26,10 +25,16 @@ } .block-editor-default-block-appender textarea.block-editor-default-block-appender__content { + color: inherit; font-family: inherit; font-size: inherit; } +.block-editor-block-list__empty-block-inserter .block-editor-inserter__toggle:not(:hover):not(:focus), +.block-editor-default-block-appender .block-editor-inserter .block-editor-inserter__toggle:not(:hover):not(:focus) { + color: inherit; +} + /* Fonts ------------------------------------- */ @@ -195,7 +200,7 @@ /* Typography -------------------------------- */ -.editor-styles-wrapper a { +.editor-styles-wrapper .editor-block-list__layout a { color: #cd2653; text-decoration: underline; } @@ -212,7 +217,6 @@ .editor-styles-wrapper .wp-block h4, .editor-styles-wrapper .wp-block h5, .editor-styles-wrapper .wp-block h6 { - color: #000; font-feature-settings: "lnum"; font-variant-numeric: lining-nums; font-weight: 700; @@ -473,13 +477,13 @@ border: none; } -.editor-styles-wrapper .wp-block-table caption { +.editor-styles-wrapper .wp-block-table caption { background: #dcd7ca; text-align: center; } -.editor-styles-wrapper .wp-block-table th, -.editor-styles-wrapper .wp-block-table td { +.editor-styles-wrapper .wp-block-table th, +.editor-styles-wrapper .wp-block-table td { line-height: 1.4; margin: 0; overflow: visible; @@ -575,7 +579,6 @@ border-color: #cd2653; border-style: solid; border-width: 0 2px 0 0; - color: inherit; margin: 20px 0; padding: 5px 20px 5px 0; } @@ -633,6 +636,10 @@ /* Block: Code, Verse and Preformatted ------- */ +.editor-styles-wrapper .wp-block-code { + color: inherit; +} + .editor-styles-wrapper .wp-block-code, .editor-styles-wrapper .wp-block-preformatted pre, .editor-styles-wrapper .wp-block-verse pre { @@ -641,10 +648,12 @@ padding: 30px; } +.editor-styles-wrapper .wp-block-freeform.block-library-rich-text__tinymce pre, .editor-styles-wrapper .wp-block-preformatted pre, .editor-styles-wrapper .wp-block-code .block-editor-plain-text, .editor-styles-wrapper .wp-block-verse pre { background: transparent; + color: inherit; font-family: monospace; font-size: 14px; } @@ -938,6 +947,12 @@ margin-top: 15px; } +/* Block: Shortcode -------------------------- */ + +.editor-styles-wrapper .wp-block-shortcode textarea { + color: #191e23; +} + /* Block: Embed ------------------------------ */ .editor-styles-wrapper .wp-block-embed { Index: src/wp-content/themes/twentytwenty/assets/css/editor-style-block.css =================================================================== --- src/wp-content/themes/twentytwenty/assets/css/editor-style-block.css (revision 46568) +++ src/wp-content/themes/twentytwenty/assets/css/editor-style-block.css (working copy) @@ -12,7 +12,6 @@ } .editor-styles-wrapper > * { - color: #000; font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, sans-serif; font-size: 18px; } @@ -26,10 +25,16 @@ } .block-editor-default-block-appender textarea.block-editor-default-block-appender__content { + color: inherit; font-family: inherit; font-size: inherit; } +.block-editor-block-list__empty-block-inserter .block-editor-inserter__toggle:not(:hover):not(:focus), +.block-editor-default-block-appender .block-editor-inserter .block-editor-inserter__toggle:not(:hover):not(:focus) { + color: inherit; +} + /* Fonts ------------------------------------- */ @@ -195,7 +200,7 @@ /* Typography -------------------------------- */ -.editor-styles-wrapper a { +.editor-styles-wrapper .editor-block-list__layout a { color: #cd2653; text-decoration: underline; } @@ -212,7 +217,6 @@ .editor-styles-wrapper .wp-block h4, .editor-styles-wrapper .wp-block h5, .editor-styles-wrapper .wp-block h6 { - color: #000; font-feature-settings: "lnum"; font-variant-numeric: lining-nums; font-weight: 700; @@ -473,13 +477,13 @@ border: none; } -.editor-styles-wrapper .wp-block-table caption { +.editor-styles-wrapper .wp-block-table caption { background: #dcd7ca; text-align: center; } -.editor-styles-wrapper .wp-block-table th, -.editor-styles-wrapper .wp-block-table td { +.editor-styles-wrapper .wp-block-table th, +.editor-styles-wrapper .wp-block-table td { line-height: 1.4; margin: 0; overflow: visible; @@ -575,7 +579,6 @@ border-color: #cd2653; border-style: solid; border-width: 0 0 0 2px; - color: inherit; margin: 20px 0; padding: 5px 0 5px 20px; } @@ -633,6 +636,10 @@ /* Block: Code, Verse and Preformatted ------- */ +.editor-styles-wrapper .wp-block-code { + color: inherit; +} + .editor-styles-wrapper .wp-block-code, .editor-styles-wrapper .wp-block-preformatted pre, .editor-styles-wrapper .wp-block-verse pre { @@ -641,10 +648,12 @@ padding: 30px; } +.editor-styles-wrapper .wp-block-freeform.block-library-rich-text__tinymce pre, .editor-styles-wrapper .wp-block-preformatted pre, .editor-styles-wrapper .wp-block-code .block-editor-plain-text, .editor-styles-wrapper .wp-block-verse pre { background: transparent; + color: inherit; font-family: monospace; font-size: 14px; } @@ -938,6 +947,12 @@ margin-top: 15px; } +/* Block: Shortcode -------------------------- */ + +.editor-styles-wrapper .wp-block-shortcode textarea { + color: #191e23; +} + /* Block: Embed ------------------------------ */ .editor-styles-wrapper .wp-block-embed { Index: src/wp-content/themes/twentytwenty/assets/fonts/inter/Inter-italic-var.woff2 =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/wp-content/themes/twentytwenty/assets/fonts/inter/Inter-italic-var.woff2 =================================================================== --- src/wp-content/themes/twentytwenty/assets/fonts/inter/Inter-italic-var.woff2 (revision 0) +++ src/wp-content/themes/twentytwenty/assets/fonts/inter/Inter-italic-var.woff2 (working copy) Property changes on: src/wp-content/themes/twentytwenty/assets/fonts/inter/Inter-italic-var.woff2 ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: src/wp-content/themes/twentytwenty/assets/fonts/inter/Inter-upright-var.woff2 =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/wp-content/themes/twentytwenty/assets/fonts/inter/Inter-upright-var.woff2 =================================================================== --- src/wp-content/themes/twentytwenty/assets/fonts/inter/Inter-upright-var.woff2 (revision 0) +++ src/wp-content/themes/twentytwenty/assets/fonts/inter/Inter-upright-var.woff2 (working copy) Property changes on: src/wp-content/themes/twentytwenty/assets/fonts/inter/Inter-upright-var.woff2 ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: src/wp-content/themes/twentytwenty/assets/images/2020-landscape-1.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/wp-content/themes/twentytwenty/assets/images/2020-landscape-1.png =================================================================== --- src/wp-content/themes/twentytwenty/assets/images/2020-landscape-1.png (revision 0) +++ src/wp-content/themes/twentytwenty/assets/images/2020-landscape-1.png (working copy) Property changes on: src/wp-content/themes/twentytwenty/assets/images/2020-landscape-1.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: src/wp-content/themes/twentytwenty/assets/images/2020-landscape-2.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/wp-content/themes/twentytwenty/assets/images/2020-landscape-2.png =================================================================== --- src/wp-content/themes/twentytwenty/assets/images/2020-landscape-2.png (revision 0) +++ src/wp-content/themes/twentytwenty/assets/images/2020-landscape-2.png (working copy) Property changes on: src/wp-content/themes/twentytwenty/assets/images/2020-landscape-2.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: src/wp-content/themes/twentytwenty/assets/images/2020-square-1.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/wp-content/themes/twentytwenty/assets/images/2020-square-1.png =================================================================== --- src/wp-content/themes/twentytwenty/assets/images/2020-square-1.png (revision 0) +++ src/wp-content/themes/twentytwenty/assets/images/2020-square-1.png (working copy) Property changes on: src/wp-content/themes/twentytwenty/assets/images/2020-square-1.png ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: src/wp-content/themes/twentytwenty/assets/images/2020-square-2.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/wp-content/themes/twentytwenty/assets/images/2020-square-2.png =================================================================== --- src/wp-content/themes/twentytwenty/assets/images/2020-square-2.png (revision 0) +++ src/wp-content/themes/twentytwenty/assets/images/2020-square-2.png (working copy) Property changes on: src/wp-content/themes/twentytwenty/assets/images/2020-square-2.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: src/wp-content/themes/twentytwenty/assets/images/2020-three-quarters-1.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/wp-content/themes/twentytwenty/assets/images/2020-three-quarters-1.png =================================================================== --- src/wp-content/themes/twentytwenty/assets/images/2020-three-quarters-1.png (revision 0) +++ src/wp-content/themes/twentytwenty/assets/images/2020-three-quarters-1.png (working copy) Property changes on: src/wp-content/themes/twentytwenty/assets/images/2020-three-quarters-1.png ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: src/wp-content/themes/twentytwenty/assets/images/2020-three-quarters-2.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/wp-content/themes/twentytwenty/assets/images/2020-three-quarters-2.png =================================================================== --- src/wp-content/themes/twentytwenty/assets/images/2020-three-quarters-2.png (revision 0) +++ src/wp-content/themes/twentytwenty/assets/images/2020-three-quarters-2.png (working copy) Property changes on: src/wp-content/themes/twentytwenty/assets/images/2020-three-quarters-2.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: src/wp-content/themes/twentytwenty/assets/images/2020-three-quarters-3.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/wp-content/themes/twentytwenty/assets/images/2020-three-quarters-3.png =================================================================== --- src/wp-content/themes/twentytwenty/assets/images/2020-three-quarters-3.png (revision 0) +++ src/wp-content/themes/twentytwenty/assets/images/2020-three-quarters-3.png (working copy) Property changes on: src/wp-content/themes/twentytwenty/assets/images/2020-three-quarters-3.png ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: src/wp-content/themes/twentytwenty/assets/images/2020-three-quarters-4.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/wp-content/themes/twentytwenty/assets/images/2020-three-quarters-4.png =================================================================== --- src/wp-content/themes/twentytwenty/assets/images/2020-three-quarters-4.png (revision 0) +++ src/wp-content/themes/twentytwenty/assets/images/2020-three-quarters-4.png (working copy) Property changes on: src/wp-content/themes/twentytwenty/assets/images/2020-three-quarters-4.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: src/wp-content/themes/twentytwenty/assets/js/color-calculations.js =================================================================== --- src/wp-content/themes/twentytwenty/assets/js/color-calculations.js (revision 46568) +++ src/wp-content/themes/twentytwenty/assets/js/color-calculations.js (working copy) @@ -35,19 +35,33 @@ */ _twentyTwentyColor.prototype.setAccentColorsArray = function() { var self = this, - minSaturation = 55, - maxSaturation = 90, - minLightness = 25, - maxLighness = 75, - stepSaturation = 2.5, - stepLightness = 2.5, + minSaturation = 65, + maxSaturation = 100, + minLightness = 30, + maxLighness = 80, + stepSaturation = 2, + stepLightness = 2, pushColor = function() { var colorObj = new Color( { h: self.accentHue, s: s, l: l } ), - item; + item, + /** + * Get a score for this color in contrast to its background color and surrounding text. + * + * @since 1.0.0 + * @param {number} contrastBackground - WCAG contrast with the background color. + * @param {number} contrastSurroundingText - WCAG contrast with surrounding text. + * @return {number} - 0 is best, higher numbers have bigger difference with the desired scores. + */ + getScore = function( contrastBackground, contrastSurroundingText ) { + var diffBackground = ( 7 >= contrastBackground ) ? 0 : 7 - contrastBackground, + diffSurroundingText = ( 3 >= contrastSurroundingText ) ? 0 : 3 - contrastSurroundingText; + + return diffBackground + diffSurroundingText; + }; item = { color: colorObj, @@ -62,7 +76,7 @@ // Get a score for this color by multiplying the 2 contrasts. // We'll use that to sort the array. - item.score = item.contrastBackground * item.contrastText; + item.score = getScore( item.contrastBackground, item.contrastText ); self.accentColorsArray.push( item ); }, @@ -89,7 +103,7 @@ // Sort colors by contrast. this.accentColorsArray.sort( function( a, b ) { - return b.score - a.score; + return a.score - b.score; } ); return this; }; Index: src/wp-content/themes/twentytwenty/assets/js/customize-preview.js =================================================================== --- src/wp-content/themes/twentytwenty/assets/js/customize-preview.js (revision 46568) +++ src/wp-content/themes/twentytwenty/assets/js/customize-preview.js (working copy) @@ -94,7 +94,7 @@ api( 'header_footer_background_color', function( value ) { value.bind( function( to ) { // Add background color to header and footer wrappers. - $( '#site-header,#site-footer' ).css( 'background-color', to ); + $( 'body:not(.overlay-header)#site-header, #site-footer' ).css( 'background-color', to ); // Change body classes if this is the same background-color as the content background. if ( to.toLowerCase() === api( 'background_color' ).get().toLowerCase() ) { Index: src/wp-content/themes/twentytwenty/assets/js/index.js =================================================================== --- src/wp-content/themes/twentytwenty/assets/js/index.js (revision 46568) +++ src/wp-content/themes/twentytwenty/assets/js/index.js (working copy) @@ -231,14 +231,14 @@ modal.style.removeProperty( 'top' ); } - _win.scrollTo( 0, Math.abs( _win.twentytwenty.scrolled + getAdminBarHeight() ) ); - - _win.twentytwenty.scrolled = 0; - if ( clickedEl !== false ) { clickedEl.focus(); clickedEl = false; } + + _win.scrollTo( 0, Math.abs( _win.twentytwenty.scrolled + getAdminBarHeight() ) ); + + _win.twentytwenty.scrolled = 0; }, 500 ); } ); } ); @@ -621,9 +621,6 @@ _doc.querySelector( '*[data-toggle-target="' + targetString + '"]' ).classList.toggle( activeClass ); } - // Toggle aria-expanded on the target - twentytwentyToggleAttribute( target, 'aria-expanded', 'true', 'false' ); - // Toggle aria-expanded on the toggle twentytwentyToggleAttribute( toggle, 'aria-expanded', 'true', 'false' ); Index: src/wp-content/themes/twentytwenty/classes/class-twentytwenty-customize.php =================================================================== --- src/wp-content/themes/twentytwenty/classes/class-twentytwenty-customize.php (revision 46568) +++ src/wp-content/themes/twentytwenty/classes/class-twentytwenty-customize.php (working copy) @@ -26,12 +26,6 @@ $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; - /** - * Removes the background image section. - * The theme only supports the background color option. - */ - $wp_customize->remove_section( 'background_image' ); - $wp_customize->selective_refresh->add_partial( 'blogname', array( Index: src/wp-content/themes/twentytwenty/classes/class-twentytwenty-walker-page.php =================================================================== --- src/wp-content/themes/twentytwenty/classes/class-twentytwenty-walker-page.php (revision 46568) +++ src/wp-content/themes/twentytwenty/classes/class-twentytwenty-walker-page.php (working copy) @@ -131,7 +131,7 @@ $toggle_duration = twentytwenty_toggle_duration(); // Add the sub menu toggle. - $args['list_item_after'] .= ''; + $args['list_item_after'] .= ''; } Index: src/wp-content/themes/twentytwenty/functions.php =================================================================== --- src/wp-content/themes/twentytwenty/functions.php (revision 46568) +++ src/wp-content/themes/twentytwenty/functions.php (working copy) @@ -602,29 +602,29 @@ $elements = array( 'content' => array( 'accent' => array( - 'color' => array( '.color-accent', '.color-accent-hover:hover', '.color-accent-hover:focus', '.has-accent-color', '.has-drop-cap:not(:focus):first-letter', '.wp-block-button.is-style-outline', 'a' ), + 'color' => array( '.color-accent', '.color-accent-hover:hover', '.color-accent-hover:focus', ':root .has-accent-color', '.has-drop-cap:not(:focus):first-letter', '.wp-block-button.is-style-outline', 'a' ), 'border-color' => array( 'blockquote', '.border-color-accent', '.border-color-accent-hover:hover', '.border-color-accent-hover:focus' ), - 'background' => array( 'button:not(.toggle)', '.button', '.faux-button', '.wp-block-button__link', '.wp-block-file .wp-block-file__button', 'input[type="button"]', 'input[type="reset"]', 'input[type="submit"]', '.bg-accent', '.bg-accent-hover:hover', '.bg-accent-hover:focus', '.has-accent-background-color', '.comment-reply-link' ), + 'background' => array( 'button:not(.toggle)', '.button', '.faux-button', '.wp-block-button__link', '.wp-block-file .wp-block-file__button', 'input[type="button"]', 'input[type="reset"]', 'input[type="submit"]', '.bg-accent', '.bg-accent-hover:hover', '.bg-accent-hover:focus', ':root .has-accent-background-color', '.comment-reply-link' ), 'fill' => array( '.fill-children-accent', '.fill-children-accent *' ), ), 'background' => array( - 'color' => array( 'button', '.button', '.faux-button', '.wp-block-button__link', '.wp-block-button__link:active', '.wp-block-button__link:focus', '.wp-block-button__link:visited', '.wp-block-button__link:hover', '.wp-block-file__button', 'input[type="button"]', 'input[type="reset"]', 'input[type="submit"]', '.comment-reply-link' ), - 'background' => array( '.has-background-background-color' ), + 'color' => array( ':root .has-background-color', 'button', '.button', '.faux-button', '.wp-block-button__link', '.wp-block-file__button', 'input[type="button"]', 'input[type="reset"]', 'input[type="submit"]', '.wp-block-button', '.comment-reply-link' ), + 'background' => array( ':root .has-background-background-color' ), ), 'text' => array( - 'color' => array( 'body', '.entry-title a', '.has-primary-color' ), - 'background' => array( '.has-primary-background-color' ), + 'color' => array( 'body', '.entry-title a', ':root .has-primary-color' ), + 'background' => array( ':root .has-primary-background-color' ), ), 'secondary' => array( - 'color' => array( 'cite', 'figcaption', '.wp-caption-text', '.post-meta', '.entry-content .wp-block-archives li', '.entry-content .wp-block-categories li', '.entry-content .wp-block-latest-posts li', '.wp-block-latest-comments__comment-date', '.wp-block-latest-posts__post-date', '.wp-block-embed figcaption', '.wp-block-image figcaption', '.wp-block-pullquote cite', '.comment-metadata', '.comment-respond .comment-notes', '.comment-respond .logged-in-as', '.pagination .dots', '.entry-content hr:not(.has-background)', 'hr.styled-separator', '.has-secondary-color' ), - 'background' => array( '.has-secondary-background-color' ), + 'color' => array( 'cite', 'figcaption', '.wp-caption-text', '.post-meta', '.entry-content .wp-block-archives li', '.entry-content .wp-block-categories li', '.entry-content .wp-block-latest-posts li', '.wp-block-latest-comments__comment-date', '.wp-block-latest-posts__post-date', '.wp-block-embed figcaption', '.wp-block-image figcaption', '.wp-block-pullquote cite', '.comment-metadata', '.comment-respond .comment-notes', '.comment-respond .logged-in-as', '.pagination .dots', '.entry-content hr:not(.has-background)', 'hr.styled-separator', ':root .has-secondary-color' ), + 'background' => array( ':root .has-secondary-background-color' ), ), 'borders' => array( 'border-color' => array( 'pre', 'fieldset', 'input', 'textarea', 'table', 'table *', 'hr' ), - 'background' => array( 'caption', 'code', 'code', 'kbd', 'samp', '.wp-block-table.is-style-stripes tbody tr:nth-child(odd)', '.has-subtle-background-background-color' ), + 'background' => array( 'caption', 'code', 'code', 'kbd', 'samp', '.wp-block-table.is-style-stripes tbody tr:nth-child(odd)', ':root .has-subtle-background-background-color' ), 'border-bottom-color' => array( '.wp-block-table.is-style-stripes' ), 'border-top-color' => array( '.wp-block-latest-posts.is-grid li' ), - 'color' => array( '.has-subtle-background-color' ), + 'color' => array( ':root .has-subtle-background-color' ), ), ), 'header-footer' => array( Index: src/wp-content/themes/twentytwenty/inc/custom-css.php =================================================================== --- src/wp-content/themes/twentytwenty/inc/custom-css.php (revision 46568) +++ src/wp-content/themes/twentytwenty/inc/custom-css.php (working copy) @@ -55,10 +55,15 @@ function twentytwenty_get_customizer_css( $type = 'front-end' ) { // Get variables. - $body = sanitize_hex_color( twentytwenty_get_color_for_area( 'content', 'text' ) ); - $body_default = '#000000'; - $accent = sanitize_hex_color( twentytwenty_get_color_for_area( 'content', 'accent' ) ); - $accent_default = '#cd2653'; + $body = sanitize_hex_color( twentytwenty_get_color_for_area( 'content', 'text' ) ); + $body_default = '#000000'; + $secondary = sanitize_hex_color( twentytwenty_get_color_for_area( 'content', 'secondary' ) ); + $secondary_default = '#6d6d6d'; + $borders = sanitize_hex_color( twentytwenty_get_color_for_area( 'content', 'borders' ) ); + $borders_default = '#dcd7ca'; + $accent = sanitize_hex_color( twentytwenty_get_color_for_area( 'content', 'accent' ) ); + $accent_default = '#cd2653'; + /** * Filters the CSS selectors targeting button component on frontend to apply common css * @@ -69,8 +74,8 @@ $buttons_targets = apply_filters( 'twentytwenty_buttons_targets_front_end', 'button, .button, .faux-button, .wp-block-button__link, .wp-block-file__button, input[type=\'button\'], input[type=\'reset\'], input[type=\'submit\']' ); // Header. - $header_footer_text = sanitize_hex_color( twentytwenty_get_color_for_area( 'header-footer', 'text' ) ); - $header_footer_accent = sanitize_hex_color( twentytwenty_get_color_for_area( 'header-footer', 'accent' ) ); + $header_footer_background = sanitize_hex_color( twentytwenty_get_color_for_area( 'header-footer', 'background' ) ); + $header_footer_background_default = '#ffffff'; // Cover. $cover = sanitize_hex_color( get_theme_mod( 'cover_template_overlay_text_color' ) ); @@ -126,12 +131,9 @@ // Colors. // Accent color. if ( $accent && $accent !== $accent_default ) { - twentytwenty_generate_css( '.editor-styles-wrapper a, .editor-styles-wrapper .has-drop-cap:not(:focus):first-letter', 'color', $accent ); - twentytwenty_generate_css( '.editor-styles-wrapper blockquote, .editor-styles-wrapper .wp-block-quote', 'border-color', $accent, '', ' !important' ); - twentytwenty_generate_css( '.editor-styles-wrapper .wp-block-file .wp-block-file__textlink', 'color', $accent ); - twentytwenty_generate_css( $buttons_targets, 'background', $accent ); - twentytwenty_generate_css( '.editor-styles-wrapper .wp-block-button.is-style-outline .wp-block-button__link', 'border-color', $accent ); - twentytwenty_generate_css( '.editor-styles-wrapper .wp-block-button.is-style-outline .wp-block-button__link', 'color', $accent ); + twentytwenty_generate_css( '.has-accent-color, .editor-styles-wrapper .editor-block-list__layout a, .editor-styles-wrapper .has-drop-cap:not(:focus)::first-letter, .editor-styles-wrapper .wp-block-button.is-style-outline .wp-block-button__link, .editor-styles-wrapper .wp-block-pullquote::before, .editor-styles-wrapper .wp-block-file .wp-block-file__textlink', 'color', $accent ); + twentytwenty_generate_css( '.editor-styles-wrapper .wp-block-quote', 'border-color', $accent, '' ); + twentytwenty_generate_css( '.has-accent-background-color, .editor-styles-wrapper .wp-block-button__link, .editor-styles-wrapper .wp-block-file__button', 'background-color', $accent ); } // Background color. @@ -139,9 +141,25 @@ twentytwenty_generate_css( '.editor-styles-wrapper', 'background', '#' . $background ); } + // Borders color. + if ( $borders && $borders !== $borders_default ) { + twentytwenty_generate_css( '.editor-styles-wrapper .wp-block-code, .editor-styles-wrapper pre, .editor-styles-wrapper .wp-block-preformatted pre, .editor-styles-wrapper .wp-block-verse pre, .editor-styles-wrapper fieldset, .editor-styles-wrapper .wp-block-table, .editor-styles-wrapper .wp-block-table *, .editor-styles-wrapper .wp-block-table.is-style-stripes, .editor-styles-wrapper .wp-block-latest-posts.is-grid li', 'border-color', $borders ); + twentytwenty_generate_css( '.editor-styles-wrapper .wp-block-table caption, .editor-styles-wrapper .wp-block-table.is-style-stripes tbody tr:nth-child(odd)', 'background-color', $borders ); + } + // Text color. if ( $body && $body !== $body_default ) { - twentytwenty_generate_css( 'body .editor-styles-wrapper, body .editor-post-title__block, body .editor-post-title__input, body textarea, .editor-post-title__block .editor-post-title__input', 'color', $body ); + twentytwenty_generate_css( 'body .editor-styles-wrapper, .editor-post-title__block .editor-post-title__input, .editor-post-title__block .editor-post-title__input:focus', 'color', $body ); + } + + // Secondary color. + if ( $secondary && $secondary !== $secondary_default ) { + twentytwenty_generate_css( '.editor-styles-wrapper figcaption, .editor-styles-wrapper cite, .editor-styles-wrapper .wp-block-quote__citation, .editor-styles-wrapper .wp-block-quote cite, .editor-styles-wrapper .wp-block-quote footer, .editor-styles-wrapper .wp-block-pullquote__citation, .editor-styles-wrapper .wp-block-pullquote cite, .editor-styles-wrapper .wp-block-pullquote footer, .editor-styles-wrapper ul.wp-block-archives li, .editor-styles-wrapper ul.wp-block-categories li, .editor-styles-wrapper ul.wp-block-latest-posts li, .editor-styles-wrapper ul.wp-block-categories__list li, .editor-styles-wrapper .wp-block-latest-comments time, .editor-styles-wrapper .wp-block-latest-posts time', 'color', $secondary ); + } + + // Header Footer Background Color. + if ( $header_footer_background && $header_footer_background !== $header_footer_background_default ) { + twentytwenty_generate_css( '.editor-styles-wrapper .wp-block-pullquote::before', 'background-color', $header_footer_background ); } } elseif ( 'classic-editor' === $type ) { Index: src/wp-content/themes/twentytwenty/inc/starter-content.php =================================================================== --- src/wp-content/themes/twentytwenty/inc/starter-content.php (revision 46568) +++ src/wp-content/themes/twentytwenty/inc/starter-content.php (working copy) @@ -21,7 +21,7 @@ // Define and register starter content to showcase the theme on new sites. $starter_content = array( - 'widgets' => array( + 'widgets' => array( // Place one core-defined widgets in the first footer widget area. 'sidebar-1' => array( 'text_about', @@ -32,11 +32,21 @@ ), ), + // Create the custom image attachments used as post thumbnails for pages. + 'attachments' => array( + 'image-opening' => array( + 'post_title' => _x( 'The New UMoMA Opens its Doors', 'Theme starter content', 'twentytwenty' ), + 'file' => 'assets/images/2020-landscape-1.png', // URL relative to the template directory. + ), + ), + // Specify the core-defined pages to create and add custom thumbnails to some of them. - 'posts' => array( + 'posts' => array( 'front' => array( 'post_type' => 'page', 'post_title' => __( 'The New UMoMA Opens its Doors', 'twentytwenty' ), + // Use the above featured image with the predefined about page. + 'thumbnail' => '{{image-opening}}', 'post_content' => join( '', array( @@ -49,6 +59,9 @@ '