From f2517bad92a287870b31a21ce4296c74cd0bafae Mon Sep 17 00:00:00 2001 From: allancole Date: Mon, 12 Nov 2018 23:19:13 +0000 Subject: [PATCH] Updating Twenty Nineteen, our new default theme for 2019, set for 5.0. This update applies the following changes: - Improve menu UI to support keyboard, click and touch interactions - Improve variable scoping and js performance in menu interaction javascript - Improve custom-colors for selected text, buttons and menu hover styles - Improve margins structure for more consistency between editor and frontend - Improve discussion avatars for simpler wording and better performance - Improve fonts in list widgets and list blocks - Improve comment responsive spacing and avatar display - Improve various block styles to make them consistent between the editor and frontend - Add tabbed browsing support for ie11 - Add backwards compatibility support for older versions of WordPress - Add fallback styles for older versions of WP where Gutenberg is activated and then deactivated (backwards compatibility) - Add `sizes` attribute for featured images to improve responsive performance - Add focus-within polyfill - Add a footer menu for secondary page links - Fix editor styles to prevent conflicts with plugins that add meta boxes to the editor - Fix columns block issues on small screens - Fix empty-space font text cursor issue in Gutenberg editor - Fix RTL floating styles so that left/right floats are honored - Fix cover image block margins/padding - Fix invalid rgba style - Fix php warning when returning attributes - Fix gallery widget margins to improve gallery grids - Fix .entry-content selectors to prevent shortcodes, plugins and other unknown content from breaking the layout - Remove translation escaping to follow code standards in previous default themes - Remove custom color output in the fronten header when default color is selected - Remove fly-out sub-sub-sub-menu behavior on desktop to prevent sub-menus from falling off the screen - General code clean up and coding standards improvements Initial development occurred on GitHub. See: https://github.com/WordPress/twentynineteen Props allancole, karmatosed, kjellr, yingling017, mrasharirfan, milana_cap, fabiankaegy, westonruter, aaronjorbin, netweb, b-07, khleomix, blowery, dereksmart, jasmussen, audrasjb, nielslange, mmaumio, dimadin, joyously, anevins12, peterwilsoncc, dannycooper, icaleb, siriokun, technosiren, travel_girl, azchughtai, ianbelanger, nadim1992, ismailelkorchi, nativeinside, chetan200891, icaleb, grapplerulrich, ocean90, joshfeck, frankew, abdulwahab610, mendezcode, eliorivero, melchoyce, joen, laurelfulford, mdawaffe, kraftbj, dsmart, mukeshpanchal27, burhandodhy, crunnells, Ismail-elkorchi, aryaprakasa, @tlxo, @themeroots, @whizbangik, @yingles, @youthkee, @brentswisher, @smy315, @ahmadawais, @desi-developer. git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43892 602fd350-edb4-49c9-b593-d223f7449a82 --- .../themes/twentynineteen/archive.php | 7 +- .../class-twentynineteen-svg-icons.php | 159 +- .../class-twentynineteen-walker-comment.php | 11 +- .../themes/twentynineteen/comments.php | 20 +- .../fonts/NonBreakingSpaceOverride.woff | Bin 0 -> 1212 bytes .../fonts/NonBreakingSpaceOverride.woff2 | Bin 0 -> 764 bytes .../themes/twentynineteen/footer.php | 15 +- .../themes/twentynineteen/functions.php | 47 +- .../themes/twentynineteen/header.php | 5 +- .../themes/twentynineteen/image.php | 4 +- .../themes/twentynineteen/inc/back-compat.php | 76 + .../twentynineteen/inc/color-patterns.php | 69 +- .../twentynineteen/inc/template-functions.php | 145 +- .../twentynineteen/inc/template-tags.php | 38 +- .../themes/twentynineteen/index.php | 35 +- .../twentynineteen/js/customize-preview.js | 16 +- .../themes/twentynineteen/js/priority-menu.js | 128 + .../js/touch-keyboard-navigation.js | 277 +++ .../twentynineteen/js/touch-navigation.js | 163 -- .../themes/twentynineteen/package-lock.json | 52 +- .../themes/twentynineteen/package.json | 7 +- .../themes/twentynineteen/postcss.config.js | 10 +- .../themes/twentynineteen/readme.txt | 15 +- .../twentynineteen/sass/blocks/_blocks.scss | 351 +-- .../sass/elements/_elements.scss | 17 +- .../twentynineteen/sass/elements/_tables.scss | 8 +- .../twentynineteen/sass/media/_captions.scss | 13 + .../twentynineteen/sass/media/_galleries.scss | 8 +- .../sass/mixins/_mixins-master.scss | 129 +- .../sass/mixins/_utilities.scss | 7 + .../sass/modules/_alignments.scss | 12 + .../navigation/_menu-footer-navigation.scss | 22 + .../navigation/_menu-main-navigation.scss | 388 ++- .../sass/navigation/_navigation.scss | 1 + .../sass/navigation/_next-previous.scss | 42 +- .../sass/site/footer/_site-footer.scss | 4 +- .../site/header/_site-featured-image.scss | 192 +- .../sass/site/header/_site-header.scss | 8 +- .../sass/site/primary/_archives.scss | 7 +- .../sass/site/primary/_comments.scss | 81 +- .../sass/site/primary/_posts-and-pages.scss | 63 +- .../sass/site/secondary/_widgets.scss | 44 +- .../twentynineteen/sass/typography/_copy.scss | 13 +- .../sass/typography/_headings.scss | 54 +- .../sass/typography/_typography.scss | 2 + .../sass/variables-site/_fonts.scss | 2 +- .../sass/variables-site/_structure.scss | 5 +- .../themes/twentynineteen/search.php | 2 +- .../themes/twentynineteen/single.php | 2 - .../style-editor-customizer.css | 94 +- .../style-editor-customizer.scss | 14 +- .../twentynineteen/style-editor-frame.css | 60 - .../twentynineteen/style-editor-frame.scss | 67 - .../themes/twentynineteen/style-editor.css | 217 +- .../themes/twentynineteen/style-editor.scss | 184 +- .../themes/twentynineteen/style-rtl.css | 2135 ++++++++++++----- .../themes/twentynineteen/style.css | 2079 +++++++++++----- .../template-parts/content/content-none.php | 6 +- .../template-parts/content/content-page.php | 2 +- .../template-parts/content/content-single.php | 2 +- .../template-parts/content/content.php | 2 +- .../template-parts/header/site-branding.php | 1 + .../template-parts/post/discussion-meta.php | 18 +- 63 files changed, 5237 insertions(+), 2420 deletions(-) create mode 100755 src/wp-content/themes/twentynineteen/fonts/NonBreakingSpaceOverride.woff create mode 100755 src/wp-content/themes/twentynineteen/fonts/NonBreakingSpaceOverride.woff2 create mode 100644 src/wp-content/themes/twentynineteen/inc/back-compat.php create mode 100644 src/wp-content/themes/twentynineteen/js/priority-menu.js create mode 100644 src/wp-content/themes/twentynineteen/js/touch-keyboard-navigation.js delete mode 100644 src/wp-content/themes/twentynineteen/js/touch-navigation.js create mode 100755 src/wp-content/themes/twentynineteen/sass/navigation/_menu-footer-navigation.scss delete mode 100644 src/wp-content/themes/twentynineteen/style-editor-frame.css delete mode 100644 src/wp-content/themes/twentynineteen/style-editor-frame.scss diff --git a/src/wp-content/themes/twentynineteen/archive.php b/src/wp-content/themes/twentynineteen/archive.php index df8b24fb7c..3d2273e43e 100644 --- a/src/wp-content/themes/twentynineteen/archive.php +++ b/src/wp-content/themes/twentynineteen/archive.php @@ -45,13 +45,12 @@ get_header(); // If no content, include the "No posts found" template. else : - get_template_part( 'template-parts/content', 'none' ); + get_template_part( 'template-parts/content/content', 'none' ); endif; ?> - - - + + /* material-design – link */ ' - - + + ', 'watch' => /* material-design – watch-later */ ' - + - + - + ', 'archive' => /* material-design – folder */ ' - - + + ', 'tag' => /* material-design – local_offer */ ' - - + + ', 'comment' => /* material-design – comment */ ' - - + + ', 'person' => /* material-design – person */ ' - - + + ', 'edit' => /* material-design – edit */ ' - - + + ', 'chevron_left' => /* material-design – chevron_left */ ' - - + + ', 'chevron_right' => /* material-design – chevron_right */ ' - - + + ', 'check' => /* material-design – check */ ' - - + + ', 'arrow_drop_down_circle' => /* material-design – arrow_drop_down_circle */ ' - - + + ', 'keyboard_arrow_down' => /* material-design – keyboard_arrow_down */ ' - - + + ', 'keyboard_arrow_right' => /* material-design – keyboard_arrow_right */ ' - - + + ', 'keyboard_arrow_left' => /* material-design – keyboard_arrow_left */ ' - - + + +', + + 'arrow_drop_down_ellipsis' => /* custom – arrow_drop_down_ellipsis */ ' + + + + + ', ); @@ -203,6 +211,9 @@ class TwentyNineteen_SVG_Icons { 'google-plus' => array( 'plus.google.com', ), + 'lastfm' => array( + 'last.fm', + ), 'mail' => array( 'mailto:', ), @@ -229,213 +240,217 @@ class TwentyNineteen_SVG_Icons { static $social_icons = array( '500px' => ' - + ', 'amazon' => ' - + ', 'apple' => ' - + ', 'bandcamp' => ' - + ', 'behance' => ' - + ', 'chain' => ' - + ', 'codepen' => ' - + ', 'deviantart' => ' - + ', 'digg' => ' - + ', 'dribbble' => ' - + ', 'dropbox' => ' - + ', 'etsy' => ' - + ', 'facebook' => ' - + ', 'feed' => ' - + ', 'flickr' => ' - + ', 'foursquare' => ' - + ', 'goodreads' => ' - + ', 'google-plus' => ' - + ', 'google' => ' - + ', 'github' => ' - + ', 'instagram' => ' - + +', + + 'lastfm' => ' + + ', 'linkedin' => ' - + ', 'mail' => ' - + ', 'meetup' => ' - + ', 'medium' => ' - + ', 'pinterest' => ' - + ', 'pocket' => ' - + ', 'reddit' => ' - + ', 'skype' => ' - + ', 'slideshare' => ' - + ', 'snapchat' => ' - + ', 'soundcloud' => ' - + ', 'spotify' => ' - + ', 'stumbleupon' => ' - + ', 'tumblr' => ' - + ', 'twitch' => ' - + ', 'twitter' => ' - + ', 'vimeo' => ' - + ', 'vk' => ' - + ', 'wordpress' => ' - + ', 'yelp' => ' - + ', 'youtube' => ' - + ', ); diff --git a/src/wp-content/themes/twentynineteen/classes/class-twentynineteen-walker-comment.php b/src/wp-content/themes/twentynineteen/classes/class-twentynineteen-walker-comment.php index 5d94fd7dac..b39185e45e 100644 --- a/src/wp-content/themes/twentynineteen/classes/class-twentynineteen-walker-comment.php +++ b/src/wp-content/themes/twentynineteen/classes/class-twentynineteen-walker-comment.php @@ -55,8 +55,8 @@ class TwentyNineteen_Walker_Comment extends Walker_Comment { printf( '', twentynineteen_get_icon_svg( 'check', 24 ) ); } - /* translators: %s: comment author link */ printf( + /* translators: %s: comment author link */ __( '%s says:', 'twentynineteen' ), sprintf( '%s', $comment_author ) ); @@ -69,9 +69,12 @@ class TwentyNineteen_Walker_Comment extends Walker_Comment {
- -
-
+

responses ) { /* translators: %s: post title */ printf( _x( 'One reply on “%s”', 'comments title', 'twentynineteen' ), get_the_title() ); } else { @@ -44,11 +44,11 @@ if ( post_password_required() ) { _nx( '%1$s reply on “%2$s”', '%1$s replies on “%2$s”', - $comments_number, + $discussion->responses, 'comments title', 'twentynineteen' ), - number_format_i18n( $comments_number ), + number_format_i18n( $discussion->responses ), get_the_title() ); } @@ -102,9 +102,9 @@ if ( post_password_required() ) { if ( comments_open() && 'asc' === strtolower( get_option( 'comment_order', 'asc' ) ) ) : ?>
- + - +

- +

;WSUMGC%2OCB)lnP;n=##B{&aV~J@rvw8@o&V=a1wEc44fmlfqCp+FCPG`4RN~= zs8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86t zB-~V#WxhiIYly295i+p0yJaLYfB~H~k(71YOjpLLvaYi+tpgLalC50dtb!#1G0x^} z{f5-7CPeOF$w8NGB(e2{aYae`5i7{H#)>;SBA$LDgs6U&GI!;(t$`ZY$73Fmz}BAS zJ}0=<&zYfNip?`46-m-J& ' ); } ?> + + +

diff --git a/src/wp-content/themes/twentynineteen/functions.php b/src/wp-content/themes/twentynineteen/functions.php index b6cd2acfed..ca792cf32b 100644 --- a/src/wp-content/themes/twentynineteen/functions.php +++ b/src/wp-content/themes/twentynineteen/functions.php @@ -9,6 +9,14 @@ * @since 1.0.0 */ +/** + * Twenty Nineteen only works in WordPress 4.7 or later. + */ +if ( version_compare( $GLOBALS['wp_version'], '4.7', '<' ) ) { + require get_template_directory() . '/inc/back-compat.php'; + return; +} + if ( ! function_exists( 'twentynineteen_setup' ) ) : /** * Sets up theme defaults and registers support for various WordPress features. @@ -48,7 +56,8 @@ if ( ! function_exists( 'twentynineteen_setup' ) ) : // This theme uses wp_nav_menu() in two locations. register_nav_menus( array( - 'menu-1' => esc_html__( 'Primary', 'twentynineteen' ), + 'menu-1' => __( 'Primary', 'twentynineteen' ), + 'footer' => __( 'Footer Menu', 'twentynineteen' ), 'social' => __( 'Social Links Menu', 'twentynineteen' ), ) ); @@ -86,31 +95,31 @@ if ( ! function_exists( 'twentynineteen_setup' ) ) : // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); - // Add support for Block Styles + // Add support for Block Styles. add_theme_support( 'wp-block-styles' ); // Add support for full and wide align images. add_theme_support( 'align-wide' ); - // Add support for editor styles + // Add support for editor styles. add_theme_support( 'editor-styles' ); - // Enqueue editor styles + // Enqueue editor styles. add_editor_style( 'style-editor.css' ); - // Editor color palette + // Editor color palette. add_theme_support( 'editor-color-palette', array( array( - 'name' => esc_html__( 'Primary Color', 'twentynineteen' ), + 'name' => __( 'Primary Color', 'twentynineteen' ), 'slug' => 'primary', 'color' => twentynineteen_hsl_hex( 'default' === get_theme_mod( 'colorscheme' ) ? 199 : get_theme_mod( 'colorscheme_primary_hue', 199 ), 100, 33 ), ), ) ); - // Add support for responsive embedded content + // Add support for responsive embedded content. add_theme_support( 'responsive-embeds' ); } @@ -144,7 +153,7 @@ add_action( 'widgets_init', 'twentynineteen_widgets_init' ); * * Priority 0 to make it available to lower priority callbacks. * - * @global int $content_width + * @global int $content_width Content width. */ function twentynineteen_content_width() { // This variable is intended to be overruled from themes. @@ -165,18 +174,12 @@ function twentynineteen_scripts() { wp_enqueue_script( 'twentynineteen-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20151215', true ); if ( has_nav_menu( 'menu-1' ) ) { - wp_enqueue_script( 'twentynineteen-touch-navigation', get_theme_file_uri( '/js/touch-navigation.js' ), array(), '1.0', true ); - $l10n_skip_link_focus_fix['expand'] = __( 'Expand child menu', 'twentynineteen' ); - $l10n_skip_link_focus_fix['collapse'] = __( 'Collapse child menu', 'twentynineteen' ); - wp_localize_script( 'twentynineteen-skip-link-focus-fix', 'twentynineteenScreenReaderText', $l10n_skip_link_focus_fix ); + wp_enqueue_script( 'twentynineteen-priority-menu', get_theme_file_uri( '/js/priority-menu.js' ), array(), '1.0', true ); + wp_enqueue_script( 'twentynineteen-touch-navigation', get_theme_file_uri( '/js/touch-keyboard-navigation.js' ), array(), '1.0', true ); } wp_enqueue_style( 'twentynineteen-print-style', get_template_directory_uri() . '/print.css', array(), wp_get_theme()->get( 'Version' ), 'print' ); - if ( is_singular() && twentynineteen_can_show_post_thumbnail() ) { - wp_add_inline_style( 'twentynineteen-style', twentynineteen_header_featured_image_css() ); - } - if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } @@ -184,7 +187,7 @@ function twentynineteen_scripts() { add_action( 'wp_enqueue_scripts', 'twentynineteen_scripts' ); /** - * Enqueue supplemental block editor styles + * Enqueue supplemental block editor styles. */ function twentynineteen_editor_customizer_styles() { @@ -192,7 +195,7 @@ function twentynineteen_editor_customizer_styles() { if ( 'custom' === get_theme_mod( 'colorscheme' ) ) { // Include color patterns - require_once( get_parent_theme_file_path( '/inc/color-patterns.php' ) ); + require_once get_parent_theme_file_path( '/inc/color-patterns.php' ); wp_add_inline_style( 'twentynineteen-editor-customizer-styles', twentynineteen_custom_colors_css() ); } } @@ -203,12 +206,12 @@ add_action( 'enqueue_block_editor_assets', 'twentynineteen_editor_customizer_sty */ function twentynineteen_colors_css_wrap() { - // Only include custom colors in customizer or frontend - if ( ( ! is_customize_preview() && is_admin() ) || is_admin() ) { + // Only include custom colors in customizer or frontend. + if ( ( ! is_customize_preview() && 'default' === get_theme_mod( 'colorscheme', 'default' ) ) || is_admin() ) { return; } - require_once( get_parent_theme_file_path( '/inc/color-patterns.php' ) ); + require_once get_parent_theme_file_path( '/inc/color-patterns.php' ); if ( 'default' === get_theme_mod( 'colorscheme', 'default' ) ) { $primary_color = 199; @@ -220,7 +223,7 @@ function twentynineteen_colors_css_wrap() { ->
- +
@@ -31,9 +31,10 @@