From bf61e8ffbe5c7ae46e9c9168f98512173a4d9bbf Mon Sep 17 00:00:00 2001 From: Arnab Wahid Date: Wed, 27 Jun 2018 13:59:10 +0530 Subject: [PATCH 01/19] Bottom margin in image alignment As proposed in #1273, `margin-botom: 1.5em;` added to all three image alignment classes. tab line 178 inc/woocommerce.php tab line 61 inc/custom-header.php --- inc/custom-header.php | 6 +++--- inc/woocommerce.php | 2 +- sass/modules/_alignments.scss | 3 +++ style.css | 3 +++ 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/inc/custom-header.php b/inc/custom-header.php index a4c2a6c..39cb10b 100644 --- a/inc/custom-header.php +++ b/inc/custom-header.php @@ -56,9 +56,9 @@ if ( ! function_exists( '_s_header_style' ) ) : .site-description { position: absolute; clip: rect(1px, 1px, 1px, 1px); - } - .site-title a, diff --git a/inc/woocommerce.php b/inc/woocommerce.php index 6d6000e..a0d7018 100644 --- a/inc/woocommerce.php +++ b/inc/woocommerce.php @@ -175,7 +175,7 @@ if ( ! function_exists( '_s_woocommerce_wrapper_after' ) ) { * @return void */ function _s_woocommerce_wrapper_after() { - ?> + ?> Date: Tue, 27 Nov 2018 15:05:38 +0100 Subject: [PATCH 02/19] Punctuation in ordered list Harmonized punctuation in this ordered list. --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8c459ad..3d51c6e 100644 --- a/README.md +++ b/README.md @@ -34,11 +34,11 @@ If you want to set things up manually, download `_s` from GitHub. The first thin OR -1. Search for: `'_s'` and replace with: `'megatherium-is-awesome'` -2. Search for: `_s_` and replace with: `megatherium_is_awesome_` +1. Search for: `'_s'` and replace with: `'megatherium-is-awesome'`. +2. Search for: `_s_` and replace with: `megatherium_is_awesome_`. 3. Search for: `Text Domain: _s` and replace with: `Text Domain: megatherium-is-awesome` in `style.css`. -4. Search for:  _s and replace with:  Megatherium_is_Awesome -5. Search for: `_s-` and replace with: `megatherium-is-awesome-` +4. Search for:  _s and replace with:  Megatherium_is_Awesome. +5. Search for: `_s-` and replace with: `megatherium-is-awesome-`. Then, update the stylesheet header in `style.css`, the links in `footer.php` with your own information and rename `_s.pot` from `languages` folder to use the theme's slug. Next, update or delete this readme. From 8573a2a325b62adc653e2f406d7856da2aa70bb3 Mon Sep 17 00:00:00 2001 From: Danny Cooper Date: Thu, 28 Mar 2019 14:13:32 +0000 Subject: [PATCH 03/19] Add wp_body_open() shim for sites older than 5.2 --- header.php | 1 + inc/template-tags.php | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/header.php b/header.php index e5c99d7..0b9ec52 100644 --- a/header.php +++ b/header.php @@ -21,6 +21,7 @@ > +
diff --git a/inc/template-tags.php b/inc/template-tags.php index bc5fd31..652709e 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -146,3 +146,14 @@ if ( ! function_exists( '_s_post_thumbnail' ) ) : endif; // End is_singular(). } endif; + +if ( ! function_exists( 'wp_body_open' ) ) : + /** + * Shim for sites older than 5.2. + * + * @link https://core.trac.wordpress.org/ticket/12563 + */ + function wp_body_open() { + do_action( 'wp_body_open' ); + } +endif; From 72013c79c0a88088dd7b92ba85d572df50cf27cc Mon Sep 17 00:00:00 2001 From: Amit Dudhat Date: Thu, 5 Mar 2020 18:26:45 +0530 Subject: [PATCH 04/19] Update reference link URL & Fix Typo Error. --- inc/woocommerce.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/woocommerce.php b/inc/woocommerce.php index 6d6000e..2bc6ff9 100644 --- a/inc/woocommerce.php +++ b/inc/woocommerce.php @@ -11,7 +11,7 @@ * WooCommerce setup function. * * @link https://docs.woocommerce.com/document/third-party-custom-theme-compatibility/ - * @link https://github.com/woocommerce/woocommerce/wiki/Enabling-product-gallery-features-(zoom,-swipe,-lightbox)-in-3.0.0 + * @link https://github.com/woocommerce/woocommerce/wiki/Enabling-product-gallery-features-(zoom,-swipe,-lightbox) * * @return void */ @@ -81,7 +81,7 @@ function _s_woocommerce_products_per_page() { add_filter( 'loop_shop_per_page', '_s_woocommerce_products_per_page' ); /** - * Product gallery thumnbail columns. + * Product gallery thumbnail columns. * * @return integer number of columns. */ From d1bb60c04114562c59c9559c2d9158d59f86c6fd Mon Sep 17 00:00:00 2001 From: bmcculley Date: Thu, 25 Jul 2019 23:55:58 -0400 Subject: [PATCH 05/19] escape get_the_title use wp_kses_post function on get_the_title to prevent potential malicious issues. Add wp_body_open() shim for sites older than 5.2 Bottom margin in image alignment As proposed in #1273, `margin-botom: 1.5em;` added to all three image alignment classes. tab line 178 inc/woocommerce.php tab line 61 inc/custom-header.php update additional get_the_title instances switch from esc_html to wp_kses_post --- comments.php | 4 ++-- inc/template-tags.php | 4 ++-- template-parts/content-page.php | 2 +- template-parts/content.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/comments.php b/comments.php index 2c94bfd..adf9b15 100644 --- a/comments.php +++ b/comments.php @@ -33,14 +33,14 @@ if ( post_password_required() ) { printf( /* translators: 1: title. */ esc_html__( 'One thought on “%1$s”', '_s' ), - '' . get_the_title() . '' + '' . wp_kses_post( get_the_title() ) . '' ); } else { printf( // WPCS: XSS OK. /* translators: 1: comment count number, 2: title. */ esc_html( _nx( '%1$s thought on “%2$s”', '%1$s thoughts on “%2$s”', $_s_comment_count, 'comments title', '_s' ) ), number_format_i18n( $_s_comment_count ), - '' . get_the_title() . '' + '' . wp_kses_post( get_the_title() ) . '' ); } ?> diff --git a/inc/template-tags.php b/inc/template-tags.php index 652709e..3c7426a 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -86,7 +86,7 @@ if ( ! function_exists( '_s_entry_footer' ) ) : ), ) ), - get_the_title() + wp_kses_post( get_the_title() ) ) ); echo ''; @@ -103,7 +103,7 @@ if ( ! function_exists( '_s_entry_footer' ) ) : ), ) ), - get_the_title() + wp_kses_post( get_the_title() ) ), '', '' diff --git a/template-parts/content-page.php b/template-parts/content-page.php index b20eff0..7339a9c 100644 --- a/template-parts/content-page.php +++ b/template-parts/content-page.php @@ -41,7 +41,7 @@ ), ) ), - get_the_title() + wp_kses_post( get_the_title() ) ), '', '' diff --git a/template-parts/content.php b/template-parts/content.php index 0573e82..2e58962 100644 --- a/template-parts/content.php +++ b/template-parts/content.php @@ -43,7 +43,7 @@ ), ) ), - get_the_title() + wp_kses_post( get_the_title() ) ) ); wp_link_pages( array( From f94fc1e59b790906e14f1a1a55a38241240288f5 Mon Sep 17 00:00:00 2001 From: Ismail El Korchi Date: Sun, 5 Apr 2020 21:49:27 +0100 Subject: [PATCH 06/19] Fix PHP, CSS AND JS coding standards --- 404.php | 16 +++--- comments.php | 14 +++-- functions.php | 85 +++++++++++++++++----------- header.php | 12 ++-- inc/custom-header.php | 22 ++++--- inc/customizer.php | 22 ++++--- inc/jetpack.php | 46 ++++++++------- inc/template-tags.php | 36 +++++++----- inc/woocommerce.php | 2 +- js/customizer.js | 14 ++--- js/navigation.js | 11 ++-- js/skip-link-focus-fix.js | 2 +- sass/elements/_elements.scss | 14 +++-- sass/elements/_lists.scss | 5 +- sass/forms/_buttons.scss | 6 +- sass/forms/_forms.scss | 1 - sass/layout/_no-sidebar.scss | 1 + sass/media/_captions.scss | 1 + sass/media/_galleries.scss | 3 +- sass/mixins/_mixins-master.scss | 2 +- sass/modules/_accessibility.scss | 4 +- sass/modules/_alignments.scss | 2 + sass/modules/_clearings.scss | 38 +++++++------ sass/modules/_infinite-scroll.scss | 9 +-- sass/navigation/_links.scss | 3 + sass/navigation/_menus.scss | 3 + sass/shop/_checkout.scss | 3 + sass/shop/_components.scss | 48 +++++++++++----- sass/shop/_products.scss | 10 ++++ sass/shop/_single-product.scss | 13 ++++- sass/shop/_tables.scss | 23 ++++++-- sass/shop/_widgets.scss | 11 ++-- sass/site/primary/_comments.scss | 1 + sass/style.scss | 2 +- sass/typography/_copy.scss | 18 ++++-- sass/typography/_headings.scss | 7 ++- sass/typography/_typography.scss | 2 +- sass/variables-site/_colors.scss | 6 +- sass/variables-site/_typography.scss | 4 +- sass/woocommerce.scss | 2 +- template-parts/content-page.php | 10 ++-- template-parts/content.php | 36 ++++++------ 42 files changed, 357 insertions(+), 213 deletions(-) diff --git a/404.php b/404.php index 62c3e06..ba5d537 100644 --- a/404.php +++ b/404.php @@ -31,13 +31,15 @@ get_header();

    'count', - 'order' => 'DESC', - 'show_count' => 1, - 'title_li' => '', - 'number' => 10, - ) ); + wp_list_categories( + array( + 'orderby' => 'count', + 'order' => 'DESC', + 'show_count' => 1, + 'title_li' => '', + 'number' => 10, + ) + ); ?>
diff --git a/comments.php b/comments.php index adf9b15..364973f 100644 --- a/comments.php +++ b/comments.php @@ -36,10 +36,10 @@ if ( post_password_required() ) { '' . wp_kses_post( get_the_title() ) . '' ); } else { - printf( // WPCS: XSS OK. + printf( /* translators: 1: comment count number, 2: title. */ esc_html( _nx( '%1$s thought on “%2$s”', '%1$s thoughts on “%2$s”', $_s_comment_count, 'comments title', '_s' ) ), - number_format_i18n( $_s_comment_count ), + number_format_i18n( $_s_comment_count ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped '' . wp_kses_post( get_the_title() ) . '' ); } @@ -50,10 +50,12 @@ if ( post_password_required() ) {
    'ol', - 'short_ping' => true, - ) ); + wp_list_comments( + array( + 'style' => 'ol', + 'short_ping' => true, + ) + ); ?>
diff --git a/functions.php b/functions.php index b7134e7..c440ca4 100644 --- a/functions.php +++ b/functions.php @@ -7,6 +7,11 @@ * @package _s */ +if ( ! defined( '_S_VERSION' ) ) { + // Replace #.# with the version number of the theme on each release. + define( '_S_VERSION', '#.#' ); +} + if ( ! function_exists( '_s_setup' ) ) : /** * Sets up theme defaults and registers support for various WordPress features. @@ -43,27 +48,38 @@ if ( ! function_exists( '_s_setup' ) ) : add_theme_support( 'post-thumbnails' ); // This theme uses wp_nav_menu() in one location. - register_nav_menus( array( - 'menu-1' => esc_html__( 'Primary', '_s' ), - ) ); + register_nav_menus( + array( + 'menu-1' => esc_html__( 'Primary', '_s' ), + ) + ); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ - add_theme_support( 'html5', array( - 'search-form', - 'comment-form', - 'comment-list', - 'gallery', - 'caption', - ) ); + add_theme_support( + 'html5', + array( + 'search-form', + 'comment-form', + 'comment-list', + 'gallery', + 'caption', + ) + ); // Set up the WordPress core custom background feature. - add_theme_support( 'custom-background', apply_filters( '_s_custom_background_args', array( - 'default-color' => 'ffffff', - 'default-image' => '', - ) ) ); + add_theme_support( + 'custom-background', + apply_filters( + '_s_custom_background_args', + array( + 'default-color' => 'ffffff', + 'default-image' => '', + ) + ) + ); // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); @@ -73,12 +89,15 @@ if ( ! function_exists( '_s_setup' ) ) : * * @link https://codex.wordpress.org/Theme_Logo */ - add_theme_support( 'custom-logo', array( - 'height' => 250, - 'width' => 250, - 'flex-width' => true, - 'flex-height' => true, - ) ); + add_theme_support( + 'custom-logo', + array( + 'height' => 250, + 'width' => 250, + 'flex-width' => true, + 'flex-height' => true, + ) + ); } endif; add_action( 'after_setup_theme', '_s_setup' ); @@ -104,15 +123,17 @@ add_action( 'after_setup_theme', '_s_content_width', 0 ); * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function _s_widgets_init() { - register_sidebar( array( - 'name' => esc_html__( 'Sidebar', '_s' ), - 'id' => 'sidebar-1', - 'description' => esc_html__( 'Add widgets here.', '_s' ), - 'before_widget' => '
', - 'after_widget' => '
', - 'before_title' => '

', - 'after_title' => '

', - ) ); + register_sidebar( + array( + 'name' => esc_html__( 'Sidebar', '_s' ), + 'id' => 'sidebar-1', + 'description' => esc_html__( 'Add widgets here.', '_s' ), + 'before_widget' => '
', + 'after_widget' => '
', + 'before_title' => '

', + 'after_title' => '

', + ) + ); } add_action( 'widgets_init', '_s_widgets_init' ); @@ -120,11 +141,11 @@ add_action( 'widgets_init', '_s_widgets_init' ); * Enqueue scripts and styles. */ function _s_scripts() { - wp_enqueue_style( '_s-style', get_stylesheet_uri() ); + wp_enqueue_style( '_s-style', get_stylesheet_uri(), array(), _S_VERSION ); - wp_enqueue_script( '_s-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20151215', true ); + wp_enqueue_script( '_s-navigation', get_template_directory_uri() . '/js/navigation.js', array(), _S_VERSION, true ); - wp_enqueue_script( '_s-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20151215', true ); + wp_enqueue_script( '_s-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), _S_VERSION, true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); diff --git a/header.php b/header.php index 0b9ec52..527ab38 100644 --- a/header.php +++ b/header.php @@ -41,17 +41,19 @@ $_s_description = get_bloginfo( 'description', 'display' ); if ( $_s_description || is_customize_preview() ) : ?> -

+

diff --git a/inc/custom-header.php b/inc/custom-header.php index 39cb10b..5176f17 100644 --- a/inc/custom-header.php +++ b/inc/custom-header.php @@ -17,14 +17,20 @@ * @uses _s_header_style() */ function _s_custom_header_setup() { - add_theme_support( 'custom-header', apply_filters( '_s_custom_header_args', array( - 'default-image' => '', - 'default-text-color' => '000000', - 'width' => 1000, - 'height' => 250, - 'flex-height' => true, - 'wp-head-callback' => '_s_header_style', - ) ) ); + add_theme_support( + 'custom-header', + apply_filters( + '_s_custom_header_args', + array( + 'default-image' => '', + 'default-text-color' => '000000', + 'width' => 1000, + 'height' => 250, + 'flex-height' => true, + 'wp-head-callback' => '_s_header_style', + ) + ) + ); } add_action( 'after_setup_theme', '_s_custom_header_setup' ); diff --git a/inc/customizer.php b/inc/customizer.php index 190c3d9..10e277d 100644 --- a/inc/customizer.php +++ b/inc/customizer.php @@ -16,14 +16,20 @@ function _s_customize_register( $wp_customize ) { $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; if ( isset( $wp_customize->selective_refresh ) ) { - $wp_customize->selective_refresh->add_partial( 'blogname', array( - 'selector' => '.site-title a', - 'render_callback' => '_s_customize_partial_blogname', - ) ); - $wp_customize->selective_refresh->add_partial( 'blogdescription', array( - 'selector' => '.site-description', - 'render_callback' => '_s_customize_partial_blogdescription', - ) ); + $wp_customize->selective_refresh->add_partial( + 'blogname', + array( + 'selector' => '.site-title a', + 'render_callback' => '_s_customize_partial_blogname', + ) + ); + $wp_customize->selective_refresh->add_partial( + 'blogdescription', + array( + 'selector' => '.site-description', + 'render_callback' => '_s_customize_partial_blogdescription', + ) + ); } } add_action( 'customize_register', '_s_customize_register' ); diff --git a/inc/jetpack.php b/inc/jetpack.php index 3831099..2a82dfb 100644 --- a/inc/jetpack.php +++ b/inc/jetpack.php @@ -16,31 +16,37 @@ */ function _s_jetpack_setup() { // Add theme support for Infinite Scroll. - add_theme_support( 'infinite-scroll', array( - 'container' => 'main', - 'render' => '_s_infinite_scroll_render', - 'footer' => 'page', - ) ); + add_theme_support( + 'infinite-scroll', + array( + 'container' => 'main', + 'render' => '_s_infinite_scroll_render', + 'footer' => 'page', + ) + ); // Add theme support for Responsive Videos. add_theme_support( 'jetpack-responsive-videos' ); // Add theme support for Content Options. - add_theme_support( 'jetpack-content-options', array( - 'post-details' => array( - 'stylesheet' => '_s-style', - 'date' => '.posted-on', - 'categories' => '.cat-links', - 'tags' => '.tags-links', - 'author' => '.byline', - 'comment' => '.comments-link', - ), - 'featured-images' => array( - 'archive' => true, - 'post' => true, - 'page' => true, - ), - ) ); + add_theme_support( + 'jetpack-content-options', + array( + 'post-details' => array( + 'stylesheet' => '_s-style', + 'date' => '.posted-on', + 'categories' => '.cat-links', + 'tags' => '.tags-links', + 'author' => '.byline', + 'comment' => '.comments-link', + ), + 'featured-images' => array( + 'archive' => true, + 'post' => true, + 'page' => true, + ), + ) + ); } add_action( 'after_setup_theme', '_s_jetpack_setup' ); diff --git a/inc/template-tags.php b/inc/template-tags.php index 3c7426a..a9a1f1b 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -17,7 +17,8 @@ if ( ! function_exists( '_s_posted_on' ) ) : $time_string = ''; } - $time_string = sprintf( $time_string, + $time_string = sprintf( + $time_string, esc_attr( get_the_date( DATE_W3C ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( DATE_W3C ) ), @@ -30,7 +31,7 @@ if ( ! function_exists( '_s_posted_on' ) ) : '' . $time_string . '' ); - echo '' . $posted_on . ''; // WPCS: XSS OK. + echo '' . $posted_on . ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } endif; @@ -46,7 +47,7 @@ if ( ! function_exists( '_s_posted_by' ) ) : '' . esc_html( get_the_author() ) . '' ); - echo ''; // WPCS: XSS OK. + echo ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } endif; @@ -62,14 +63,14 @@ if ( ! function_exists( '_s_entry_footer' ) ) : $categories_list = get_the_category_list( esc_html__( ', ', '_s' ) ); if ( $categories_list ) { /* translators: 1: list of categories. */ - printf( '' . esc_html__( 'Posted in %1$s', '_s' ) . '', $categories_list ); // WPCS: XSS OK. + printf( '' . esc_html__( 'Posted in %1$s', '_s' ) . '', $categories_list ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /* translators: used between list items, there is a space after the comma */ $tags_list = get_the_tag_list( '', esc_html_x( ', ', 'list item separator', '_s' ) ); if ( $tags_list ) { /* translators: 1: list of tags. */ - printf( '' . esc_html__( 'Tagged %1$s', '_s' ) . '', $tags_list ); // WPCS: XSS OK. + printf( '' . esc_html__( 'Tagged %1$s', '_s' ) . '', $tags_list ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } @@ -132,17 +133,22 @@ if ( ! function_exists( '_s_post_thumbnail' ) ) : - + - plugin_url() . '/assets/fonts/'; $inline_font = '@font-face { diff --git a/js/customizer.js b/js/customizer.js index 757367a..94c739b 100644 --- a/js/customizer.js +++ b/js/customizer.js @@ -1,3 +1,4 @@ +/* global wp, jQuery */ /** * File customizer.js. * @@ -7,7 +8,6 @@ */ ( function( $ ) { - // Site title and description. wp.customize( 'blogname', function( value ) { value.bind( function( to ) { @@ -25,18 +25,18 @@ value.bind( function( to ) { if ( 'blank' === to ) { $( '.site-title, .site-description' ).css( { - 'clip': 'rect(1px, 1px, 1px, 1px)', - 'position': 'absolute' + clip: 'rect(1px, 1px, 1px, 1px)', + position: 'absolute', } ); } else { $( '.site-title, .site-description' ).css( { - 'clip': 'auto', - 'position': 'relative' + clip: 'auto', + position: 'relative', } ); $( '.site-title a, .site-description' ).css( { - 'color': to + color: to, } ); } } ); } ); -} )( jQuery ); +}( jQuery ) ); diff --git a/js/navigation.js b/js/navigation.js index 3ffa7cc..fa92651 100644 --- a/js/navigation.js +++ b/js/navigation.js @@ -43,7 +43,7 @@ }; // Get all the link elements within the menu. - links = menu.getElementsByTagName( 'a' ); + links = menu.getElementsByTagName( 'a' ); // Each time a menu link is focused or blurred, toggle focus. for ( i = 0, len = links.length; i < len; i++ ) { @@ -59,7 +59,6 @@ // Move up through the ancestors of the current link until we hit .nav-menu. while ( -1 === self.className.indexOf( 'nav-menu' ) ) { - // On li elements toggle the class .focus. if ( 'li' === self.tagName.toLowerCase() ) { if ( -1 !== self.className.indexOf( 'focus' ) ) { @@ -76,13 +75,13 @@ /** * Toggles `focus` class to allow submenu access on tablets. */ - ( function( container ) { - var touchStartFn, i, + ( function() { + var touchStartFn, parentLink = container.querySelectorAll( '.menu-item-has-children > a, .page_item_has_children > a' ); if ( 'ontouchstart' in window ) { touchStartFn = function( e ) { - var menuItem = this.parentNode, i; + var menuItem = this.parentNode; if ( ! menuItem.classList.contains( 'focus' ) ) { e.preventDefault(); @@ -103,4 +102,4 @@ } } }( container ) ); -} )(); +}() ); diff --git a/js/skip-link-focus-fix.js b/js/skip-link-focus-fix.js index 0037752..bf9367e 100644 --- a/js/skip-link-focus-fix.js +++ b/js/skip-link-focus-fix.js @@ -28,4 +28,4 @@ } }, false ); } -} )(); +}() ); diff --git a/sass/elements/_elements.scss b/sass/elements/_elements.scss index 2f68814..cf93249 100644 --- a/sass/elements/_elements.scss +++ b/sass/elements/_elements.scss @@ -1,11 +1,13 @@ -html { - box-sizing: border-box; +/* Inherit box-sizing to more easily change it's value on a component level. +@link http://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ */ +*, +*::before, +*::after { + box-sizing: inherit; } -*, -*:before, -*:after { /* Inherit box-sizing to make it easier to change the property for components that leverage other behavior; see https://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ */ - box-sizing: inherit; +html { + box-sizing: border-box; } body { diff --git a/sass/elements/_lists.scss b/sass/elements/_lists.scss index fcda0c1..f126366 100644 --- a/sass/elements/_lists.scss +++ b/sass/elements/_lists.scss @@ -1,4 +1,5 @@ -ul, ol { +ul, +ol { margin: 0 0 1.5em 3em; } @@ -17,7 +18,7 @@ li > ol { } dt { - font-weight: bold; + font-weight: 700; } dd { diff --git a/sass/forms/_buttons.scss b/sass/forms/_buttons.scss index cc54f95..cdd89c3 100644 --- a/sass/forms/_buttons.scss +++ b/sass/forms/_buttons.scss @@ -6,10 +6,12 @@ input[type="submit"] { border-color: $color__border-button; border-radius: 3px; background: $color__background-button; - color: rgba(0, 0, 0, .8); + color: rgba(0, 0, 0, 0.8); + @include font-size(0.75); + line-height: 1; - padding: .6em 1em .4em; + padding: 0.6em 1em 0.4em; &:hover { border-color: $color__border-button-hover; diff --git a/sass/forms/_forms.scss b/sass/forms/_forms.scss index 2036ef9..94fd5bd 100644 --- a/sass/forms/_forms.scss +++ b/sass/forms/_forms.scss @@ -1,3 +1,2 @@ @import "buttons"; - @import "fields"; diff --git a/sass/layout/_no-sidebar.scss b/sass/layout/_no-sidebar.scss index ae44e48..07cce07 100644 --- a/sass/layout/_no-sidebar.scss +++ b/sass/layout/_no-sidebar.scss @@ -1,4 +1,5 @@ .no-sidebar { + .content-area { float: none; margin-left: auto; diff --git a/sass/media/_captions.scss b/sass/media/_captions.scss index c299bfe..1f7f60c 100644 --- a/sass/media/_captions.scss +++ b/sass/media/_captions.scss @@ -3,6 +3,7 @@ max-width: 100%; img[class*="wp-image-"] { + @include center-block; } diff --git a/sass/media/_galleries.scss b/sass/media/_galleries.scss index c1773b8..f42aa46 100644 --- a/sass/media/_galleries.scss +++ b/sass/media/_galleries.scss @@ -10,8 +10,9 @@ // Loops to enumerate the classes for gallery columns. @for $i from 2 through 9 { + .gallery-columns-#{$i} & { - max-width: map-get( $columns, $i ); + max-width: map-get($columns, $i); } } } diff --git a/sass/mixins/_mixins-master.scss b/sass/mixins/_mixins-master.scss index 2578a21..54ff533 100644 --- a/sass/mixins/_mixins-master.scss +++ b/sass/mixins/_mixins-master.scss @@ -25,5 +25,5 @@ // Column width with margin @mixin column-width($numberColumns: 3) { - width: map-get( $columns, $numberColumns ) - ( ( $columns__margin * ( $numberColumns - 1 ) ) / $numberColumns ); + width: map-get($columns, $numberColumns) - ( ( $columns__margin * ( $numberColumns - 1 ) ) / $numberColumns ); } diff --git a/sass/modules/_accessibility.scss b/sass/modules/_accessibility.scss index 469887c..1361788 100644 --- a/sass/modules/_accessibility.scss +++ b/sass/modules/_accessibility.scss @@ -19,8 +19,10 @@ clip-path: none; color: $color__text-screen; display: block; + @include font-size(0.875); - font-weight: bold; + + font-weight: 700; height: auto; left: 5px; line-height: normal; diff --git a/sass/modules/_alignments.scss b/sass/modules/_alignments.scss index 853df28..c74338d 100644 --- a/sass/modules/_alignments.scss +++ b/sass/modules/_alignments.scss @@ -14,6 +14,8 @@ .aligncenter { clear: both; + @include center-block; + margin-bottom: 1.5em; } diff --git a/sass/modules/_clearings.scss b/sass/modules/_clearings.scss index 444b6b6..facc093 100644 --- a/sass/modules/_clearings.scss +++ b/sass/modules/_clearings.scss @@ -1,23 +1,25 @@ -.clear:before, -.clear:after, -.entry-content:before, -.entry-content:after, -.comment-content:before, -.comment-content:after, -.site-header:before, -.site-header:after, -.site-content:before, -.site-content:after, -.site-footer:before, -.site-footer:after { +.clear::before, +.clear::after, +.entry-content::before, +.entry-content::after, +.comment-content::before, +.comment-content::after, +.site-header::before, +.site-header::after, +.site-content::before, +.site-content::after, +.site-footer::before, +.site-footer::after { + @include clearfix; } -.clear:after, -.entry-content:after, -.comment-content:after, -.site-header:after, -.site-content:after, -.site-footer:after { +.clear::after, +.entry-content::after, +.comment-content::after, +.site-header::after, +.site-content::after, +.site-footer::after { + @include clearfix-after; } diff --git a/sass/modules/_infinite-scroll.scss b/sass/modules/_infinite-scroll.scss index 1172137..87a7986 100644 --- a/sass/modules/_infinite-scroll.scss +++ b/sass/modules/_infinite-scroll.scss @@ -1,10 +1,11 @@ -/* Globally hidden elements when Infinite Scroll is supported and in use. */ -.infinite-scroll .posts-navigation, /* Older / Newer Posts Navigation (always hidden) */ -.infinite-scroll.neverending .site-footer { /* Theme Footer (when set to scrolling) */ +/* Hide the Older / Newer Posts Navigation when Infinite Scroll is in use. */ +.infinite-scroll .posts-navigation, +/* Hide the Theme Footer (when set to scrolling) */ +.infinite-scroll.neverending .site-footer { display: none; } -/* When Infinite Scroll has reached its end we need to re-display elements that were hidden (via .neverending) before. */ +/* Re-display the Theme Footer when Infinite Scroll has reached its end. */ .infinity-end.neverending .site-footer { display: block; } diff --git a/sass/navigation/_links.scss b/sass/navigation/_links.scss index 95a5b4d..2e59a07 100644 --- a/sass/navigation/_links.scss +++ b/sass/navigation/_links.scss @@ -4,14 +4,17 @@ a { &:visited { color: $color__link-visited; } + &:hover, &:focus, &:active { color: $color__link-hover; } + &:focus { outline: thin dotted; } + &:hover, &:active { outline: 0; diff --git a/sass/navigation/_menus.scss b/sass/navigation/_menus.scss index 1a2b040..d88b0a6 100644 --- a/sass/navigation/_menus.scss +++ b/sass/navigation/_menus.scss @@ -24,6 +24,7 @@ } li { + &:hover > ul, &.focus > ul { left: 100%; @@ -77,9 +78,11 @@ } @media screen and (min-width: 37.5em) { + .menu-toggle { display: none; } + .main-navigation ul { display: block; } diff --git a/sass/shop/_checkout.scss b/sass/shop/_checkout.scss index 3aebbcc..fbd8d4a 100644 --- a/sass/shop/_checkout.scss +++ b/sass/shop/_checkout.scss @@ -2,7 +2,9 @@ * Checkout */ @media screen and (min-width: 768px) { + .col2-set { + .form-row-first { float: left; margin-right: $columns__margin; @@ -15,6 +17,7 @@ .form-row-first, .form-row-last { + @include column-width(2); } } diff --git a/sass/shop/_components.scss b/sass/shop/_components.scss index 996116a..9a4633d 100644 --- a/sass/shop/_components.scss +++ b/sass/shop/_components.scss @@ -5,6 +5,7 @@ position: relative; margin: 0; padding: 0; + @include clearfix; .cart-contents { @@ -31,12 +32,12 @@ line-height: 1.618; font-size: 1em; width: 5.3em; - font-family: 'star'; + font-family: star; font-weight: 400; - &:before { + &::before { content: "\53\53\53\53\53"; - opacity: .25; + opacity: 0.25; float: left; top: 0; left: 0; @@ -52,7 +53,7 @@ padding-top: 1.5em; } - span:before { + span::before { content: "\53\53\53\53\53"; top: 0; position: absolute; @@ -62,6 +63,7 @@ } p.stars { + a { position: relative; height: 1em; @@ -72,7 +74,8 @@ p.stars { margin-right: 1px; font-weight: 400; - &:before { + &::before { + display: block; position: absolute; top: 0; @@ -80,25 +83,28 @@ p.stars { width: 1em; height: 1em; line-height: 1; - font-family: "star"; + font-family: star; content: "\53"; color: $color__text-main; text-indent: 0; - opacity: .25; + opacity: 0.25; } &:hover { - ~ a:before { + + ~ a::before { content: "\53"; color: $color__text-main; - opacity: .25; + opacity: 0.25; } } } &:hover { + a { - &:before { + + &::before { content: "\53"; color: $color__link; opacity: 1; @@ -107,22 +113,25 @@ p.stars { } &.selected { + a.active { - &:before { + + &::before { content: "\53"; color: $color__link; opacity: 1; } - ~ a:before { + ~ a::before { content: "\53"; color: $color__text-main; - opacity: .25; + opacity: 0.25; } } a:not(.active) { - &:before { + + &::before { content: "\53"; color: $color__link; opacity: 1; @@ -135,6 +144,7 @@ p.stars { * Tabs */ .woocommerce-tabs { + ul.tabs { list-style: none; margin: 0; @@ -154,6 +164,7 @@ p.stars { } .panel { + h2:first-of-type { margin-bottom: 1em; } @@ -187,13 +198,16 @@ p.stars { * Forms */ .form-row { + &.woocommerce-validated { + input.input-text { box-shadow: inset 2px 0 0 $woocommerce__color-success; } } &.woocommerce-invalid { + input.input-text { box-shadow: inset 2px 0 0 $woocommerce__color-error; } @@ -201,7 +215,7 @@ p.stars { } .required { - color: red; + color: #f00; } /** @@ -212,6 +226,7 @@ p.stars { .woocommerce-error, .woocommerce-noreviews, p.no-comments { + @include clearfix; background-color: $woocommerce__color-success; clear: both; @@ -239,10 +254,12 @@ p.no-comments { } @media screen and (min-width: 48em) { + /** * Header cart */ .site-header-cart { + .widget_shopping_cart { position: absolute; top: 100%; @@ -255,6 +272,7 @@ p.no-comments { &:hover, &.focus { + .widget_shopping_cart { left: 0; display: block; diff --git a/sass/shop/_products.scss b/sass/shop/_products.scss index 3d4dd98..ddbe13c 100644 --- a/sass/shop/_products.scss +++ b/sass/shop/_products.scss @@ -2,6 +2,7 @@ * Products */ ul.products { + @include clearfix; margin: 0; padding: 0; @@ -26,8 +27,11 @@ ul.products { } @media screen and (min-width: 48em) { + ul.products { + li.product { + @include column-width(3); float: left; margin-right: $columns__margin; @@ -43,7 +47,9 @@ ul.products { } .columns-1 { + ul.products { + li.product { float: none; width: 100%; @@ -52,9 +58,13 @@ ul.products { } @for $i from 2 through 6 { + .columns-#{$i} { + ul.products { + li.product { + @include column-width( $i ); } } diff --git a/sass/shop/_single-product.scss b/sass/shop/_single-product.scss index 7c0fe1c..db1e723 100644 --- a/sass/shop/_single-product.scss +++ b/sass/shop/_single-product.scss @@ -2,7 +2,9 @@ * Single Product */ .single-product { + div.product { + @include clearfix; position: relative; @@ -22,6 +24,7 @@ } .flex-control-thumbs { + @include clearfix; margin: 0; padding: 0; @@ -32,7 +35,7 @@ float: left; img { - opacity: .5; + opacity: 0.5; &.flex-active { opacity: 1; @@ -40,6 +43,7 @@ } &:hover { + img { opacity: 1; } @@ -48,9 +52,13 @@ } @for $i from 2 through 5 { + &.woocommerce-product-gallery--columns-#{$i} { + .flex-control-thumbs { + li { + @include column-width($i); &:nth-child(#{$i}n) { @@ -69,7 +77,8 @@ } .stock { - &:empty:before { + + &:empty::before { display: none; } diff --git a/sass/shop/_tables.scss b/sass/shop/_tables.scss index 0b28281..7b76cee 100644 --- a/sass/shop/_tables.scss +++ b/sass/shop/_tables.scss @@ -2,45 +2,51 @@ * Shop tables */ table.shop_table_responsive { + thead { display: none; } tbody { + th { display: none; } } tr { + td { display: block; text-align: right; clear: both; - &:before { - content: attr(data-title) ': '; + &::before { + content: attr(data-title) ": "; float: left; } &.product-remove { + a { text-align: left; } - &:before { + &::before { display: none; } } &.actions, &.download-actions { - &:before { + + &::before { display: none; } } &.download-actions { + .button { display: block; text-align: center; @@ -51,26 +57,31 @@ table.shop_table_responsive { } @media screen and (min-width: 48em) { + table.shop_table_responsive { + thead { display: table-header-group; } tbody { + th { display: table-cell; } } tr { - th, td { + + th, + td { text-align: left; } td { display: table-cell; - &:before { + &::before { display: none; } } diff --git a/sass/shop/_widgets.scss b/sass/shop/_widgets.scss index 63324b2..2336d79 100644 --- a/sass/shop/_widgets.scss +++ b/sass/shop/_widgets.scss @@ -2,13 +2,14 @@ * WooCommerce Price Filter */ .widget_price_filter { + .price_slider { margin-bottom: 1.5em; } .price_slider_amount { text-align: right; - line-height: 2.4em; + line-height: 2.4; .button { float: left; @@ -29,7 +30,7 @@ outline: none; background: $color__link; box-sizing: border-box; - margin-top: -.25em; + margin-top: -0.25em; opacity: 1; &:last-child { @@ -38,7 +39,7 @@ &:hover, &.ui-state-active { - box-shadow: 0 0 0 .25em rgba(#000, 0.1); + box-shadow: 0 0 0 0.25em rgba(#000, 0.1); } } @@ -51,11 +52,11 @@ } .price_slider_wrapper .ui-widget-content { - background: rgba(0,0,0,0.1); + background: rgba(0, 0, 0, 0.1); } .ui-slider-horizontal { - height: .5em; + height: 0.5em; } .ui-slider-horizontal .ui-slider-range { diff --git a/sass/site/primary/_comments.scss b/sass/site/primary/_comments.scss index 13760c5..df8485a 100644 --- a/sass/site/primary/_comments.scss +++ b/sass/site/primary/_comments.scss @@ -1,6 +1,7 @@ .comment-content a { word-wrap: break-word; } + .bypostauthor { display: block; } diff --git a/sass/style.scss b/sass/style.scss index 1d5190d..e3fd9d7 100644 --- a/sass/style.scss +++ b/sass/style.scss @@ -11,7 +11,7 @@ Text Domain: _s Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready This theme, like WordPress, is licensed under the GPL. -Use it to make something cool, have fun, and share what you've learned with others. +Use it to make something cool, have fun, and share what you've learned. _s is based on Underscores https://underscores.me/, (C) 2012-2017 Automattic, Inc. Underscores is distributed under the terms of the GNU GPL v2 or later. diff --git a/sass/typography/_copy.scss b/sass/typography/_copy.scss index db7411f..31b11f4 100644 --- a/sass/typography/_copy.scss +++ b/sass/typography/_copy.scss @@ -2,7 +2,10 @@ p { margin-bottom: 1.5em; } -dfn, cite, em, i { +dfn, +cite, +em, +i { font-style: italic; } @@ -17,6 +20,7 @@ address { pre { background: $color__background-pre; font-family: $font__pre; + @include font-size(0.9375); line-height: $font__line-height-pre; margin-bottom: 1.6em; @@ -25,17 +29,23 @@ pre { padding: 1.6em; } -code, kbd, tt, var { +code, +kbd, +tt, +var { font-family: $font__code; + @include font-size(0.9375); } -abbr, acronym { +abbr, +acronym { border-bottom: 1px dotted $color__border-abbr; cursor: help; } -mark, ins { +mark, +ins { background: $color__background-ins; text-decoration: none; } diff --git a/sass/typography/_headings.scss b/sass/typography/_headings.scss index 8333692..2c41a74 100644 --- a/sass/typography/_headings.scss +++ b/sass/typography/_headings.scss @@ -1,3 +1,8 @@ -h1, h2, h3, h4, h5, h6 { +h1, +h2, +h3, +h4, +h5, +h6 { clear: both; } diff --git a/sass/typography/_typography.scss b/sass/typography/_typography.scss index b25e6cc..db6f863 100644 --- a/sass/typography/_typography.scss +++ b/sass/typography/_typography.scss @@ -6,10 +6,10 @@ optgroup, textarea { color: $color__text-main; font-family: $font__main; + @include font-size(1); line-height: $font__line-height-body; } @import "headings"; - @import "copy"; diff --git a/sass/variables-site/_colors.scss b/sass/variables-site/_colors.scss index f2dba39..3b9e719 100644 --- a/sass/variables-site/_colors.scss +++ b/sass/variables-site/_colors.scss @@ -8,9 +8,9 @@ $color__background-ins: #fff9c0; $color__text-screen: #21759b; $color__text-input: #666; $color__text-input-focus: #111; -$color__link: royalblue; -$color__link-visited: purple; -$color__link-hover: midnightblue; +$color__link: #4169e1; //royalblue +$color__link-visited: #800080; //purple +$color__link-hover: #191970; //midnightblue $color__text-main: #404040; $color__border-button: #ccc #ccc #bbb; diff --git a/sass/variables-site/_typography.scss b/sass/variables-site/_typography.scss index 302891e..324432f 100644 --- a/sass/variables-site/_typography.scss +++ b/sass/variables-site/_typography.scss @@ -1,5 +1,5 @@ $font__main: sans-serif; -$font__code: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; -$font__pre: "Courier 10 Pitch", Courier, monospace; +$font__code: monaco, consolas, "Andale Mono", "DejaVu Sans Mono", monospace; +$font__pre: "Courier 10 Pitch", courier, monospace; $font__line-height-body: 1.5; $font__line-height-pre: 1.6; diff --git a/sass/woocommerce.scss b/sass/woocommerce.scss index e8b987e..80bc742 100644 --- a/sass/woocommerce.scss +++ b/sass/woocommerce.scss @@ -9,7 +9,7 @@ WooCommerce styles override */ $woocommerce__color-error: #e2401c; $woocommerce__color-success: #0f834d; -$woocommerce__color-info: #3D9CD2; +$woocommerce__color-info: #3d9cd2; /** * Imports diff --git a/template-parts/content-page.php b/template-parts/content-page.php index 7339a9c..3d34fc3 100644 --- a/template-parts/content-page.php +++ b/template-parts/content-page.php @@ -20,10 +20,12 @@ '', - ) ); + wp_link_pages( + array( + 'before' => '', + ) + ); ?> diff --git a/template-parts/content.php b/template-parts/content.php index 2e58962..4f7ee77 100644 --- a/template-parts/content.php +++ b/template-parts/content.php @@ -33,23 +33,27 @@
"%s"', '_s' ), - array( - 'span' => array( - 'class' => array(), - ), - ) - ), - wp_kses_post( get_the_title() ) - ) ); + the_content( + sprintf( + wp_kses( + /* translators: %s: Name of current post. Only visible to screen readers */ + __( 'Continue reading "%s"', '_s' ), + array( + 'span' => array( + 'class' => array(), + ), + ) + ), + wp_kses_post( get_the_title() ) + ) + ); - wp_link_pages( array( - 'before' => '', - ) ); + wp_link_pages( + array( + 'before' => '', + ) + ); ?>
From d4ef6775d137592618d81cc01e6dd3d31541bda8 Mon Sep 17 00:00:00 2001 From: Ismail El Korchi Date: Mon, 6 Apr 2020 22:26:57 +0100 Subject: [PATCH 07/19] Add instruction to replace the _S_VERSION in the readme file --- README.md | 2 ++ functions.php | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3d51c6e..624e244 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ If you want to set things up manually, download `_s` from GitHub. The first thin 3. Search for `Text Domain: _s` in `style.css`. 4. Search for  _s (with a space before it) to capture DocBlocks. 5. Search for `_s-` to capture prefixed handles. +6. Search for `_S_` (in uppercase) to capture constants. OR @@ -39,6 +40,7 @@ OR 3. Search for: `Text Domain: _s` and replace with: `Text Domain: megatherium-is-awesome` in `style.css`. 4. Search for:  _s and replace with:  Megatherium_is_Awesome. 5. Search for: `_s-` and replace with: `megatherium-is-awesome-`. +6. Search for: `_S_` and replace with: `MEGATHERIUM_IS_AWESOME_`. Then, update the stylesheet header in `style.css`, the links in `footer.php` with your own information and rename `_s.pot` from `languages` folder to use the theme's slug. Next, update or delete this readme. diff --git a/functions.php b/functions.php index c440ca4..32d2dcc 100644 --- a/functions.php +++ b/functions.php @@ -8,8 +8,8 @@ */ if ( ! defined( '_S_VERSION' ) ) { - // Replace #.# with the version number of the theme on each release. - define( '_S_VERSION', '#.#' ); + // Replace the version number of the theme on each release. + define( '_S_VERSION', '1.0.0' ); } if ( ! function_exists( '_s_setup' ) ) : From f1e2c8dc0872cf401a005f66889276f422003e06 Mon Sep 17 00:00:00 2001 From: Ali Husnain Arshad Date: Tue, 7 Apr 2020 18:39:37 +0500 Subject: [PATCH 08/19] Updated Credits Year of Automattic from 2017 to 2020 --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 55559d1..5b1c18c 100644 --- a/readme.txt +++ b/readme.txt @@ -34,5 +34,5 @@ _s includes support for Infinite Scroll in Jetpack. == Credits == -* Based on Underscores https://underscores.me/, (C) 2012-2017 Automattic, Inc., [GPLv2 or later](https://www.gnu.org/licenses/gpl-2.0.html) +* Based on Underscores https://underscores.me/, (C) 2012-2020 Automattic, Inc., [GPLv2 or later](https://www.gnu.org/licenses/gpl-2.0.html) * normalize.css https://necolas.github.io/normalize.css/, (C) 2012-2016 Nicolas Gallagher and Jonathan Neal, [MIT](https://opensource.org/licenses/MIT) From cfdbdfc5343c9149ae7d094c580fa825ea2be103 Mon Sep 17 00:00:00 2001 From: Ismail El Korchi Date: Mon, 30 Mar 2020 18:40:16 +0100 Subject: [PATCH 09/19] Add composer.json and package.json for linting with Travis --- .eslintrc | 8 +++ .gitignore | 4 ++ .jscsrc | 7 --- .jshintignore | 1 - .stylelintrc.json | 12 +++++ .travis.yml | 129 +++++++++++++++++++--------------------------- composer.json | 33 ++++++++++++ package.json | 26 ++++++++++ phpcs.xml.dist | 56 ++++++-------------- 9 files changed, 152 insertions(+), 124 deletions(-) create mode 100644 .eslintrc create mode 100644 .gitignore delete mode 100644 .jscsrc delete mode 100644 .jshintignore create mode 100644 .stylelintrc.json create mode 100644 composer.json create mode 100644 package.json diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..961aa9c --- /dev/null +++ b/.eslintrc @@ -0,0 +1,8 @@ +{ + "extends": [ + "plugin:@wordpress/eslint-plugin/es5" + ], + "env": { + "browser": true + } +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fff7c8f --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/node_modules +/vendor +package-lock.json +composer.lock diff --git a/.jscsrc b/.jscsrc deleted file mode 100644 index edf97ac..0000000 --- a/.jscsrc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "preset": "wordpress", - "fileExtensions": [ ".js" ], - "excludeFiles": [ - "js/**.min.js" - ] -} diff --git a/.jshintignore b/.jshintignore deleted file mode 100644 index eef19b5..0000000 --- a/.jshintignore +++ /dev/null @@ -1 +0,0 @@ -js/**.min.js diff --git a/.stylelintrc.json b/.stylelintrc.json new file mode 100644 index 0000000..1927566 --- /dev/null +++ b/.stylelintrc.json @@ -0,0 +1,12 @@ +{ + "extends": [ + "stylelint-config-wordpress/scss" + ], + "ignoreFiles": [ + "sass/_normalize.scss" + ], + "rules": { + "font-family-no-missing-generic-family-keyword": null, + "no-descending-specificity": null + } +} diff --git a/.travis.yml b/.travis.yml index 4840c9f..61cc0a3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,92 +4,67 @@ # For use with the Underscores WordPress theme. # @link https://github.com/Automattic/_s -# Ditch sudo and use containers. -# @link https://docs.travis-ci.com/user/migrating-from-legacy/#Why-migrate-to-container-based-infrastructure%3F -# @link https://docs.travis-ci.com/user/workers/container-based-infrastructure/#Routing-your-build-to-container-based-infrastructure -sudo: false +# Tell Travis CI which distro to use. dist: trusty +# Cache directories between builds. +# @link https://docs.travis-ci.com/user/caching/#arbitrary-directories +cache: + directories: + # Cache directory for npm. + - $HOME/.npm + # Cache directory for older Composer versions. + - $HOME/.composer/cache/files + # Cache directory for more recent Composer versions. + - $HOME/.cache/composer/files + # Declare project language. -# @link https://about.travis-ci.org/docs/user/languages/php/ -language: php +# @link https://docs.travis-ci.com/user/languages/php/ +language: + - php + +php: + - 5.6 + - 7.0 + - 7.1 + - 7.2 + - 7.3 -# Declare versions of PHP to use. Use one decimal max. -# @link https://docs.travis-ci.com/user/build-configuration/ matrix: - fast_finish: true + fast_finish: true + include: + - php: 7.4 + env: SNIFF=1 - include: - # Current $required_php_version for WordPress: 5.2.4 - # aliased to 5.2.17 - - php: '5.2' - dist: precise - # aliased to a recent 5.6.x version - - php: '5.6' - env: SNIFF=1 - # aliased to a recent 7.0.x version - - php: '7.0' - # aliased to a recent 7.2.x version - - php: '7.2' - # bleeding edge PHP - - php: 'nightly' +before_install: + # Speed up build time by disabling Xdebug. + - phpenv config-rm xdebug.ini || echo 'No xdebug config.' + # Download and install the latest long-term support release of node. + - nvm install --lts + # Install Composer dependencies. + - composer install + # Install NPM dependencies. + - npm install - allow_failures: - - php: 'nightly' - -# Use this to prepare the system to install prerequisites or dependencies. -# e.g. sudo apt-get update. -# Failures in this section will result in build status 'errored'. -# before_install: - -# Use this to prepare your build for testing. -# e.g. copy database configurations, environment variables, etc. -# Failures in this section will result in build status 'errored'. -before_script: - # Speed up build time by disabling Xdebug. - - phpenv config-rm xdebug.ini || echo 'No xdebug config.' - # Set up temporary paths. - - export PHPCS_DIR=/tmp/phpcs - - export WPCS_DIR=/tmp/wpcs - - export PHPCOMPAT_DIR=/tmp/phpcompatibility - # Install CodeSniffer for WordPress Coding Standards checks. - - if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/squizlabs/PHP_CodeSniffer.git $PHPCS_DIR; fi - # Install WordPress Coding Standards. - - if [[ "$SNIFF" == "1" ]]; then git clone -b 0.14.1 --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git $WPCS_DIR; fi - # Install PHP Compatibility sniffs. - - if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/wimg/PHPCompatibility.git $PHPCOMPAT_DIR; fi - # Set install path for PHPCS sniffs. - # @link https://github.com/squizlabs/PHP_CodeSniffer/blob/4237c2fc98cc838730b76ee9cee316f99286a2a7/CodeSniffer.php#L1941 - - if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/bin/phpcs --config-set installed_paths $WPCS_DIR,$PHPCOMPAT_DIR; fi - # After CodeSniffer install you should refresh your path. - - if [[ "$SNIFF" == "1" ]]; then phpenv rehash; fi - # Install JSCS: JavaScript Code Style checker. - # @link http://jscs.info/ - - if [[ "$SNIFF" == "1" ]]; then npm install -g jscs; fi - # Install JSHint, a JavaScript Code Quality Tool. - # @link http://jshint.com/docs/ - - if [[ "$SNIFF" == "1" ]]; then npm install -g jshint; fi - # Pull in the WP Core jshint rules. - - if [[ "$SNIFF" == "1" ]]; then wget https://develop.svn.wordpress.org/trunk/.jshintrc; fi - -# Run test script commands. -# Default is specific to project language. -# All commands must exit with code 0 on success. Anything else is considered failure. script: - # Search for PHP syntax errors. - - find -L . -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l - # Run the theme through JSHint. - - if [[ "$SNIFF" == "1" ]]; then jshint .; fi - # Run the theme through JavaScript Code Style checker. - - if [[ "$SNIFF" == "1" ]]; then jscs .; fi - # WordPress Coding Standards. - # @link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards - # @link https://pear.php.net/package/PHP_CodeSniffer/ - # Uses a custom ruleset based on WordPress. This ruleset is automatically - # picked up by PHPCS as it's named `phpcs.xml(.dist)`. - - if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/bin/phpcs --runtime-set ignore_warnings_on_exit 1; fi + # Validate the composer.json file. + # @link https://getcomposer.org/doc/03-cli.md#validate + - composer validate --no-check-all --strict + + # Search for PHP syntax errors using PHP Parallel Lint. + # https://github.com/php-parallel-lint/PHP-Parallel-Lint + - composer lint:php + + # Check the PHP files with the coding standards documented in the phpcs.xml.dist file. + - if [[ "$SNIFF" == 1 ]]; then composer lint:wpcs; fi + + # Check the JS files with the lint-js script defined in the @wordpress/scripts package. + - if [[ "$SNIFF" == 1 ]]; then npm run lint:js; fi + + # Check the SCSS files with the lint-style script defined in the @wordpress/scripts package. + - if [[ "$SNIFF" == 1 ]]; then npm run lint:scss; fi # Receive notifications for build results. -# @link https://docs.travis-ci.com/user/notifications/#Email-notifications +# @link https://docs.travis-ci.com/user/notifications/#configuring-email-notifications notifications: email: false diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..2199d47 --- /dev/null +++ b/composer.json @@ -0,0 +1,33 @@ +{ + "name": "automattic/underscores", + "type": "wordpress-theme", + "description": "Hi. I'm a starter theme called _s, or underscores, if you like. I'm a theme meant for hacking so don't use me as a Parent Theme. Instead try turning me into the next, most awesome, WordPress theme out there. That's what I'm here for.", + "keywords": [ + "WordPress", + "Themes" + ], + "homepage": "https://github.com/Automattic/_s", + "license": "GPL-2.0-or-later", + "authors": [ + { + "name": "Contributors", + "homepage": "https://github.com/Automattic/_s/graphs/contributors" + } + ], + "require": { + "php": ">=5.6" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2", + "wptrt/wpthemereview": "^0.2.1", + "php-parallel-lint/php-parallel-lint": "^1.1.0" + }, + "scripts": { + "lint:wpcs": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --runtime-set testVersion 5.6-", + "lint:php": "@php ./vendor/bin/parallel-lint --exclude .git --exclude vendor ." + }, + "support": { + "issues": "https://github.com/Automattic/_s/issues", + "source": "https://github.com/Automattic/_s" + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..7465b0c --- /dev/null +++ b/package.json @@ -0,0 +1,26 @@ +{ + "name": "underscores", + "version": "1.0.0", + "description": "Hi. I'm a starter theme called _s, or underscores, if you like. I'm a theme meant for hacking so don't use me as a Parent Theme. Instead try turning me into the next, most awesome, WordPress theme out there. That's what I'm here for.", + "author": "Automattic Theme Team", + "license": "GPL-2.0-or-later", + "keywords": [ + "WordPress", + "Theme" + ], + "homepage": "https://github.com/Automattic/_s#readme", + "repository": { + "type": "git", + "url": "git+https://github.com/Automattic/_s.git" + }, + "bugs": { + "url": "https://github.com/Automattic/_s/issues" + }, + "devDependencies": { + "@wordpress/scripts": "^7.1.3" + }, + "scripts": { + "lint:scss": "wp-scripts lint-style 'sass/**/*.scss'", + "lint:js": "wp-scripts lint-js 'js/*.js'" + } +} diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 578ce02..2105118 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -1,9 +1,9 @@ - - - + + + A custom set of code standard rules to check for WordPress themes. @@ -28,21 +28,28 @@ - - + + . + + /vendor/* + /node_modules/* + - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + From 31c32dd2e4c209b53249eb12dbae3c3f6b7749f0 Mon Sep 17 00:00:00 2001 From: Ismail El Korchi Date: Sun, 5 Apr 2020 23:17:17 +0100 Subject: [PATCH 10/19] Disable block-no-empty rule --- .stylelintrc.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.stylelintrc.json b/.stylelintrc.json index 1927566..2a2f6fd 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -7,6 +7,7 @@ ], "rules": { "font-family-no-missing-generic-family-keyword": null, - "no-descending-specificity": null + "no-descending-specificity": null, + "block-no-empty": null } } From d3e4339c50a593c44cab29ab0d1eecf96011ac88 Mon Sep 17 00:00:00 2001 From: Ismail El Korchi Date: Sun, 5 Apr 2020 23:20:11 +0100 Subject: [PATCH 11/19] Update dependencies --- composer.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 2199d47..ba9666b 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2", "wptrt/wpthemereview": "^0.2.1", - "php-parallel-lint/php-parallel-lint": "^1.1.0" + "php-parallel-lint/php-parallel-lint": "^1.2.0" }, "scripts": { "lint:wpcs": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --runtime-set testVersion 5.6-", diff --git a/package.json b/package.json index 7465b0c..7e91688 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "url": "https://github.com/Automattic/_s/issues" }, "devDependencies": { - "@wordpress/scripts": "^7.1.3" + "@wordpress/scripts": "^7.2.0" }, "scripts": { "lint:scss": "wp-scripts lint-style 'sass/**/*.scss'", From b132e87dc0caa1cbf4892be57773232bf105d70b Mon Sep 17 00:00:00 2001 From: Ismail El Korchi Date: Sun, 5 Apr 2020 23:23:06 +0100 Subject: [PATCH 12/19] Switch tabs to spaces and fix a minor docs issue --- .stylelintrc.json | 4 ++-- .travis.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.stylelintrc.json b/.stylelintrc.json index 2a2f6fd..2c7b6b4 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -7,7 +7,7 @@ ], "rules": { "font-family-no-missing-generic-family-keyword": null, - "no-descending-specificity": null, - "block-no-empty": null + "no-descending-specificity": null, + "block-no-empty": null } } diff --git a/.travis.yml b/.travis.yml index 61cc0a3..4545c1d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,7 +52,7 @@ script: - composer validate --no-check-all --strict # Search for PHP syntax errors using PHP Parallel Lint. - # https://github.com/php-parallel-lint/PHP-Parallel-Lint + # @link https://github.com/php-parallel-lint/PHP-Parallel-Lint - composer lint:php # Check the PHP files with the coding standards documented in the phpcs.xml.dist file. From ff3567b32f925f8d996463d3798e454a158a3adc Mon Sep 17 00:00:00 2001 From: Ismail El Korchi Date: Tue, 7 Apr 2020 21:18:45 +0100 Subject: [PATCH 13/19] update the copyright date --- languages/_s.pot | 2 +- readme.txt | 2 +- sass/style.scss | 2 +- style.css | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/languages/_s.pot b/languages/_s.pot index 59216a2..3097dc7 100644 --- a/languages/_s.pot +++ b/languages/_s.pot @@ -1,4 +1,4 @@ -# Copyright (C) 2017 Automattic +# Copyright (C) 2020 Automattic # This file is distributed under the GNU General Public License v2 or later. msgid "" msgstr "" diff --git a/readme.txt b/readme.txt index 5b1c18c..66fc766 100644 --- a/readme.txt +++ b/readme.txt @@ -35,4 +35,4 @@ _s includes support for Infinite Scroll in Jetpack. == Credits == * Based on Underscores https://underscores.me/, (C) 2012-2020 Automattic, Inc., [GPLv2 or later](https://www.gnu.org/licenses/gpl-2.0.html) -* normalize.css https://necolas.github.io/normalize.css/, (C) 2012-2016 Nicolas Gallagher and Jonathan Neal, [MIT](https://opensource.org/licenses/MIT) +* normalize.css https://necolas.github.io/normalize.css/, (C) 2012-2018 Nicolas Gallagher and Jonathan Neal, [MIT](https://opensource.org/licenses/MIT) diff --git a/sass/style.scss b/sass/style.scss index e3fd9d7..445764d 100644 --- a/sass/style.scss +++ b/sass/style.scss @@ -13,7 +13,7 @@ Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-com This theme, like WordPress, is licensed under the GPL. Use it to make something cool, have fun, and share what you've learned. -_s is based on Underscores https://underscores.me/, (C) 2012-2017 Automattic, Inc. +_s is based on Underscores https://underscores.me/, (C) 2012-2020 Automattic, Inc. Underscores is distributed under the terms of the GNU GPL v2 or later. Normalizing styles have been helped along thanks to the fine work of diff --git a/style.css b/style.css index 7c2b645..5f925a3 100644 --- a/style.css +++ b/style.css @@ -13,7 +13,7 @@ Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-com This theme, like WordPress, is licensed under the GPL. Use it to make something cool, have fun, and share what you've learned with others. -_s is based on Underscores https://underscores.me/, (C) 2012-2017 Automattic, Inc. +_s is based on Underscores https://underscores.me/, (C) 2012-2020 Automattic, Inc. Underscores is distributed under the terms of the GNU GPL v2 or later. Normalizing styles have been helped along thanks to the fine work of From b07e5d368263aea65b35816be299856d1827c93b Mon Sep 17 00:00:00 2001 From: Ismail El Korchi Date: Wed, 8 Apr 2020 22:36:58 +0100 Subject: [PATCH 14/19] Add SASS compilation and sync the CSS files --- .stylelintrc.json | 4 +- package.json | 8 +- rtl.css | 4 +- sass/_normalize.scss | 60 ++++---- sass/elements/_elements.scss | 8 +- sass/modules/_accessibility.scss | 4 +- sass/modules/_infinite-scroll.scss | 3 +- sass/shop/_checkout.scss | 3 - sass/shop/_products.scss | 3 - sass/shop/_single-product.scss | 3 - sass/shop/_tables.scss | 3 - sass/site/secondary/_widgets.scss | 2 +- sass/woocommerce.scss | 8 +- style.css | 227 ++++++++++++++--------------- woocommerce.css | 124 ++++++++-------- 15 files changed, 226 insertions(+), 238 deletions(-) diff --git a/.stylelintrc.json b/.stylelintrc.json index 2c7b6b4..55b598d 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -8,6 +8,8 @@ "rules": { "font-family-no-missing-generic-family-keyword": null, "no-descending-specificity": null, - "block-no-empty": null + "block-no-empty": null, + "no-duplicate-selectors": null, + "font-family-no-duplicate-names": null } } diff --git a/package.json b/package.json index 7e91688..da584ee 100644 --- a/package.json +++ b/package.json @@ -17,10 +17,12 @@ "url": "https://github.com/Automattic/_s/issues" }, "devDependencies": { - "@wordpress/scripts": "^7.2.0" + "node-sass": "^4.13.1", + "@wordpress/scripts": "^7.2.0" }, "scripts": { - "lint:scss": "wp-scripts lint-style 'sass/**/*.scss'", - "lint:js": "wp-scripts lint-js 'js/*.js'" + "compile:css": "node-sass sass/style.scss style.css && node-sass sass/woocommerce.scss woocommerce.css && stylelint '*.css' --fix || true && stylelint '*.css' --fix", + "lint:scss": "wp-scripts lint-style 'sass/**/*.scss'", + "lint:js": "wp-scripts lint-js 'js/*.js'" } } diff --git a/rtl.css b/rtl.css index c59ed61..8729dfd 100644 --- a/rtl.css +++ b/rtl.css @@ -1,8 +1,8 @@ /* Theme Name: _s -Adding support for languages written in a Right To Left (RTL) direction is easy - -it's just a matter of overwriting all the horizontal positioning attributes +Adding support for languages written in a Right To Left (RTL) direction is easy. +It's just a matter of overwriting all the horizontal positioning attributes of your CSS stylesheet in a separate stylesheet file named rtl.css. https://codex.wordpress.org/Right-to-Left_Language_Support diff --git a/sass/_normalize.scss b/sass/_normalize.scss index c5ad67a..a7301ab 100644 --- a/sass/_normalize.scss +++ b/sass/_normalize.scss @@ -9,8 +9,8 @@ */ html { - line-height: 1.15; /* 1 */ - -webkit-text-size-adjust: 100%; /* 2 */ + line-height: 1.15; + -webkit-text-size-adjust: 100%; } /* Sections @@ -43,9 +43,9 @@ h1 { */ hr { - box-sizing: content-box; /* 1 */ - height: 0; /* 1 */ - overflow: visible; /* 2 */ + box-sizing: content-box; + height: 0; + overflow: visible; } /** @@ -54,8 +54,8 @@ hr { */ pre { - font-family: monospace, monospace; /* 1 */ - font-size: 1em; /* 2 */ + font-family: monospace, monospace; + font-size: 1em; } /* Text-level semantics @@ -75,9 +75,9 @@ a { */ abbr[title] { - border-bottom: none; /* 1 */ - text-decoration: underline; /* 2 */ - text-decoration: underline dotted; /* 2 */ + border-bottom: none; + text-decoration: underline; + text-decoration: underline dotted; } /** @@ -97,8 +97,8 @@ strong { code, kbd, samp { - font-family: monospace, monospace; /* 1 */ - font-size: 1em; /* 2 */ + font-family: monospace, monospace; + font-size: 1em; } /** @@ -154,10 +154,10 @@ input, optgroup, select, textarea { - font-family: inherit; /* 1 */ - font-size: 100%; /* 1 */ - line-height: 1.15; /* 1 */ - margin: 0; /* 2 */ + font-family: inherit; + font-size: 100%; + line-height: 1.15; + margin: 0; } /** @@ -166,7 +166,7 @@ textarea { */ button, -input { /* 1 */ +input { overflow: visible; } @@ -176,7 +176,7 @@ input { /* 1 */ */ button, -select { /* 1 */ +select { text-transform: none; } @@ -230,12 +230,12 @@ fieldset { */ legend { - box-sizing: border-box; /* 1 */ - color: inherit; /* 2 */ - display: table; /* 1 */ - max-width: 100%; /* 1 */ - padding: 0; /* 3 */ - white-space: normal; /* 1 */ + box-sizing: border-box; + color: inherit; + display: table; + max-width: 100%; + padding: 0; + white-space: normal; } /** @@ -261,8 +261,8 @@ textarea { [type="checkbox"], [type="radio"] { - box-sizing: border-box; /* 1 */ - padding: 0; /* 2 */ + box-sizing: border-box; + padding: 0; } /** @@ -280,8 +280,8 @@ textarea { */ [type="search"] { - -webkit-appearance: textfield; /* 1 */ - outline-offset: -2px; /* 2 */ + -webkit-appearance: textfield; + outline-offset: -2px; } /** @@ -298,8 +298,8 @@ textarea { */ ::-webkit-file-upload-button { - -webkit-appearance: button; /* 1 */ - font: inherit; /* 2 */ + -webkit-appearance: button; + font: inherit; } /* Interactive diff --git a/sass/elements/_elements.scss b/sass/elements/_elements.scss index cf93249..51ebb30 100644 --- a/sass/elements/_elements.scss +++ b/sass/elements/_elements.scss @@ -11,7 +11,7 @@ html { } body { - background: $color__background-body; /* Fallback for when there is no custom background color defined. */ + background: $color__background-body; // Fallback for when there is no custom background color defined. } hr { @@ -24,12 +24,12 @@ hr { @import "lists"; img { - height: auto; /* Make sure images are scaled correctly. */ - max-width: 100%; /* Adhere to container width. */ + height: auto; // Make sure images are scaled correctly. + max-width: 100%; // Adhere to container width. } figure { - margin: 1em 0; /* Extra wide images within figure tags don't overflow the content area. */ + margin: 1em 0; // Extra wide images within figure tags don't overflow the content area. } @import "tables"; diff --git a/sass/modules/_accessibility.scss b/sass/modules/_accessibility.scss index 1361788..b935555 100644 --- a/sass/modules/_accessibility.scss +++ b/sass/modules/_accessibility.scss @@ -9,7 +9,7 @@ padding: 0; position: absolute !important; width: 1px; - word-wrap: normal !important; /* Many screen reader and browser combinations announce broken words as they would appear visually. */ + word-wrap: normal !important; // Many screen reader and browser combinations announce broken words as they would appear visually. &:focus { background-color: $color__background-screen; @@ -30,7 +30,7 @@ text-decoration: none; top: 5px; width: auto; - z-index: 100000; /* Above WP toolbar. */ + z-index: 100000; // Above WP toolbar. } } diff --git a/sass/modules/_infinite-scroll.scss b/sass/modules/_infinite-scroll.scss index 87a7986..8867444 100644 --- a/sass/modules/_infinite-scroll.scss +++ b/sass/modules/_infinite-scroll.scss @@ -1,6 +1,5 @@ -/* Hide the Older / Newer Posts Navigation when Infinite Scroll is in use. */ +/* Hide the Posts Navigation and the Footer when Infinite Scroll is in use. */ .infinite-scroll .posts-navigation, -/* Hide the Theme Footer (when set to scrolling) */ .infinite-scroll.neverending .site-footer { display: none; } diff --git a/sass/shop/_checkout.scss b/sass/shop/_checkout.scss index fbd8d4a..abe52aa 100644 --- a/sass/shop/_checkout.scss +++ b/sass/shop/_checkout.scss @@ -1,6 +1,3 @@ -/** - * Checkout - */ @media screen and (min-width: 768px) { .col2-set { diff --git a/sass/shop/_products.scss b/sass/shop/_products.scss index ddbe13c..ec403b1 100644 --- a/sass/shop/_products.scss +++ b/sass/shop/_products.scss @@ -1,6 +1,3 @@ -/** - * Products - */ ul.products { @include clearfix; diff --git a/sass/shop/_single-product.scss b/sass/shop/_single-product.scss index db1e723..d3ecff5 100644 --- a/sass/shop/_single-product.scss +++ b/sass/shop/_single-product.scss @@ -1,6 +1,3 @@ -/** - * Single Product - */ .single-product { div.product { diff --git a/sass/shop/_tables.scss b/sass/shop/_tables.scss index 7b76cee..36a0ffd 100644 --- a/sass/shop/_tables.scss +++ b/sass/shop/_tables.scss @@ -1,6 +1,3 @@ -/** - * Shop tables - */ table.shop_table_responsive { thead { diff --git a/sass/site/secondary/_widgets.scss b/sass/site/secondary/_widgets.scss index 09b3d74..418343e 100644 --- a/sass/site/secondary/_widgets.scss +++ b/sass/site/secondary/_widgets.scss @@ -1,7 +1,7 @@ .widget { margin: 0 0 1.5em; - /* Make sure select elements fit in widgets. */ + // Make sure select elements fit in widgets. select { max-width: 100%; } diff --git a/sass/woocommerce.scss b/sass/woocommerce.scss index 80bc742..0a442c0 100644 --- a/sass/woocommerce.scss +++ b/sass/woocommerce.scss @@ -4,16 +4,12 @@ Theme Name: _s WooCommerce styles override */ -/** - * WooCommerce color variables - */ +// WooCommerce color variables $woocommerce__color-error: #e2401c; $woocommerce__color-success: #0f834d; $woocommerce__color-info: #3d9cd2; -/** - * Imports - */ +// Imports @import "variables-site/variables-site"; @import "mixins/mixins-master"; diff --git a/style.css b/style.css index 5f925a3..ca1e0ea 100644 --- a/style.css +++ b/style.css @@ -11,7 +11,7 @@ Text Domain: _s Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready This theme, like WordPress, is licensed under the GPL. -Use it to make something cool, have fun, and share what you've learned with others. +Use it to make something cool, have fun, and share what you've learned. _s is based on Underscores https://underscores.me/, (C) 2012-2020 Automattic, Inc. Underscores is distributed under the terms of the GNU GPL v2 or later. @@ -19,6 +19,7 @@ Underscores is distributed under the terms of the GNU GPL v2 or later. Normalizing styles have been helped along thanks to the fine work of Nicolas Gallagher and Jonathan Neal https://necolas.github.io/normalize.css/ */ + /*-------------------------------------------------------------- >>> TABLE OF CONTENTS: ---------------------------------------------------------------- @@ -41,10 +42,12 @@ Nicolas Gallagher and Jonathan Neal https://necolas.github.io/normalize.css/ ## Captions ## Galleries --------------------------------------------------------------*/ + /*-------------------------------------------------------------- # Normalize --------------------------------------------------------------*/ -/* normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */ + +/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */ /* Document ========================================================================== */ @@ -53,10 +56,9 @@ Nicolas Gallagher and Jonathan Neal https://necolas.github.io/normalize.css/ * 1. Correct the line height in all browsers. * 2. Prevent adjustments of font size after orientation changes in iOS. */ - html { - line-height: 1.15; /* 1 */ - -webkit-text-size-adjust: 100%; /* 2 */ + line-height: 1.15; + -webkit-text-size-adjust: 100%; } /* Sections @@ -65,7 +67,6 @@ html { /** * Remove the margin in all browsers. */ - body { margin: 0; } @@ -74,7 +75,6 @@ body { * Correct the font size and margin on `h1` elements within `section` and * `article` contexts in Chrome, Firefox, and Safari. */ - h1 { font-size: 2em; margin: 0.67em 0; @@ -87,21 +87,19 @@ h1 { * 1. Add the correct box sizing in Firefox. * 2. Show the overflow in Edge and IE. */ - hr { - box-sizing: content-box; /* 1 */ - height: 0; /* 1 */ - overflow: visible; /* 2 */ + box-sizing: content-box; + height: 0; + overflow: visible; } /** * 1. Correct the inheritance and scaling of font size in all browsers. * 2. Correct the odd `em` font sizing in all browsers. */ - pre { - font-family: monospace, monospace; /* 1 */ - font-size: 1em; /* 2 */ + font-family: monospace, monospace; + font-size: 1em; } /* Text-level semantics @@ -110,7 +108,6 @@ pre { /** * Remove the gray background on active links in IE 10. */ - a { background-color: transparent; } @@ -119,17 +116,15 @@ a { * 1. Remove the bottom border in Chrome 57- * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. */ - abbr[title] { - border-bottom: none; /* 1 */ - text-decoration: underline; /* 2 */ - text-decoration: underline dotted; /* 2 */ + border-bottom: none; + text-decoration: underline; + text-decoration: underline dotted; } /** * Add the correct font weight in Chrome, Edge, and Safari. */ - b, strong { font-weight: bolder; @@ -139,18 +134,16 @@ strong { * 1. Correct the inheritance and scaling of font size in all browsers. * 2. Correct the odd `em` font sizing in all browsers. */ - code, kbd, samp { - font-family: monospace, monospace; /* 1 */ - font-size: 1em; /* 2 */ + font-family: monospace, monospace; + font-size: 1em; } /** * Add the correct font size in all browsers. */ - small { font-size: 80%; } @@ -159,7 +152,6 @@ small { * Prevent `sub` and `sup` elements from affecting the line height in * all browsers. */ - sub, sup { font-size: 75%; @@ -182,7 +174,6 @@ sup { /** * Remove the border on images inside links in IE 10. */ - img { border-style: none; } @@ -194,25 +185,23 @@ img { * 1. Change the font styles in all browsers. * 2. Remove the margin in Firefox and Safari. */ - button, input, optgroup, select, textarea { - font-family: inherit; /* 1 */ - font-size: 100%; /* 1 */ - line-height: 1.15; /* 1 */ - margin: 0; /* 2 */ + font-family: inherit; + font-size: 100%; + line-height: 1.15; + margin: 0; } /** * Show the overflow in IE. * 1. Show the overflow in Edge. */ - button, -input { /* 1 */ +input { overflow: visible; } @@ -220,16 +209,14 @@ input { /* 1 */ * Remove the inheritance of text transform in Edge, Firefox, and IE. * 1. Remove the inheritance of text transform in Firefox. */ - button, -select { /* 1 */ +select { text-transform: none; } /** * Correct the inability to style clickable types in iOS and Safari. */ - button, [type="button"], [type="reset"], @@ -240,7 +227,6 @@ button, /** * Remove the inner border and padding in Firefox. */ - button::-moz-focus-inner, [type="button"]::-moz-focus-inner, [type="reset"]::-moz-focus-inner, @@ -252,7 +238,6 @@ button::-moz-focus-inner, /** * Restore the focus styles unset by the previous rule. */ - button:-moz-focusring, [type="button"]:-moz-focusring, [type="reset"]:-moz-focusring, @@ -263,7 +248,6 @@ button:-moz-focusring, /** * Correct the padding in Firefox. */ - fieldset { padding: 0.35em 0.75em 0.625em; } @@ -274,20 +258,18 @@ fieldset { * 3. Remove the padding so developers are not caught out when they zero out * `fieldset` elements in all browsers. */ - legend { - box-sizing: border-box; /* 1 */ - color: inherit; /* 2 */ - display: table; /* 1 */ - max-width: 100%; /* 1 */ - padding: 0; /* 3 */ - white-space: normal; /* 1 */ + box-sizing: border-box; + color: inherit; + display: table; + max-width: 100%; + padding: 0; + white-space: normal; } /** * Add the correct vertical alignment in Chrome, Firefox, and Opera. */ - progress { vertical-align: baseline; } @@ -295,7 +277,6 @@ progress { /** * Remove the default vertical scrollbar in IE 10+. */ - textarea { overflow: auto; } @@ -304,17 +285,15 @@ textarea { * 1. Add the correct box sizing in IE 10. * 2. Remove the padding in IE 10. */ - [type="checkbox"], [type="radio"] { - box-sizing: border-box; /* 1 */ - padding: 0; /* 2 */ + box-sizing: border-box; + padding: 0; } /** * Correct the cursor style of increment and decrement buttons in Chrome. */ - [type="number"]::-webkit-inner-spin-button, [type="number"]::-webkit-outer-spin-button { height: auto; @@ -324,16 +303,14 @@ textarea { * 1. Correct the odd appearance in Chrome and Safari. * 2. Correct the outline style in Safari. */ - [type="search"] { - -webkit-appearance: textfield; /* 1 */ - outline-offset: -2px; /* 2 */ + -webkit-appearance: textfield; + outline-offset: -2px; } /** * Remove the inner padding in Chrome and Safari on macOS. */ - [type="search"]::-webkit-search-decoration { -webkit-appearance: none; } @@ -342,10 +319,9 @@ textarea { * 1. Correct the inability to style clickable types in iOS and Safari. * 2. Change font properties to `inherit` in Safari. */ - ::-webkit-file-upload-button { - -webkit-appearance: button; /* 1 */ - font: inherit; /* 2 */ + -webkit-appearance: button; + font: inherit; } /* Interactive @@ -354,7 +330,6 @@ textarea { /* * Add the correct display in Edge, IE 10+, and Firefox. */ - details { display: block; } @@ -362,7 +337,6 @@ details { /* * Add the correct display in all browsers. */ - summary { display: list-item; } @@ -373,7 +347,6 @@ summary { /** * Add the correct display in IE 10+. */ - template { display: none; } @@ -381,7 +354,6 @@ template { /** * Add the correct display in IE 10. */ - [hidden] { display: none; } @@ -402,7 +374,12 @@ textarea { line-height: 1.5; } -h1, h2, h3, h4, h5, h6 { +h1, +h2, +h3, +h4, +h5, +h6 { clear: both; } @@ -410,7 +387,10 @@ p { margin-bottom: 1.5em; } -dfn, cite, em, i { +dfn, +cite, +em, +i { font-style: italic; } @@ -424,7 +404,7 @@ address { pre { background: #eee; - font-family: "Courier 10 Pitch", Courier, monospace; + font-family: "Courier 10 Pitch", courier, monospace; font-size: 15px; font-size: 0.9375rem; line-height: 1.6; @@ -434,18 +414,23 @@ pre { padding: 1.6em; } -code, kbd, tt, var { - font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; +code, +kbd, +tt, +var { + font-family: monaco, consolas, "Andale Mono", "DejaVu Sans Mono", monospace; font-size: 15px; font-size: 0.9375rem; } -abbr, acronym { +abbr, +acronym { border-bottom: 1px dotted #666; cursor: help; } -mark, ins { +mark, +ins { background: #fff9c0; text-decoration: none; } @@ -457,20 +442,21 @@ big { /*-------------------------------------------------------------- # Elements --------------------------------------------------------------*/ + +/* Inherit box-sizing to more easily change it's value on a component level. +@link http://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ */ +*, +*::before, +*::after { + box-sizing: inherit; +} + html { box-sizing: border-box; } -*, -*:before, -*:after { - /* Inherit box-sizing to make it easier to change the property for components that leverage other behavior; see https://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ */ - box-sizing: inherit; -} - body { background: #fff; - /* Fallback for when there is no custom background color defined. */ } hr { @@ -480,7 +466,8 @@ hr { margin-bottom: 1.5em; } -ul, ol { +ul, +ol { margin: 0 0 1.5em 3em; } @@ -499,7 +486,7 @@ li > ol { } dt { - font-weight: bold; + font-weight: 700; } dd { @@ -508,14 +495,11 @@ dd { img { height: auto; - /* Make sure images are scaled correctly. */ max-width: 100%; - /* Adhere to container width. */ } figure { margin: 1em 0; - /* Extra wide images within figure tags don't overflow the content area. */ } table { @@ -538,7 +522,7 @@ input[type="submit"] { font-size: 12px; font-size: 0.75rem; line-height: 1; - padding: .6em 1em .4em; + padding: 0.6em 1em 0.4em; } button:hover, @@ -548,7 +532,8 @@ input[type="submit"]:hover { border-color: #ccc #bbb #aaa; } -button:active, button:focus, +button:active, +button:focus, input[type="button"]:active, input[type="button"]:focus, input[type="reset"]:active, @@ -610,26 +595,30 @@ textarea { /*-------------------------------------------------------------- # Navigation --------------------------------------------------------------*/ + /*-------------------------------------------------------------- ## Links --------------------------------------------------------------*/ a { - color: royalblue; + color: #4169e1; } a:visited { - color: purple; + color: #800080; } -a:hover, a:focus, a:active { - color: midnightblue; +a:hover, +a:focus, +a:active { + color: #191970; } a:focus { outline: thin dotted; } -a:hover, a:active { +a:hover, +a:active { outline: 0; } @@ -695,16 +684,20 @@ a:hover, a:active { } @media screen and (min-width: 37.5em) { + .menu-toggle { display: none; } + .main-navigation ul { display: block; } } -.site-main .comment-navigation, .site-main -.posts-navigation, .site-main +.site-main .comment-navigation, +.site-main +.posts-navigation, +.site-main .post-navigation { margin: 0 0 1.5em; overflow: hidden; @@ -728,6 +721,7 @@ a:hover, a:active { /*-------------------------------------------------------------- # Accessibility --------------------------------------------------------------*/ + /* Text meant only for screen readers. */ .screen-reader-text { border: 0; @@ -739,7 +733,7 @@ a:hover, a:active { padding: 0; position: absolute !important; width: 1px; - word-wrap: normal !important; /* Many screen reader and browser combinations announce broken words as they would appear visually. */ + word-wrap: normal !important; } .screen-reader-text:focus { @@ -752,7 +746,7 @@ a:hover, a:active { display: block; font-size: 14px; font-size: 0.875rem; - font-weight: bold; + font-weight: 700; height: auto; left: 5px; line-height: normal; @@ -761,7 +755,6 @@ a:hover, a:active { top: 5px; width: auto; z-index: 100000; - /* Above WP toolbar. */ } /* Do not show the outline on the skip link target. */ @@ -797,29 +790,29 @@ a:hover, a:active { /*-------------------------------------------------------------- # Clearings --------------------------------------------------------------*/ -.clear:before, -.clear:after, -.entry-content:before, -.entry-content:after, -.comment-content:before, -.comment-content:after, -.site-header:before, -.site-header:after, -.site-content:before, -.site-content:after, -.site-footer:before, -.site-footer:after { +.clear::before, +.clear::after, +.entry-content::before, +.entry-content::after, +.comment-content::before, +.comment-content::after, +.site-header::before, +.site-header::after, +.site-content::before, +.site-content::after, +.site-footer::before, +.site-footer::after { content: ""; display: table; table-layout: fixed; } -.clear:after, -.entry-content:after, -.comment-content:after, -.site-header:after, -.site-content:after, -.site-footer:after { +.clear::after, +.entry-content::after, +.comment-content::after, +.site-header::after, +.site-content::after, +.site-footer::after { clear: both; } @@ -828,7 +821,6 @@ a:hover, a:active { --------------------------------------------------------------*/ .widget { margin: 0 0 1.5em; - /* Make sure select elements fit in widgets. */ } .widget select { @@ -838,6 +830,7 @@ a:hover, a:active { /*-------------------------------------------------------------- # Content --------------------------------------------------------------*/ + /*-------------------------------------------------------------- ## Posts and pages --------------------------------------------------------------*/ @@ -879,14 +872,14 @@ a:hover, a:active { /*-------------------------------------------------------------- # Infinite scroll --------------------------------------------------------------*/ -/* Globally hidden elements when Infinite Scroll is supported and in use. */ + +/* Hide the Posts Navigation and the Footer when Infinite Scroll is in use. */ .infinite-scroll .posts-navigation, .infinite-scroll.neverending .site-footer { - /* Theme Footer (when set to scrolling) */ display: none; } -/* When Infinite Scroll has reached its end we need to re-display elements that were hidden (via .neverending) before. */ +/* Re-display the Theme Footer when Infinite Scroll has reached its end. */ .infinity-end.neverending .site-footer { display: block; } diff --git a/woocommerce.css b/woocommerce.css index d1308c5..d8d0b74 100644 --- a/woocommerce.css +++ b/woocommerce.css @@ -3,15 +3,7 @@ Theme Name: _s WooCommerce styles override */ -/** - * WooCommerce color variables - */ -/** - * Imports - */ -/** - * Shop tables - */ + /** * Shop tables */ @@ -29,7 +21,7 @@ table.shop_table_responsive tr td { clear: both; } -table.shop_table_responsive tr td:before { +table.shop_table_responsive tr td::before { content: attr(data-title) ": "; float: left; } @@ -38,11 +30,12 @@ table.shop_table_responsive tr td.product-remove a { text-align: left; } -table.shop_table_responsive tr td.product-remove:before { +table.shop_table_responsive tr td.product-remove::before { display: none; } -table.shop_table_responsive tr td.actions:before, table.shop_table_responsive tr td.download-actions:before { +table.shop_table_responsive tr td.actions::before, +table.shop_table_responsive tr td.download-actions::before { display: none; } @@ -52,26 +45,29 @@ table.shop_table_responsive tr td.download-actions .button { } @media screen and (min-width: 48em) { + table.shop_table_responsive thead { display: table-header-group; } + table.shop_table_responsive tbody th { display: table-cell; } - table.shop_table_responsive tr th, table.shop_table_responsive tr td { + + table.shop_table_responsive tr th, + table.shop_table_responsive tr td { text-align: left; } + table.shop_table_responsive tr td { display: table-cell; } - table.shop_table_responsive tr td:before { + + table.shop_table_responsive tr td::before { display: none; } } -/** - * Products - */ /** * Products */ @@ -102,44 +98,50 @@ ul.products li.product .button { } @media screen and (min-width: 48em) { + ul.products li.product { - width: 30.7966666667%; + width: 30.79667%; float: left; margin-right: 3.8%; } + ul.products li.product.first { clear: both; } + ul.products li.product.last { margin-right: 0; } + .columns-1 ul.products li.product { float: none; width: 100%; } + .columns-2 ul.products li.product { width: 48.1%; } + .columns-3 ul.products li.product { - width: 30.7966666667%; + width: 30.79667%; } + .columns-4 ul.products li.product { width: 22.15%; } + .columns-5 ul.products li.product { width: 16.96%; } + .columns-6 ul.products li.product { - width: 13.4933333333%; + width: 13.49333%; } } /** * Single product */ -/** - * Single Product - */ .single-product div.product { content: ""; display: table; @@ -178,7 +180,7 @@ ul.products li.product .button { } .single-product div.product .woocommerce-product-gallery .flex-control-thumbs li img { - opacity: .5; + opacity: 0.5; } .single-product div.product .woocommerce-product-gallery .flex-control-thumbs li img.flex-active { @@ -202,7 +204,7 @@ ul.products li.product .button { } .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-3 .flex-control-thumbs li { - width: 30.7966666667%; + width: 30.79667%; } .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-3 .flex-control-thumbs li:nth-child(3n) { @@ -237,7 +239,7 @@ ul.products li.product .button { clear: both; } -.stock:empty:before { +.stock:empty::before { display: none; } @@ -249,21 +251,21 @@ ul.products li.product .button { color: #e2401c; } -/** - * Checkout - */ /** * Checkout */ @media screen and (min-width: 768px) { + .col2-set .form-row-first { float: left; margin-right: 3.8%; } + .col2-set .form-row-last { float: right; margin-right: 0; } + .col2-set .form-row-first, .col2-set .form-row-last { width: 48.1%; @@ -273,6 +275,7 @@ ul.products li.product .button { /** * General WooCommerce components */ + /** * Header cart */ @@ -308,13 +311,13 @@ ul.products li.product .button { line-height: 1.618; font-size: 1em; width: 5.3em; - font-family: 'star'; + font-family: star; font-weight: 400; } -.star-rating:before { +.star-rating::before { content: "\53\53\53\53\53"; - opacity: .25; + opacity: 0.25; float: left; top: 0; left: 0; @@ -330,12 +333,12 @@ ul.products li.product .button { padding-top: 1.5em; } -.star-rating span:before { +.star-rating span::before { content: "\53\53\53\53\53"; top: 0; position: absolute; left: 0; - color: royalblue; + color: #4169e1; } p.stars a { @@ -349,7 +352,7 @@ p.stars a { font-weight: 400; } -p.stars a:before { +p.stars a::before { display: block; position: absolute; top: 0; @@ -357,40 +360,40 @@ p.stars a:before { width: 1em; height: 1em; line-height: 1; - font-family: "star"; + font-family: star; content: "\53"; color: #404040; text-indent: 0; - opacity: .25; + opacity: 0.25; } -p.stars a:hover ~ a:before { +p.stars a:hover ~ a::before { content: "\53"; color: #404040; - opacity: .25; + opacity: 0.25; } -p.stars:hover a:before { +p.stars:hover a::before { content: "\53"; - color: royalblue; + color: #4169e1; opacity: 1; } -p.stars.selected a.active:before { +p.stars.selected a.active::before { content: "\53"; - color: royalblue; + color: #4169e1; opacity: 1; } -p.stars.selected a.active ~ a:before { +p.stars.selected a.active ~ a::before { content: "\53"; color: #404040; - opacity: .25; + opacity: 0.25; } -p.stars.selected a:not(.active):before { +p.stars.selected a:not(.active)::before { content: "\53"; - color: royalblue; + color: #4169e1; opacity: 1; } @@ -439,7 +442,7 @@ p.stars.selected a:not(.active):before { } .woocommerce-password-strength.good { - color: #3D9CD2; + color: #3d9cd2; } /** @@ -454,7 +457,7 @@ p.stars.selected a:not(.active):before { } .required { - color: red; + color: #f00; } /** @@ -475,7 +478,7 @@ p.no-comments { .woocommerce-info, .woocommerce-noreviews, p.no-comments { - background-color: #3D9CD2; + background-color: #3d9cd2; } .woocommerce-error { @@ -489,11 +492,12 @@ p.no-comments { right: 0; margin: 0; padding: 1em; - background-color: #3D9CD2; + background-color: #3d9cd2; z-index: 9999; } @media screen and (min-width: 48em) { + /** * Header cart */ @@ -506,7 +510,9 @@ p.no-comments { display: block; box-shadow: 0 3px 3px rgba(0, 0, 0, 0.2); } - .site-header-cart:hover .widget_shopping_cart, .site-header-cart.focus .widget_shopping_cart { + + .site-header-cart:hover .widget_shopping_cart, + .site-header-cart.focus .widget_shopping_cart { left: 0; display: block; } @@ -515,6 +521,7 @@ p.no-comments { /** * WooCommerce widgets */ + /** * WooCommerce Price Filter */ @@ -524,7 +531,7 @@ p.no-comments { .widget_price_filter .price_slider_amount { text-align: right; - line-height: 2.4em; + line-height: 2.4; } .widget_price_filter .price_slider_amount .button { @@ -543,9 +550,9 @@ p.no-comments { height: 1em; cursor: ew-resize; outline: none; - background: royalblue; + background: #4169e1; box-sizing: border-box; - margin-top: -.25em; + margin-top: -0.25em; opacity: 1; } @@ -553,7 +560,8 @@ p.no-comments { margin-left: -1em; } -.widget_price_filter .ui-slider .ui-slider-handle:hover, .widget_price_filter .ui-slider .ui-slider-handle.ui-state-active { +.widget_price_filter .ui-slider .ui-slider-handle:hover, +.widget_price_filter .ui-slider .ui-slider-handle.ui-state-active { box-shadow: 0 0 0 0.25em rgba(0, 0, 0, 0.1); } @@ -562,7 +570,7 @@ p.no-comments { z-index: 1; display: block; border: 0; - background: royalblue; + background: #4169e1; } .widget_price_filter .price_slider_wrapper .ui-widget-content { @@ -570,7 +578,7 @@ p.no-comments { } .widget_price_filter .ui-slider-horizontal { - height: .5em; + height: 0.5em; } .widget_price_filter .ui-slider-horizontal .ui-slider-range { From 27ddf843e397050cac9bb31f2ca1944cdecac50e Mon Sep 17 00:00:00 2001 From: Ismail El Korchi Date: Thu, 9 Apr 2020 17:55:51 +0100 Subject: [PATCH 15/19] Remove superfluous parameter from composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ba9666b..d96462f 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "php-parallel-lint/php-parallel-lint": "^1.2.0" }, "scripts": { - "lint:wpcs": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --runtime-set testVersion 5.6-", + "lint:wpcs": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs", "lint:php": "@php ./vendor/bin/parallel-lint --exclude .git --exclude vendor ." }, "support": { From 29b0bb311f092963e35a23a11846398b979f9187 Mon Sep 17 00:00:00 2001 From: Ron Holt Date: Fri, 8 Nov 2019 00:14:40 -0800 Subject: [PATCH 16/19] Close small menu when user clicks outside #1375 --- js/navigation.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/js/navigation.js b/js/navigation.js index fa92651..2dc6993 100644 --- a/js/navigation.js +++ b/js/navigation.js @@ -42,6 +42,17 @@ } }; + // Close small menu when user clicks outside + document.addEventListener( 'click', function( event ) { + var isClickInside = container.contains( event.target ); + + if ( ! isClickInside ) { + container.className = container.className.replace( ' toggled', '' ); + button.setAttribute( 'aria-expanded', 'false' ); + menu.setAttribute( 'aria-expanded', 'false' ); + } + } ); + // Get all the link elements within the menu. links = menu.getElementsByTagName( 'a' ); From 9dee7649496047136bf082f6e896b5125aba5347 Mon Sep 17 00:00:00 2001 From: Ismail El Korchi Date: Fri, 10 Apr 2020 03:04:28 +0100 Subject: [PATCH 17/19] Fix a minor spacing issue --- js/navigation.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/js/navigation.js b/js/navigation.js index 2dc6993..ee18d75 100644 --- a/js/navigation.js +++ b/js/navigation.js @@ -42,16 +42,16 @@ } }; - // Close small menu when user clicks outside - document.addEventListener( 'click', function( event ) { - var isClickInside = container.contains( event.target ); + // Close small menu when user clicks outside + document.addEventListener( 'click', function( event ) { + var isClickInside = container.contains( event.target ); - if ( ! isClickInside ) { - container.className = container.className.replace( ' toggled', '' ); - button.setAttribute( 'aria-expanded', 'false' ); - menu.setAttribute( 'aria-expanded', 'false' ); - } - } ); + if ( ! isClickInside ) { + container.className = container.className.replace( ' toggled', '' ); + button.setAttribute( 'aria-expanded', 'false' ); + menu.setAttribute( 'aria-expanded', 'false' ); + } + } ); // Get all the link elements within the menu. links = menu.getElementsByTagName( 'a' ); From 233c99ae47eb795cbbfa416292dad2eedc3df300 Mon Sep 17 00:00:00 2001 From: Ismail El Korchi Date: Fri, 10 Apr 2020 16:25:12 +0100 Subject: [PATCH 18/19] Add make-pot command to composer and update _s.pot file correct spacing --- composer.json | 6 +- languages/_s.pot | 180 ++++++++++++++++++++++++----------------------- 2 files changed, 96 insertions(+), 90 deletions(-) diff --git a/composer.json b/composer.json index d96462f..4bfdcb9 100644 --- a/composer.json +++ b/composer.json @@ -20,11 +20,13 @@ "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2", "wptrt/wpthemereview": "^0.2.1", - "php-parallel-lint/php-parallel-lint": "^1.2.0" + "php-parallel-lint/php-parallel-lint": "^1.2.0", + "wp-cli/i18n-command": "^2.2" }, "scripts": { "lint:wpcs": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs", - "lint:php": "@php ./vendor/bin/parallel-lint --exclude .git --exclude vendor ." + "lint:php": "@php ./vendor/bin/parallel-lint --exclude .git --exclude vendor .", + "make-pot": "wp i18n make-pot . languages/_s.pot" }, "support": { "issues": "https://github.com/Automattic/_s/issues", diff --git a/languages/_s.pot b/languages/_s.pot index 3097dc7..22e332b 100644 --- a/languages/_s.pot +++ b/languages/_s.pot @@ -3,41 +3,68 @@ msgid "" msgstr "" "Project-Id-Version: _s 1.0.0\n" -"Report-Msgid-Bugs-To: https://wordpress.org/tags/_s\n" -"POT-Creation-Date: 2016-12-23 16:00+0100\n" +"Report-Msgid-Bugs-To: https://wordpress.org/support/theme/_s\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2017-MO-DA HO:MI+ZONE\n" -"Last-Translator:\n" -"Language-Team: LANGUAGE \n" -"X-Generator: grunt-wp-i18n 0.5.4\n" +"POT-Creation-Date: 2020-04-10T15:22:10+00:00\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"X-Generator: WP-CLI 2.4.0\n" +"X-Domain: _s\n" -#: 404.php:17 +#. Theme Name of the theme +msgid "_s" +msgstr "" + +#. Theme URI of the theme +msgid "https://underscores.me/" +msgstr "" + +#. Description of the theme +msgid "Hi. I'm a starter theme called _s, or underscores, if you like. I'm a theme meant for hacking so don't use me as a Parent Theme. Instead try turning me into the next, most awesome, WordPress theme out there. That's what I'm here for." +msgstr "" + +#. Author of the theme +msgid "Automattic" +msgstr "" + +#. Author URI of the theme +msgid "https://automattic.com/" +msgstr "" + +#: 404.php:18 msgid "Oops! That page can’t be found." msgstr "" -#: 404.php:21 -msgid "" -"It looks like nothing was found at this location. Maybe try one of the " -"links below or a search?" +#: 404.php:22 +msgid "It looks like nothing was found at this location. Maybe try one of the links below or a search?" msgstr "" -#: 404.php:30 +#: 404.php:31 msgid "Most Used Categories" msgstr "" -#: 404.php:47 #. translators: %1$s: smiley +#: 404.php:49 msgid "Try looking in the monthly archives. %1$s" msgstr "" -#: comments.php:34 #. translators: 1: title. +#: comments.php:35 msgid "One thought on “%1$s”" msgstr "" -#: comments.php:67 +#. translators: 1: comment count number, 2: title. +#: comments.php:41 +msgctxt "comments title" +msgid "%1$s thought on “%2$s”" +msgid_plural "%1$s thoughts on “%2$s”" +msgstr[0] "" +msgstr[1] "" + +#: comments.php:68 msgid "Comments are closed." msgstr "" @@ -45,63 +72,93 @@ msgstr "" msgid "https://wordpress.org/" msgstr "" -#: footer.php:20 #. translators: %s: CMS name, i.e. WordPress. +#: footer.php:21 msgid "Proudly powered by %s" msgstr "" -#: footer.php:25 #. translators: 1: Theme name, 2: Theme author. +#: footer.php:27 msgid "Theme: %1$s by %2$s." msgstr "" -#: functions.php:47 +#: functions.php:53 msgid "Primary" msgstr "" -#: functions.php:105 +#: functions.php:128 msgid "Sidebar" msgstr "" -#: functions.php:107 +#: functions.php:130 msgid "Add widgets here." msgstr "" -#: header.php:24 +#: header.php:26 msgid "Skip to content" msgstr "" -#: header.php:45 +#: header.php:49 msgid "Primary Menu" msgstr "" -#: inc/template-tags.php:52 +#. translators: %s: post date. +#: inc/template-tags.php:30 +msgctxt "post date" +msgid "Posted on %s" +msgstr "" + +#. translators: %s: post author. +#: inc/template-tags.php:46 +msgctxt "post author" +msgid "by %s" +msgstr "" + #. translators: used between list items, there is a space after the comma +#: inc/template-tags.php:63 msgid ", " msgstr "" -#: inc/template-tags.php:55 #. translators: 1: list of categories. +#: inc/template-tags.php:66 msgid "Posted in %1$s" msgstr "" -#: inc/template-tags.php:62 +#. translators: used between list items, there is a space after the comma +#: inc/template-tags.php:70 +msgctxt "list item separator" +msgid ", " +msgstr "" + #. translators: 1: list of tags. +#: inc/template-tags.php:73 msgid "Tagged %1$s" msgstr "" -#: inc/template-tags.php:72 #. translators: %s: post title +#: inc/template-tags.php:83 msgid "Leave a Comment on %s" msgstr "" -#: inc/template-tags.php:89 template-parts/content-page.php:35 #. translators: %s: Name of current post. Only visible to screen readers +#: inc/template-tags.php:100 +#: template-parts/content-page.php:39 msgid "Edit %s" msgstr "" -#: search.php:21 +#: inc/woocommerce.php:227 +msgid "View your shopping cart" +msgstr "" + +#. translators: number of items in the mini cart. +#: inc/woocommerce.php:231 +msgid "%d item" +msgid_plural "%d items" +msgstr[0] "" +msgstr[1] "" + #. translators: %s: search query. +#: search.php:22 msgid "Search Results for: %s" msgstr "" @@ -109,78 +166,25 @@ msgstr "" msgid "Nothing Found" msgstr "" -#: template-parts/content-none.php:25 #. translators: 1: link to WP admin new post page. +#: template-parts/content-none.php:24 msgid "Ready to publish your first post? Get started here." msgstr "" -#: template-parts/content-none.php:38 -msgid "" -"Sorry, but nothing matched your search terms. Please try again with some " -"different keywords." +#: template-parts/content-none.php:37 +msgid "Sorry, but nothing matched your search terms. Please try again with some different keywords." msgstr "" #: template-parts/content-none.php:44 -msgid "" -"It seems we can’t find what you’re looking for. Perhaps " -"searching can help." +msgid "It seems we can’t find what you’re looking for. Perhaps searching can help." msgstr "" -#: template-parts/content-page.php:22 template-parts/content.php:45 +#: template-parts/content-page.php:25 +#: template-parts/content.php:53 msgid "Pages:" msgstr "" -#: template-parts/content.php:34 #. translators: %s: Name of current post. Only visible to screen readers +#: template-parts/content.php:40 msgid "Continue reading \"%s\"" msgstr "" - -#. Theme Name of the plugin/theme -msgid "_s" -msgstr "" - -#. Theme URI of the plugin/theme -msgid "https://underscores.me/" -msgstr "" - -#. Description of the plugin/theme -msgid "" -"Hi. I'm a starter theme called _s, or underscores, if " -"you like. I'm a theme meant for hacking so don't use me as a Parent " -"Theme. Instead try turning me into the next, most awesome, WordPress " -"theme out there. That's what I'm here for." -msgstr "" - -#. Author of the plugin/theme -msgid "Automattic" -msgstr "" - -#. Author URI of the plugin/theme -msgid "https://automattic.com/" -msgstr "" - -#: comments.php:40 -#. translators: 1: comment count number, 2: title. -msgctxt "comments title" -msgid "%1$s thought on “%2$s”" -msgid_plural "%1$s thoughts on “%2$s”" -msgstr[0] "" -msgstr[1] "" - -#: inc/template-tags.php:29 -#. translators: %s: post date. -msgctxt "post date" -msgid "Posted on %s" -msgstr "" - -#: inc/template-tags.php:35 -#. translators: %s: post author. -msgctxt "post author" -msgid "by %s" -msgstr "" - -#: inc/template-tags.php:59 -#. translators: used between list items, there is a space after the comma -msgctxt "list item separator" -msgid ", " -msgstr "" From 0e3209dfcaf39cf03c04cfff4e4aebc7fc540ef5 Mon Sep 17 00:00:00 2001 From: Ismail El Korchi Date: Thu, 9 Apr 2020 21:04:25 +0100 Subject: [PATCH 19/19] removes columns wrapper and hardcoded values from woocommerce Adjust default values --- inc/woocommerce.php | 71 +++++++++------------------------------- sass/shop/_products.scss | 22 +++++-------- woocommerce.css | 12 +++---- 3 files changed, 30 insertions(+), 75 deletions(-) diff --git a/inc/woocommerce.php b/inc/woocommerce.php index fff16ad..a66e74b 100644 --- a/inc/woocommerce.php +++ b/inc/woocommerce.php @@ -12,11 +12,25 @@ * * @link https://docs.woocommerce.com/document/third-party-custom-theme-compatibility/ * @link https://github.com/woocommerce/woocommerce/wiki/Enabling-product-gallery-features-(zoom,-swipe,-lightbox) + * @link https://github.com/woocommerce/woocommerce/wiki/Declaring-WooCommerce-support-in-themes * * @return void */ function _s_woocommerce_setup() { - add_theme_support( 'woocommerce' ); + add_theme_support( + 'woocommerce', + array( + 'thumbnail_image_width' => 150, + 'single_image_width' => 300, + 'product_grid' => array( + 'default_rows' => 3, + 'min_rows' => 1, + 'default_columns' => 4, + 'min_columns' => 1, + 'max_columns' => 6, + ), + ) + ); add_theme_support( 'wc-product-gallery-zoom' ); add_theme_support( 'wc-product-gallery-lightbox' ); add_theme_support( 'wc-product-gallery-slider' ); @@ -70,36 +84,6 @@ function _s_woocommerce_active_body_class( $classes ) { } add_filter( 'body_class', '_s_woocommerce_active_body_class' ); -/** - * Products per page. - * - * @return integer number of products. - */ -function _s_woocommerce_products_per_page() { - return 12; -} -add_filter( 'loop_shop_per_page', '_s_woocommerce_products_per_page' ); - -/** - * Product gallery thumbnail columns. - * - * @return integer number of columns. - */ -function _s_woocommerce_thumbnail_columns() { - return 4; -} -add_filter( 'woocommerce_product_thumbnails_columns', '_s_woocommerce_thumbnail_columns' ); - -/** - * Default loop columns on product archives. - * - * @return integer products per row. - */ -function _s_woocommerce_loop_columns() { - return 3; -} -add_filter( 'loop_shop_columns', '_s_woocommerce_loop_columns' ); - /** * Related Products Args. * @@ -118,31 +102,6 @@ function _s_woocommerce_related_products_args( $args ) { } add_filter( 'woocommerce_output_related_products_args', '_s_woocommerce_related_products_args' ); -if ( ! function_exists( '_s_woocommerce_product_columns_wrapper' ) ) { - /** - * Product columns wrapper. - * - * @return void - */ - function _s_woocommerce_product_columns_wrapper() { - $columns = _s_woocommerce_loop_columns(); - echo '
'; - } -} -add_action( 'woocommerce_before_shop_loop', '_s_woocommerce_product_columns_wrapper', 40 ); - -if ( ! function_exists( '_s_woocommerce_product_columns_wrapper_close' ) ) { - /** - * Product columns wrapper close. - * - * @return void - */ - function _s_woocommerce_product_columns_wrapper_close() { - echo '
'; - } -} -add_action( 'woocommerce_after_shop_loop', '_s_woocommerce_product_columns_wrapper_close', 40 ); - /** * Remove default WooCommerce wrapper. */ diff --git a/sass/shop/_products.scss b/sass/shop/_products.scss index ec403b1..5d39372 100644 --- a/sass/shop/_products.scss +++ b/sass/shop/_products.scss @@ -43,28 +43,24 @@ ul.products { } } - .columns-1 { + ul.products.columns-1 { - ul.products { - - li.product { - float: none; - width: 100%; - } + li.product { + float: none; + width: 100%; } + } @for $i from 2 through 6 { - .columns-#{$i} { + ul.products.columns-#{$i} { - ul.products { + li.product { - li.product { - - @include column-width( $i ); - } + @include column-width( $i ); } + } } } diff --git a/woocommerce.css b/woocommerce.css index d8d0b74..a884400 100644 --- a/woocommerce.css +++ b/woocommerce.css @@ -113,28 +113,28 @@ ul.products li.product .button { margin-right: 0; } - .columns-1 ul.products li.product { + ul.products.columns-1 li.product { float: none; width: 100%; } - .columns-2 ul.products li.product { + ul.products.columns-2 li.product { width: 48.1%; } - .columns-3 ul.products li.product { + ul.products.columns-3 li.product { width: 30.79667%; } - .columns-4 ul.products li.product { + ul.products.columns-4 li.product { width: 22.15%; } - .columns-5 ul.products li.product { + ul.products.columns-5 li.product { width: 16.96%; } - .columns-6 ul.products li.product { + ul.products.columns-6 li.product { width: 13.49333%; } }