From 27e68252f673295e896969da5b442cbc6bdf4f1e Mon Sep 17 00:00:00 2001 From: Tiago Noronha Date: Tue, 1 Aug 2017 14:21:13 +0100 Subject: [PATCH 001/107] Basic WooCommerce Integration. --- functions.php | 7 + inc/custom-header.php | 6 + inc/woocommerce.php | 238 +++++++ sass/media/_galleries.scss | 2 +- sass/mixins/_mixins-master.scss | 5 + sass/shop/_checkout.scss | 21 + sass/shop/_components.scss | 275 ++++++++ sass/shop/_products.scss | 63 ++ sass/shop/_single-product.scss | 83 +++ sass/shop/_tables.scss | 79 +++ sass/shop/_widgets.scss | 64 ++ sass/variables-site/_columns.scss | 13 + sass/variables-site/_variables-site.scss | 3 +- sass/woocommerce.scss | 62 ++ style.css | 834 +++++++++-------------- woocommerce.css | 445 ++++++++++++ 16 files changed, 1683 insertions(+), 517 deletions(-) create mode 100644 inc/woocommerce.php create mode 100644 sass/shop/_checkout.scss create mode 100644 sass/shop/_components.scss create mode 100644 sass/shop/_products.scss create mode 100644 sass/shop/_single-product.scss create mode 100644 sass/shop/_tables.scss create mode 100644 sass/shop/_widgets.scss create mode 100644 sass/variables-site/_columns.scss create mode 100644 sass/woocommerce.scss create mode 100644 woocommerce.css diff --git a/functions.php b/functions.php index 76bac867..47f544c8 100644 --- a/functions.php +++ b/functions.php @@ -155,3 +155,10 @@ require get_template_directory() . '/inc/customizer.php'; if ( defined( 'JETPACK__VERSION' ) ) { require get_template_directory() . '/inc/jetpack.php'; } + +/** + * Load WooCommerce compatibility file. + */ +if ( class_exists( 'WooCommerce' ) ) { + require get_template_directory() . '/inc/woocommerce.php'; +} \ No newline at end of file diff --git a/inc/custom-header.php b/inc/custom-header.php index 97b1db28..39b5a1fc 100644 --- a/inc/custom-header.php +++ b/inc/custom-header.php @@ -8,6 +8,12 @@ * * @link https://developer.wordpress.org/themes/functionality/custom-headers/ * + * You can add the WooCommerce Mini Cart to header.php like so ... + * + if ( function_exists( '_s_woocommerce_header_cart' ) ) { + _s_woocommerce_header_cart(); + } + * * @package _s */ diff --git a/inc/woocommerce.php b/inc/woocommerce.php new file mode 100644 index 00000000..e1dd6e85 --- /dev/null +++ b/inc/woocommerce.php @@ -0,0 +1,238 @@ + 3, + 'columns' => 3, + ) ); + + return $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 + */ +remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10 ); +remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10 ); + +if ( ! function_exists( '_s_woocommerce_wrapper_before' ) ) { + /** + * Before Content + * Wraps all WooCommerce content in wrappers which match the theme markup + * + * @return void + */ + function _s_woocommerce_wrapper_before() { + ?> +
+
+ +
+
+ + + cart->get_cart_subtotal() ); ?> cart->get_cart_contents_count(), '_s' ), WC()->cart->get_cart_contents_count() ) );?> 'expand' ) ); ?> + + + + >> TABLE OF CONTENTS: ---------------------------------------------------------------- @@ -42,19 +41,16 @@ Nicolas Gallagher and Jonathan Neal http://necolas.github.io/normalize.css/ ## Captions ## Galleries --------------------------------------------------------------*/ - /*-------------------------------------------------------------- # Normalize --------------------------------------------------------------*/ html { - font-family: sans-serif; - -webkit-text-size-adjust: 100%; - -ms-text-size-adjust: 100%; -} + font-family: sans-serif; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; } body { - margin: 0; -} + margin: 0; } article, aside, @@ -68,194 +64,157 @@ menu, nav, section, summary { - display: block; -} + display: block; } audio, canvas, progress, video { - display: inline-block; - vertical-align: baseline; -} + display: inline-block; + vertical-align: baseline; } audio:not([controls]) { - display: none; - height: 0; -} + display: none; + height: 0; } [hidden], template { - display: none; -} + display: none; } a { - background-color: transparent; -} + background-color: transparent; } a:active, a:hover { - outline: 0; -} + outline: 0; } abbr[title] { - border-bottom: 1px dotted; -} + border-bottom: 1px dotted; } b, strong { - font-weight: bold; -} + font-weight: bold; } dfn { - font-style: italic; -} + font-style: italic; } h1 { - font-size: 2em; - margin: 0.67em 0; -} + font-size: 2em; + margin: 0.67em 0; } mark { - background: #ff0; - color: #000; -} + background: #ff0; + color: #000; } small { - font-size: 80%; -} + font-size: 80%; } sub, sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; -} + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; } sup { - top: -0.5em; -} + top: -0.5em; } sub { - bottom: -0.25em; -} + bottom: -0.25em; } img { - border: 0; -} + border: 0; } svg:not(:root) { - overflow: hidden; -} + overflow: hidden; } figure { - margin: 1em 40px; -} + margin: 1em 40px; } hr { - box-sizing: content-box; - height: 0; -} + box-sizing: content-box; + height: 0; } pre { - overflow: auto; -} + overflow: auto; } code, kbd, pre, samp { - font-family: monospace, monospace; - font-size: 1em; -} + font-family: monospace, monospace; + font-size: 1em; } button, input, optgroup, select, textarea { - color: inherit; - font: inherit; - margin: 0; -} + color: inherit; + font: inherit; + margin: 0; } button { - overflow: visible; -} + overflow: visible; } button, select { - text-transform: none; -} + text-transform: none; } button, html input[type="button"], input[type="reset"], input[type="submit"] { - -webkit-appearance: button; - cursor: pointer; -} + -webkit-appearance: button; + cursor: pointer; } button[disabled], html input[disabled] { - cursor: default; -} + cursor: default; } button::-moz-focus-inner, input::-moz-focus-inner { - border: 0; - padding: 0; -} + border: 0; + padding: 0; } input { - line-height: normal; -} + line-height: normal; } input[type="checkbox"], input[type="radio"] { - box-sizing: border-box; - padding: 0; -} + box-sizing: border-box; + padding: 0; } input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { - height: auto; -} + height: auto; } input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; -} + -webkit-appearance: none; } fieldset { - border: 1px solid #c0c0c0; - margin: 0 2px; - padding: 0.35em 0.625em 0.75em; -} + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; } legend { - border: 0; - padding: 0; -} + border: 0; + padding: 0; } textarea { - overflow: auto; -} + overflow: auto; } optgroup { - font-weight: bold; -} + font-weight: bold; } table { - border-collapse: collapse; - border-spacing: 0; -} + border-collapse: collapse; + border-spacing: 0; } td, th { - padding: 0; -} + padding: 0; } /*-------------------------------------------------------------- # Typography @@ -266,154 +225,114 @@ input, select, optgroup, textarea { - color: #404040; - font-family: sans-serif; - font-size: 16px; - font-size: 1rem; - line-height: 1.5; -} + color: #404040; + font-family: sans-serif; + font-size: 16px; + font-size: 1rem; + line-height: 1.5; } -h1, -h2, -h3, -h4, -h5, -h6 { - clear: both; -} +h1, h2, h3, h4, h5, h6 { + clear: both; } p { - margin-bottom: 1.5em; -} + margin-bottom: 1.5em; } -dfn, -cite, -em, -i { - font-style: italic; -} +dfn, cite, em, i { + font-style: italic; } blockquote { - margin: 0 1.5em; -} + margin: 0 1.5em; } address { - margin: 0 0 1.5em; -} + margin: 0 0 1.5em; } pre { - background: #eee; - font-family: "Courier 10 Pitch", Courier, monospace; - font-size: 15px; - font-size: 0.9375rem; - line-height: 1.6; - margin-bottom: 1.6em; - max-width: 100%; - overflow: auto; - padding: 1.6em; -} + background: #eee; + font-family: "Courier 10 Pitch", Courier, monospace; + font-size: 15px; + font-size: 0.9375rem; + line-height: 1.6; + margin-bottom: 1.6em; + max-width: 100%; + overflow: auto; + padding: 1.6em; } -code, -kbd, -tt, -var { - font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; - font-size: 15px; - font-size: 0.9375rem; -} +code, kbd, tt, var { + font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; + font-size: 15px; + font-size: 0.9375rem; } -abbr, -acronym { - border-bottom: 1px dotted #666; - cursor: help; -} +abbr, acronym { + border-bottom: 1px dotted #666; + cursor: help; } -mark, -ins { - background: #fff9c0; - text-decoration: none; -} +mark, ins { + background: #fff9c0; + text-decoration: none; } big { - font-size: 125%; -} + font-size: 125%; } /*-------------------------------------------------------------- # Elements --------------------------------------------------------------*/ html { - box-sizing: border-box; -} + box-sizing: border-box; } *, *:before, -*:after { /* Inherit box-sizing to make it easier to change the property for components that leverage other behavior; see http://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ */ - box-sizing: inherit; -} +*:after { + /* Inherit box-sizing to make it easier to change the property for components that leverage other behavior; see http://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. */ -} + background: #fff; + /* Fallback for when there is no custom background color defined. */ } -blockquote:before, -blockquote:after, -q:before, -q:after { - content: ""; -} - -blockquote, -q { - quotes: "" ""; -} +blockquote, q { + quotes: "" ""; } + blockquote:before, blockquote:after, q:before, q:after { + content: ""; } hr { - background-color: #ccc; - border: 0; - height: 1px; - margin-bottom: 1.5em; -} + background-color: #ccc; + border: 0; + height: 1px; + margin-bottom: 1.5em; } -ul, -ol { - margin: 0 0 1.5em 3em; -} +ul, ol { + margin: 0 0 1.5em 3em; } ul { - list-style: disc; -} + list-style: disc; } ol { - list-style: decimal; -} + list-style: decimal; } li > ul, li > ol { - margin-bottom: 0; - margin-left: 1.5em; -} + margin-bottom: 0; + margin-left: 1.5em; } dt { - font-weight: bold; -} + font-weight: bold; } dd { - margin: 0 1.5em 1.5em; -} + margin: 0 1.5em 1.5em; } 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. */ } table { - margin: 0 0 1.5em; - width: 100%; -} + margin: 0 0 1.5em; + width: 100%; } /*-------------------------------------------------------------- # Forms @@ -422,34 +341,28 @@ button, input[type="button"], input[type="reset"], input[type="submit"] { - border: 1px solid; - border-color: #ccc #ccc #bbb; - border-radius: 3px; - background: #e6e6e6; - color: rgba(0, 0, 0, .8); - font-size: 12px; - font-size: 0.75rem; - line-height: 1; - padding: .6em 1em .4em; -} - -button:hover, -input[type="button"]:hover, -input[type="reset"]:hover, -input[type="submit"]:hover { - border-color: #ccc #bbb #aaa; -} - -button:focus, -input[type="button"]:focus, -input[type="reset"]:focus, -input[type="submit"]:focus, -button:active, -input[type="button"]:active, -input[type="reset"]:active, -input[type="submit"]:active { - border-color: #aaa #bbb #bbb; -} + border: 1px solid; + border-color: #ccc #ccc #bbb; + border-radius: 3px; + background: #e6e6e6; + color: rgba(0, 0, 0, 0.8); + font-size: 12px; + font-size: 0.75rem; + line-height: 1; + padding: .6em 1em .4em; } + button:hover, + input[type="button"]:hover, + input[type="reset"]:hover, + input[type="submit"]:hover { + border-color: #ccc #bbb #aaa; } + button:active, button:focus, + input[type="button"]:active, + input[type="button"]:focus, + input[type="reset"]:active, + input[type="reset"]:focus, + input[type="submit"]:active, + input[type="submit"]:focus { + border-color: #aaa #bbb #bbb; } input[type="text"], input[type="email"], @@ -467,38 +380,33 @@ input[type="datetime"], input[type="datetime-local"], input[type="color"], textarea { - color: #666; - border: 1px solid #ccc; - border-radius: 3px; - padding: 3px; -} + color: #666; + border: 1px solid #ccc; + border-radius: 3px; + padding: 3px; } + input[type="text"]:focus, + input[type="email"]:focus, + input[type="url"]:focus, + input[type="password"]:focus, + input[type="search"]:focus, + input[type="number"]:focus, + input[type="tel"]:focus, + input[type="range"]:focus, + input[type="date"]:focus, + input[type="month"]:focus, + input[type="week"]:focus, + input[type="time"]:focus, + input[type="datetime"]:focus, + input[type="datetime-local"]:focus, + input[type="color"]:focus, + textarea:focus { + color: #111; } select { - border: 1px solid #ccc; -} - -input[type="text"]:focus, -input[type="email"]:focus, -input[type="url"]:focus, -input[type="password"]:focus, -input[type="search"]:focus, -input[type="number"]:focus, -input[type="tel"]:focus, -input[type="range"]:focus, -input[type="date"]:focus, -input[type="month"]:focus, -input[type="week"]:focus, -input[type="time"]:focus, -input[type="datetime"]:focus, -input[type="datetime-local"]:focus, -input[type="color"]:focus, -textarea:focus { - color: #111; -} + border: 1px solid #ccc; } textarea { - width: 100%; -} + width: 100%; } /*-------------------------------------------------------------- # Navigation @@ -507,201 +415,138 @@ textarea { ## Links --------------------------------------------------------------*/ a { - color: royalblue; -} - -a:visited { - color: purple; -} - -a:hover, -a:focus, -a:active { - color: midnightblue; -} - -a:focus { - outline: thin dotted; -} - -a:hover, -a:active { - outline: 0; -} + color: royalblue; } + a:visited { + color: purple; } + a:hover, a:focus, a:active { + color: midnightblue; } + a:focus { + outline: thin dotted; } + a:hover, a:active { + outline: 0; } /*-------------------------------------------------------------- ## Menus --------------------------------------------------------------*/ .main-navigation { - clear: both; - display: block; - float: left; - width: 100%; -} - -.main-navigation ul { - display: none; - list-style: none; - margin: 0; - padding-left: 0; -} - -.main-navigation li { - float: left; - position: relative; -} - -.main-navigation a { - display: block; - text-decoration: none; -} - -.main-navigation ul ul { - box-shadow: 0 3px 3px rgba(0, 0, 0, 0.2); - float: left; - position: absolute; - top: 100%; - left: -999em; - z-index: 99999; -} - -.main-navigation ul ul ul { - left: -999em; - top: 0; -} - -.main-navigation ul ul a { - width: 200px; -} - -.main-navigation ul ul li { - -} - -.main-navigation li:hover > a, -.main-navigation li.focus > a { -} - -.main-navigation ul ul :hover > a, -.main-navigation ul ul .focus > a { -} - -.main-navigation ul ul a:hover, -.main-navigation ul ul a.focus { -} - -.main-navigation ul li:hover > ul, -.main-navigation ul li.focus > ul { - left: auto; -} - -.main-navigation ul ul li:hover > ul, -.main-navigation ul ul li.focus > ul { - left: 100%; -} - -.main-navigation .current_page_item > a, -.main-navigation .current-menu-item > a, -.main-navigation .current_page_ancestor > a, -.main-navigation .current-menu-ancestor > a { -} + clear: both; + display: block; + float: left; + width: 100%; } + .main-navigation ul { + display: none; + list-style: none; + margin: 0; + padding-left: 0; } + .main-navigation ul ul { + box-shadow: 0 3px 3px rgba(0, 0, 0, 0.2); + float: left; + position: absolute; + top: 100%; + left: -999em; + z-index: 99999; } + .main-navigation ul ul ul { + left: -999em; + top: 0; } + .main-navigation ul ul li:hover > ul, + .main-navigation ul ul li.focus > ul { + left: 100%; } + .main-navigation ul ul a { + width: 200px; } + .main-navigation ul li:hover > ul, + .main-navigation ul li.focus > ul { + left: auto; } + .main-navigation li { + float: left; + position: relative; } + .main-navigation a { + display: block; + text-decoration: none; } /* Small menu. */ .menu-toggle, .main-navigation.toggled ul { - display: block; -} + display: block; } @media screen and (min-width: 37.5em) { - .menu-toggle { - display: none; - } - .main-navigation ul { - display: block; - } -} + .menu-toggle { + display: none; } + .main-navigation ul { + display: block; } } -.site-main .comment-navigation, -.site-main .posts-navigation, -.site-main .post-navigation { - margin: 0 0 1.5em; - overflow: hidden; -} +.site-main .comment-navigation, .site-main +.posts-navigation, .site-main +.post-navigation { + margin: 0 0 1.5em; + overflow: hidden; } .comment-navigation .nav-previous, .posts-navigation .nav-previous, .post-navigation .nav-previous { - float: left; - width: 50%; -} + float: left; + width: 50%; } .comment-navigation .nav-next, .posts-navigation .nav-next, .post-navigation .nav-next { - float: right; - text-align: right; - width: 50%; -} + float: right; + text-align: right; + width: 50%; } /*-------------------------------------------------------------- # Accessibility --------------------------------------------------------------*/ /* Text meant only for screen readers. */ .screen-reader-text { - clip: rect(1px, 1px, 1px, 1px); - position: absolute !important; - height: 1px; - width: 1px; - overflow: hidden; - word-wrap: normal !important; /* Many screen reader and browser combinations announce broken words as they would appear visually. */ -} - -.screen-reader-text:focus { - background-color: #f1f1f1; - border-radius: 3px; - box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6); - clip: auto !important; - color: #21759b; - display: block; - font-size: 14px; - font-size: 0.875rem; - font-weight: bold; - height: auto; - left: 5px; - line-height: normal; - padding: 15px 23px 14px; - text-decoration: none; - top: 5px; - width: auto; - z-index: 100000; /* Above WP toolbar. */ -} + clip: rect(1px, 1px, 1px, 1px); + position: absolute !important; + height: 1px; + width: 1px; + overflow: hidden; + word-wrap: normal !important; + /* Many screen reader and browser combinations announce broken words as they would appear visually. */ } + .screen-reader-text:focus { + background-color: #f1f1f1; + border-radius: 3px; + box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6); + clip: auto !important; + color: #21759b; + display: block; + font-size: 14px; + font-size: 0.875rem; + font-weight: bold; + height: auto; + left: 5px; + line-height: normal; + padding: 15px 23px 14px; + text-decoration: none; + top: 5px; + width: auto; + z-index: 100000; + /* Above WP toolbar. */ } /* Do not show the outline on the skip link target. */ #content[tabindex="-1"]:focus { - outline: 0; -} + outline: 0; } /*-------------------------------------------------------------- # Alignments --------------------------------------------------------------*/ .alignleft { - display: inline; - float: left; - margin-right: 1.5em; -} + display: inline; + float: left; + margin-right: 1.5em; } .alignright { - display: inline; - float: right; - margin-left: 1.5em; -} + display: inline; + float: right; + margin-left: 1.5em; } .aligncenter { - clear: both; - display: block; - margin-left: auto; - margin-right: auto; -} + clear: both; + display: block; + margin-left: auto; + margin-right: auto; } /*-------------------------------------------------------------- # Clearings @@ -718,10 +563,9 @@ a:active { .site-content:after, .site-footer:before, .site-footer:after { - content: ""; - display: table; - table-layout: fixed; -} + content: ""; + display: table; + table-layout: fixed; } .clear:after, .entry-content:after, @@ -729,20 +573,16 @@ a:active { .site-header:after, .site-content:after, .site-footer:after { - clear: both; -} + clear: both; } /*-------------------------------------------------------------- # Widgets --------------------------------------------------------------*/ .widget { - margin: 0 0 1.5em; -} - -/* Make sure select elements fit in widgets. */ -.widget select { - max-width: 100%; -} + margin: 0 0 1.5em; + /* Make sure select elements fit in widgets. */ } + .widget select { + max-width: 100%; } /*-------------------------------------------------------------- # Content @@ -751,52 +591,44 @@ a:active { ## Posts and pages --------------------------------------------------------------*/ .sticky { - display: block; -} + display: block; } .hentry { - margin: 0 0 1.5em; -} + margin: 0 0 1.5em; } .updated:not(.published) { - display: none; -} + display: none; } .page-content, .entry-content, .entry-summary { - margin: 1.5em 0 0; -} + margin: 1.5em 0 0; } .page-links { - clear: both; - margin: 0 0 1.5em; -} + clear: both; + margin: 0 0 1.5em; } /*-------------------------------------------------------------- ## Comments --------------------------------------------------------------*/ .comment-content a { - word-wrap: break-word; -} + word-wrap: break-word; } .bypostauthor { - display: block; -} + display: block; } /*-------------------------------------------------------------- # Infinite scroll --------------------------------------------------------------*/ /* 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) */ - display: none; -} +.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. */ .infinity-end.neverending .site-footer { - display: block; -} + display: block; } /*-------------------------------------------------------------- # Media @@ -804,92 +636,64 @@ a:active { .page-content .wp-smiley, .entry-content .wp-smiley, .comment-content .wp-smiley { - border: none; - margin-bottom: 0; - margin-top: 0; - padding: 0; -} + border: none; + margin-bottom: 0; + margin-top: 0; + padding: 0; } /* Make sure embeds and iframes fit their containers. */ embed, iframe, object { - max-width: 100%; -} + max-width: 100%; } /* Make sure logo link wraps around logo image. */ .custom-logo-link { - display: inline-block; -} + display: inline-block; } /*-------------------------------------------------------------- ## Captions --------------------------------------------------------------*/ .wp-caption { - margin-bottom: 1.5em; - max-width: 100%; -} - -.wp-caption img[class*="wp-image-"] { - display: block; - margin-left: auto; - margin-right: auto; -} - -.wp-caption .wp-caption-text { - margin: 0.8075em 0; -} + margin-bottom: 1.5em; + max-width: 100%; } + .wp-caption img[class*="wp-image-"] { + display: block; + margin-left: auto; + margin-right: auto; } + .wp-caption .wp-caption-text { + margin: 0.8075em 0; } .wp-caption-text { - text-align: center; -} + text-align: center; } /*-------------------------------------------------------------- ## Galleries --------------------------------------------------------------*/ .gallery { - margin-bottom: 1.5em; -} + margin-bottom: 1.5em; } .gallery-item { - display: inline-block; - text-align: center; - vertical-align: top; - width: 100%; -} - -.gallery-columns-2 .gallery-item { - max-width: 50%; -} - -.gallery-columns-3 .gallery-item { - max-width: 33.33333%; -} - -.gallery-columns-4 .gallery-item { - max-width: 25%; -} - -.gallery-columns-5 .gallery-item { - max-width: 20%; -} - -.gallery-columns-6 .gallery-item { - max-width: 16.66667%; -} - -.gallery-columns-7 .gallery-item { - max-width: 14.28571%; -} - -.gallery-columns-8 .gallery-item { - max-width: 12.5%; -} - -.gallery-columns-9 .gallery-item { - max-width: 11.11111%; -} + display: inline-block; + text-align: center; + vertical-align: top; + width: 100%; } + .gallery-columns-2 .gallery-item { + max-width: 50%; } + .gallery-columns-3 .gallery-item { + max-width: 33.33%; } + .gallery-columns-4 .gallery-item { + max-width: 25%; } + .gallery-columns-5 .gallery-item { + max-width: 20%; } + .gallery-columns-6 .gallery-item { + max-width: 16.66%; } + .gallery-columns-7 .gallery-item { + max-width: 14.28%; } + .gallery-columns-8 .gallery-item { + max-width: 12.5%; } + .gallery-columns-9 .gallery-item { + max-width: 11.11%; } .gallery-caption { - display: block; -} + display: block; } diff --git a/woocommerce.css b/woocommerce.css new file mode 100644 index 00000000..ef900445 --- /dev/null +++ b/woocommerce.css @@ -0,0 +1,445 @@ +/* +Theme Name: _s + +WooCommerce styles override +*/ +/** + * WooCommerce color variables + */ +/** + * Imports + */ +/** + * Fonts + */ +@font-face { + font-family: 'star'; + src: url("../../plugins/woocommerce/assets/fonts/star.eot"); + src: url("../../plugins/woocommerce/assets/fonts/star.eot?#iefix") format("embedded-opentype"), url("../../plugins/woocommerce/assets/fonts/star.woff") format("woff"), url("../../plugins/woocommerce/assets/fonts/star.ttf") format("truetype"), url("../../plugins/woocommerce/assets/fonts/star.svg#star") format("svg"); + font-weight: normal; + font-style: normal; } + +/** + * Shop tables + */ +/** + * Shop tables + */ +table.shop_table_responsive thead { + display: none; } + +table.shop_table_responsive tbody th { + display: none; } + +table.shop_table_responsive tr td { + display: block; + text-align: right; + clear: both; } + table.shop_table_responsive tr td:before { + content: attr(data-title) ": "; + float: left; } + table.shop_table_responsive tr td.product-remove a { + text-align: left; } + 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 { + display: none; } + table.shop_table_responsive tr td.download-actions .button { + display: block; + text-align: center; } + +@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 { + text-align: left; } + table.shop_table_responsive tr td { + display: table-cell; } + table.shop_table_responsive tr td:before { + display: none; } } + +/** + * Products + */ +/** + * Products + */ +ul.products { + content: ""; + display: table; + table-layout: fixed; + margin: 0; + padding: 0; } + ul.products li.product { + list-style: none; + position: relative; + margin-bottom: 2em; } + ul.products li.product .woocommerce-loop-product__title { + font-size: 1rem; } + ul.products li.product img { + display: block; } + ul.products li.product .button { + display: block; } + +@media screen and (min-width: 48em) { + ul.products li.product { + width: 30.7966666667%; + 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.7333333333%; } + .columns-3 ul.products li.product { + width: 30.7966666667%; } + .columns-4 ul.products li.product { + width: 21.2%; } + .columns-5 ul.products li.product { + width: 14.9333333333%; } + .columns-6 ul.products li.product { + width: 10.3266666667%; } } + +/** + * Single product + */ +/** + * Single Product + */ +.single-product div.product { + content: ""; + display: table; + table-layout: fixed; + position: relative; } + .single-product div.product .woocommerce-product-gallery { + position: relative; } + .single-product div.product .woocommerce-product-gallery .woocommerce-product-gallery__trigger { + position: absolute; + top: 1em; + right: 1em; + display: block; + z-index: 99; } + .single-product div.product .woocommerce-product-gallery .flex-viewport { + margin-bottom: 1em; } + .single-product div.product .woocommerce-product-gallery .flex-control-thumbs { + content: ""; + display: table; + table-layout: fixed; + margin: 0; + padding: 0; } + .single-product div.product .woocommerce-product-gallery .flex-control-thumbs li { + list-style: none; + cursor: pointer; + float: left; } + .single-product div.product .woocommerce-product-gallery .flex-control-thumbs li img { + opacity: .5; } + .single-product div.product .woocommerce-product-gallery .flex-control-thumbs li img.flex-active { + opacity: 1; } + .single-product div.product .woocommerce-product-gallery .flex-control-thumbs li:hover img { + opacity: 1; } + .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-2 .flex-control-thumbs li { + width: 48.7333333333%; } + .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-2 .flex-control-thumbs li:nth-child(2n) { + margin-right: 0; } + .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-2 .flex-control-thumbs li:nth-child(2n+1) { + clear: both; } + .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-3 .flex-control-thumbs li { + width: 30.7966666667%; } + .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-3 .flex-control-thumbs li:nth-child(3n) { + margin-right: 0; } + .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-3 .flex-control-thumbs li:nth-child(3n+1) { + clear: both; } + .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-4 .flex-control-thumbs li { + width: 21.2%; } + .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-4 .flex-control-thumbs li:nth-child(4n) { + margin-right: 0; } + .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-4 .flex-control-thumbs li:nth-child(4n+1) { + clear: both; } + .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-5 .flex-control-thumbs li { + width: 14.9333333333%; } + .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-5 .flex-control-thumbs li:nth-child(5n) { + margin-right: 0; } + .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-5 .flex-control-thumbs li:nth-child(5n+1) { + clear: both; } + +.stock:empty:before { + display: none; } + +.stock.in-stock { + color: #0f834d; } + +.stock.out-of-stock { + 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.7333333333%; } } + +/** + * General WooCommerce components + */ +/** + * Header cart + */ +.site-header-cart { + position: relative; + margin: 0; + padding: 0; + content: ""; + display: table; + table-layout: fixed; } + .site-header-cart .cart-contents { + text-decoration: none; } + .site-header-cart .cart-contents .icon { + display: none; } + .site-header-cart .widget_shopping_cart { + display: none; } + .site-header-cart .product_list_widget { + margin: 0; + padding: 0; } + +/** + * Star rating + */ +.star-rating { + overflow: hidden; + position: relative; + height: 1.618em; + line-height: 1.618; + font-size: 1em; + width: 5.3em; + font-family: 'star'; + font-weight: 400; } + .star-rating:before { + content: "\53\53\53\53\53"; + opacity: .25; + float: left; + top: 0; + left: 0; + position: absolute; } + .star-rating span { + overflow: hidden; + float: left; + top: 0; + left: 0; + position: absolute; + padding-top: 1.5em; } + .star-rating span:before { + content: "\53\53\53\53\53"; + top: 0; + position: absolute; + left: 0; + color: royalblue; } + +p.stars a { + position: relative; + height: 1em; + width: 1em; + text-indent: -999em; + display: inline-block; + text-decoration: none; + margin-right: 1px; + font-weight: 400; } + p.stars a:before { + display: block; + position: absolute; + top: 0; + left: 0; + width: 1em; + height: 1em; + line-height: 1; + font-family: "star"; + content: "\53"; + color: #404040; + text-indent: 0; + opacity: .25; } + p.stars a:hover ~ a:before { + content: "\53"; + color: #404040; + opacity: .25; } + +p.stars:hover a:before { + content: "\53"; + color: royalblue; + opacity: 1; } + +p.stars.selected a.active:before { + content: "\53"; + color: royalblue; + opacity: 1; } + +p.stars.selected a.active ~ a:before { + content: "\53"; + color: #404040; + opacity: .25; } + +p.stars.selected a:not(.active):before { + content: "\53"; + color: royalblue; + opacity: 1; } + +/** + * Tabs + */ +.woocommerce-tabs ul.tabs { + list-style: none; + margin: 0; + padding: 0; + text-align: left; } + .woocommerce-tabs ul.tabs li { + display: block; + margin: 0; + position: relative; } + .woocommerce-tabs ul.tabs li a { + padding: 1em 0; + display: block; } + +.woocommerce-tabs .panel h2:first-of-type { + margin-bottom: 1em; } + +/** + * Password strength meter + */ +.woocommerce-password-strength { + text-align: right; } + .woocommerce-password-strength.strong { + color: #0f834d; } + .woocommerce-password-strength.short { + color: #e2401c; } + .woocommerce-password-strength.bad { + color: #e2401c; } + .woocommerce-password-strength.good { + color: #3D9CD2; } + +/** + * Forms + */ +.form-row.woocommerce-validated input.input-text { + box-shadow: inset 2px 0 0 #0f834d; } + +.form-row.woocommerce-invalid input.input-text { + box-shadow: inset 2px 0 0 #e2401c; } + +.required { + color: red; } + +/** + * Notices + */ +.woocommerce-message, +.woocommerce-info, +.woocommerce-error, +.woocommerce-noreviews, +p.no-comments { + content: ""; + display: table; + table-layout: fixed; + background-color: #0f834d; + clear: both; } + +.woocommerce-info, +.woocommerce-noreviews, +p.no-comments { + background-color: #3D9CD2; } + +.woocommerce-error { + background-color: #e2401c; } + +.demo_store { + position: fixed; + left: 0; + bottom: 0; + right: 0; + margin: 0; + padding: 1em; + background-color: #3D9CD2; + z-index: 9999; } + +@media screen and (min-width: 48em) { + /** + * Header cart + */ + .site-header-cart .widget_shopping_cart { + position: absolute; + top: 100%; + width: 100%; + z-index: 999999; + font-size: ms(-1); + left: -999em; + display: block; + box-shadow: 0 3px 3px rgba(0, 0, 0, 0.2); } + .site-header-cart .cart-contents .icon { + display: inline; } + .site-header-cart:hover .widget_shopping_cart, .site-header-cart.focus .widget_shopping_cart { + left: 0; + display: block; } } + +/** + * WooCommerce widgets + */ +/** + * WooCommerce Price Filter + */ +.widget_price_filter .price_slider { + margin-bottom: 1.5em; } + +.widget_price_filter .price_slider_amount { + text-align: right; + line-height: 2.4em; } + .widget_price_filter .price_slider_amount .button { + float: left; } + +.widget_price_filter .ui-slider { + position: relative; + text-align: left; } + +.widget_price_filter .ui-slider .ui-slider-handle { + position: absolute; + z-index: 2; + width: 1em; + height: 1em; + cursor: ew-resize; + outline: none; + background: royalblue; + box-sizing: border-box; + margin-top: -.25em; + opacity: 1; } + .widget_price_filter .ui-slider .ui-slider-handle:last-child { + margin-left: -1em; } + .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); } + +.widget_price_filter .ui-slider .ui-slider-range { + position: absolute; + z-index: 1; + display: block; + border: 0; + background: royalblue; } + +.widget_price_filter .price_slider_wrapper .ui-widget-content { + background: rgba(0, 0, 0, 0.1); } + +.widget_price_filter .ui-slider-horizontal { + height: .5em; } + +.widget_price_filter .ui-slider-horizontal .ui-slider-range { + height: 100%; } From 46a41b2042c481f9e9645c447b943e59b0576804 Mon Sep 17 00:00:00 2001 From: Tiago Noronha Date: Tue, 1 Aug 2017 15:42:22 +0100 Subject: [PATCH 002/107] Newlines, data validation, and translators comment. --- functions.php | 2 +- inc/woocommerce.php | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/functions.php b/functions.php index 47f544c8..aea2ddad 100644 --- a/functions.php +++ b/functions.php @@ -161,4 +161,4 @@ if ( defined( 'JETPACK__VERSION' ) ) { */ if ( class_exists( 'WooCommerce' ) ) { require get_template_directory() . '/inc/woocommerce.php'; -} \ No newline at end of file +} diff --git a/inc/woocommerce.php b/inc/woocommerce.php index e1dd6e85..01de29eb 100644 --- a/inc/woocommerce.php +++ b/inc/woocommerce.php @@ -37,7 +37,7 @@ add_action( 'wp_enqueue_scripts', '_s_woocommerce_scripts' ); /** * Disable the default WooCommerce stylesheet * - * Removing the default WooCommerce stylesheet and enqueing your own will + * Removing the default WooCommerce stylesheet and enqueing your own will * protect you during WooCommerce core updates. * * See: https://docs.woocommerce.com/document/disable-the-default-stylesheet/ @@ -64,7 +64,7 @@ add_filter( 'body_class', '_s_woocommerce_active_body_class' ); * @return integer number of products */ function _s_woocommerce_products_per_page() { - return intval( apply_filters( '_s_woocommerce_products_per_page', 12 ) ); + return absint( apply_filters( '_s_woocommerce_products_per_page', 12 ) ); } add_filter( 'loop_shop_per_page', '_s_woocommerce_products_per_page' ); @@ -75,7 +75,7 @@ add_filter( 'loop_shop_per_page', '_s_woocommerce_products_per_page' ); * @return integer number of columns */ function _s_woocommerce_thumbnail_columns() { - return intval( apply_filters( '_s_woocommerce_product_thumbnail_columns', 4 ) ); + return absint( apply_filters( '_s_woocommerce_product_thumbnail_columns', 4 ) ); } add_filter( 'woocommerce_product_thumbnails_columns', '_s_woocommerce_thumbnail_columns' ); @@ -86,7 +86,7 @@ add_filter( 'woocommerce_product_thumbnails_columns', '_s_woocommerce_thumbnail_ * @return integer products per row */ function _s_woocommerce_loop_columns() { - return intval( apply_filters( '_s_woocommerce_loop_columns', 3 ) ); + return absint( apply_filters( '_s_woocommerce_loop_columns', 3 ) ); } add_filter( 'loop_shop_columns', '_s_woocommerce_loop_columns' ); @@ -116,7 +116,7 @@ if ( ! function_exists( '_s_woocommerce_product_columns_wrapper' ) ) { */ function _s_woocommerce_product_columns_wrapper() { $columns = _s_woocommerce_loop_columns(); - echo '
'; + echo '
'; } } @@ -204,9 +204,10 @@ if ( ! function_exists( '_s_woocommerce_cart_link' ) ) { * @return void */ function _s_woocommerce_cart_link() { + /* translators: number of items in the mini cart. */ ?> - cart->get_cart_subtotal() ); ?> cart->get_cart_contents_count(), '_s' ), WC()->cart->get_cart_contents_count() ) );?> 'expand' ) ); ?> + cart->get_cart_subtotal() ); ?> cart->get_cart_contents_count(), '_s' ), WC()->cart->get_cart_contents_count() ) );?> Date: Tue, 1 Aug 2017 15:55:25 +0100 Subject: [PATCH 003/107] Add missing PHP opening and closing tags. --- inc/custom-header.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/inc/custom-header.php b/inc/custom-header.php index 39b5a1fc..91715e81 100644 --- a/inc/custom-header.php +++ b/inc/custom-header.php @@ -10,9 +10,11 @@ * * You can add the WooCommerce Mini Cart to header.php like so ... * - if ( function_exists( '_s_woocommerce_header_cart' ) ) { - _s_woocommerce_header_cart(); - } + * * @package _s */ From ee3aa735cf2e1e6ac324e317140b5a84f1b412bf Mon Sep 17 00:00:00 2001 From: Tiago Noronha Date: Tue, 1 Aug 2017 16:06:15 +0100 Subject: [PATCH 004/107] Move translators comment to the correct line. --- inc/woocommerce.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/woocommerce.php b/inc/woocommerce.php index 01de29eb..a5bb2db3 100644 --- a/inc/woocommerce.php +++ b/inc/woocommerce.php @@ -204,9 +204,9 @@ if ( ! function_exists( '_s_woocommerce_cart_link' ) ) { * @return void */ function _s_woocommerce_cart_link() { - /* translators: number of items in the mini cart. */ ?> + cart->get_cart_subtotal() ); ?> cart->get_cart_contents_count(), '_s' ), WC()->cart->get_cart_contents_count() ) );?> Date: Mon, 3 Jul 2017 10:43:21 +0100 Subject: [PATCH 005/107] _s: Add featured images to Post and Pages with the ability to hide them via Content Options. _s: Fix Travis CI error _s: Add missing coma in array --- inc/jetpack.php | 7 ++++++- inc/template-tags.php | 33 +++++++++++++++++++++++++++++++ template-parts/content-page.php | 2 ++ template-parts/content-search.php | 2 ++ template-parts/content.php | 2 ++ 5 files changed, 45 insertions(+), 1 deletion(-) diff --git a/inc/jetpack.php b/inc/jetpack.php index fda2615b..172afb81 100644 --- a/inc/jetpack.php +++ b/inc/jetpack.php @@ -27,7 +27,7 @@ function _s_jetpack_setup() { // Add theme support for Content Options. add_theme_support( 'jetpack-content-options', array( - 'post-details' => array( + 'post-details' => array( 'stylesheet' => '_s-style', 'date' => '.posted-on', 'categories' => '.cat-links', @@ -35,6 +35,11 @@ function _s_jetpack_setup() { '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 e4b9cf02..0ff12f1d 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -100,3 +100,36 @@ function _s_entry_footer() { ); } endif; + +if ( ! function_exists( '_s_post_thumbnail' ) ) : +/** + * Displays an optional post thumbnail. + * + * Wraps the post thumbnail in an anchor element on index views, or a div + * element when on single views. + */ +function _s_post_thumbnail() { + if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { + return; + } + + if ( is_singular() ) : + ?> + +
+ +
+ + + + + + ', '' ); ?> + +
+ +
diff --git a/template-parts/content.php b/template-parts/content.php index 6e3b38f0..8ffc61a5 100644 --- a/template-parts/content.php +++ b/template-parts/content.php @@ -26,6 +26,8 @@ endif; ?> + +
Date: Mon, 3 Jul 2017 10:43:21 +0100 Subject: [PATCH 006/107] _s: Add featured images to Post and Pages with the ability to hide them via Content Options. _s: Fix Travis CI error _s: Add missing coma in array --- inc/jetpack.php | 7 ++++++- inc/template-tags.php | 33 +++++++++++++++++++++++++++++++ template-parts/content-page.php | 2 ++ template-parts/content-search.php | 2 ++ template-parts/content.php | 2 ++ 5 files changed, 45 insertions(+), 1 deletion(-) diff --git a/inc/jetpack.php b/inc/jetpack.php index fda2615b..172afb81 100644 --- a/inc/jetpack.php +++ b/inc/jetpack.php @@ -27,7 +27,7 @@ function _s_jetpack_setup() { // Add theme support for Content Options. add_theme_support( 'jetpack-content-options', array( - 'post-details' => array( + 'post-details' => array( 'stylesheet' => '_s-style', 'date' => '.posted-on', 'categories' => '.cat-links', @@ -35,6 +35,11 @@ function _s_jetpack_setup() { '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 3260c44e..d1403d48 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -100,3 +100,36 @@ if ( ! function_exists( '_s_entry_footer' ) ) : ); } endif; + +if ( ! function_exists( '_s_post_thumbnail' ) ) : +/** + * Displays an optional post thumbnail. + * + * Wraps the post thumbnail in an anchor element on index views, or a div + * element when on single views. + */ +function _s_post_thumbnail() { + if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { + return; + } + + if ( is_singular() ) : + ?> + +
+ +
+ + + + + + ', '' ); ?> + +
+ +
diff --git a/template-parts/content.php b/template-parts/content.php index 6e3b38f0..8ffc61a5 100644 --- a/template-parts/content.php +++ b/template-parts/content.php @@ -26,6 +26,8 @@ endif; ?> + +
Date: Sun, 6 Aug 2017 23:44:38 +0100 Subject: [PATCH 007/107] Replace see with @link --- inc/woocommerce.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/woocommerce.php b/inc/woocommerce.php index a5bb2db3..4bbca770 100644 --- a/inc/woocommerce.php +++ b/inc/woocommerce.php @@ -10,7 +10,7 @@ /** * WooCommerce setup function. * - * See: https://docs.woocommerce.com/document/third-party-custom-theme-compatibility/ + * @link https://docs.woocommerce.com/document/third-party-custom-theme-compatibility/ * * @return void */ @@ -40,7 +40,7 @@ add_action( 'wp_enqueue_scripts', '_s_woocommerce_scripts' ); * Removing the default WooCommerce stylesheet and enqueing your own will * protect you during WooCommerce core updates. * - * See: https://docs.woocommerce.com/document/disable-the-default-stylesheet/ + * @link https://docs.woocommerce.com/document/disable-the-default-stylesheet/ */ add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' ); From 115319d2062f09f374098e72ee726e3854e7d4cf Mon Sep 17 00:00:00 2001 From: Tiago Noronha Date: Sun, 6 Aug 2017 23:46:41 +0100 Subject: [PATCH 008/107] Remove extra line break between the function and the hook. --- inc/woocommerce.php | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/inc/woocommerce.php b/inc/woocommerce.php index 4bbca770..e3f18880 100644 --- a/inc/woocommerce.php +++ b/inc/woocommerce.php @@ -20,7 +20,6 @@ function _s_woocommerce_setup() { add_theme_support( 'wc-product-gallery-lightbox' ); add_theme_support( 'wc-product-gallery-slider' ); } - add_action( 'after_setup_theme', '_s_woocommerce_setup' ); /** @@ -31,7 +30,6 @@ add_action( 'after_setup_theme', '_s_woocommerce_setup' ); function _s_woocommerce_scripts() { wp_enqueue_style( '_s-woocommerce-style', get_template_directory_uri() . '/woocommerce.css' ); } - add_action( 'wp_enqueue_scripts', '_s_woocommerce_scripts' ); /** @@ -55,7 +53,6 @@ function _s_woocommerce_active_body_class( $classes ) { return $classes; } - add_filter( 'body_class', '_s_woocommerce_active_body_class' ); /** @@ -66,7 +63,6 @@ add_filter( 'body_class', '_s_woocommerce_active_body_class' ); function _s_woocommerce_products_per_page() { return absint( apply_filters( '_s_woocommerce_products_per_page', 12 ) ); } - add_filter( 'loop_shop_per_page', '_s_woocommerce_products_per_page' ); /** @@ -77,7 +73,6 @@ add_filter( 'loop_shop_per_page', '_s_woocommerce_products_per_page' ); function _s_woocommerce_thumbnail_columns() { return absint( apply_filters( '_s_woocommerce_product_thumbnail_columns', 4 ) ); } - add_filter( 'woocommerce_product_thumbnails_columns', '_s_woocommerce_thumbnail_columns' ); /** @@ -88,7 +83,6 @@ add_filter( 'woocommerce_product_thumbnails_columns', '_s_woocommerce_thumbnail_ function _s_woocommerce_loop_columns() { return absint( apply_filters( '_s_woocommerce_loop_columns', 3 ) ); } - add_filter( 'loop_shop_columns', '_s_woocommerce_loop_columns' ); /** @@ -105,7 +99,6 @@ function _s_woocommerce_related_products_args( $args ) { return $args; } - add_filter( 'woocommerce_output_related_products_args', '_s_woocommerce_related_products_args' ); if ( ! function_exists( '_s_woocommerce_product_columns_wrapper' ) ) { @@ -119,7 +112,6 @@ if ( ! function_exists( '_s_woocommerce_product_columns_wrapper' ) ) { echo '
'; } } - add_action( 'woocommerce_before_shop_loop', '_s_woocommerce_product_columns_wrapper', 40 ); if ( ! function_exists( '_s_woocommerce_product_columns_wrapper_close' ) ) { @@ -132,7 +124,6 @@ if ( ! function_exists( '_s_woocommerce_product_columns_wrapper_close' ) ) { echo '
'; } } - add_action( 'woocommerce_after_shop_loop', '_s_woocommerce_product_columns_wrapper_close', 40 ); /** @@ -155,7 +146,6 @@ if ( ! function_exists( '_s_woocommerce_wrapper_before' ) ) { Date: Sun, 6 Aug 2017 23:49:25 +0100 Subject: [PATCH 009/107] Remove unnecessary filters. --- inc/woocommerce.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/woocommerce.php b/inc/woocommerce.php index e3f18880..edf801b4 100644 --- a/inc/woocommerce.php +++ b/inc/woocommerce.php @@ -61,7 +61,7 @@ add_filter( 'body_class', '_s_woocommerce_active_body_class' ); * @return integer number of products */ function _s_woocommerce_products_per_page() { - return absint( apply_filters( '_s_woocommerce_products_per_page', 12 ) ); + return 12; } add_filter( 'loop_shop_per_page', '_s_woocommerce_products_per_page' ); @@ -71,7 +71,7 @@ add_filter( 'loop_shop_per_page', '_s_woocommerce_products_per_page' ); * @return integer number of columns */ function _s_woocommerce_thumbnail_columns() { - return absint( apply_filters( '_s_woocommerce_product_thumbnail_columns', 4 ) ); + return 4; } add_filter( 'woocommerce_product_thumbnails_columns', '_s_woocommerce_thumbnail_columns' ); @@ -81,7 +81,7 @@ add_filter( 'woocommerce_product_thumbnails_columns', '_s_woocommerce_thumbnail_ * @return integer products per row */ function _s_woocommerce_loop_columns() { - return absint( apply_filters( '_s_woocommerce_loop_columns', 3 ) ); + return 3; } add_filter( 'loop_shop_columns', '_s_woocommerce_loop_columns' ); From b0a272a755344b7f88b0b33474be35da1c631182 Mon Sep 17 00:00:00 2001 From: Tiago Noronha Date: Sun, 6 Aug 2017 23:55:29 +0100 Subject: [PATCH 010/107] Merge array with wp_parse_args. --- inc/woocommerce.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/inc/woocommerce.php b/inc/woocommerce.php index edf801b4..64804c4c 100644 --- a/inc/woocommerce.php +++ b/inc/woocommerce.php @@ -92,11 +92,7 @@ add_filter( 'loop_shop_columns', '_s_woocommerce_loop_columns' ); * @return array $args related products args */ function _s_woocommerce_related_products_args( $args ) { - $args = apply_filters( '_s_woocommerce_related_products_args', array( - 'posts_per_page' => 3, - 'columns' => 3, - ) ); - + $args = wp_parse_args( array( 'posts_per_page' => 3, 'columns' => 3 ), $args ); return $args; } add_filter( 'woocommerce_output_related_products_args', '_s_woocommerce_related_products_args' ); From e72ba5b2911dc43bedd6552defa595a99ebd1be9 Mon Sep 17 00:00:00 2001 From: Tiago Noronha Date: Mon, 7 Aug 2017 00:00:35 +0100 Subject: [PATCH 011/107] Remove global variable. --- inc/woocommerce.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/inc/woocommerce.php b/inc/woocommerce.php index 64804c4c..b8e2f556 100644 --- a/inc/woocommerce.php +++ b/inc/woocommerce.php @@ -169,8 +169,6 @@ if ( ! function_exists( '_s_woocommerce_cart_link_fragment' ) ) { * @return array Fragments to refresh via AJAX */ function _s_woocommerce_cart_link_fragment( $fragments ) { - global $woocommerce; - ob_start(); _s_woocommerce_cart_link(); $fragments['a.cart-contents'] = ob_get_clean(); From 579ad2eeea3cf1c4926fe82e5868816747cdf31e Mon Sep 17 00:00:00 2001 From: Tiago Noronha Date: Mon, 7 Aug 2017 00:04:22 +0100 Subject: [PATCH 012/107] Second arg of the_widget is an array. --- inc/woocommerce.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/woocommerce.php b/inc/woocommerce.php index b8e2f556..7404f973 100644 --- a/inc/woocommerce.php +++ b/inc/woocommerce.php @@ -213,7 +213,7 @@ if ( ! function_exists( '_s_woocommerce_header_cart' ) ) {
  • - + '' ) ); ?>
  • Date: Mon, 7 Aug 2017 00:06:52 +0100 Subject: [PATCH 013/107] Move mini cart implementation example inside woocommerce.php --- inc/custom-header.php | 10 +--------- inc/woocommerce.php | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/inc/custom-header.php b/inc/custom-header.php index 91715e81..8e29a1cb 100644 --- a/inc/custom-header.php +++ b/inc/custom-header.php @@ -8,14 +8,6 @@ * * @link https://developer.wordpress.org/themes/functionality/custom-headers/ * - * You can add the WooCommerce Mini Cart to header.php like so ... - * - - * * @package _s */ @@ -77,4 +69,4 @@ if ( ! function_exists( '_s_header_style' ) ) : + * + * @package _s + */ + if ( ! function_exists( '_s_woocommerce_cart_link_fragment' ) ) { /** * Cart Fragments From 4081a62eae177d9291036cc3a25897795b07665d Mon Sep 17 00:00:00 2001 From: Tiago Noronha Date: Mon, 7 Aug 2017 00:14:51 +0100 Subject: [PATCH 014/107] Tweak mini cart implementation comment. --- inc/woocommerce.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/inc/woocommerce.php b/inc/woocommerce.php index 99920c76..aed612e3 100644 --- a/inc/woocommerce.php +++ b/inc/woocommerce.php @@ -170,8 +170,6 @@ add_action( 'woocommerce_after_main_content', '_s_woocommerce_wrapper_after' ); _s_woocommerce_header_cart(); } ?> - * - * @package _s */ if ( ! function_exists( '_s_woocommerce_cart_link_fragment' ) ) { From b87901e508a5905c407f48ea245ad445360003c0 Mon Sep 17 00:00:00 2001 From: Tiago Noronha Date: Fri, 18 Aug 2017 18:53:02 +0100 Subject: [PATCH 015/107] Add link to new product gallery documentation. --- inc/woocommerce.php | 1 + 1 file changed, 1 insertion(+) diff --git a/inc/woocommerce.php b/inc/woocommerce.php index aed612e3..40d524ab 100644 --- a/inc/woocommerce.php +++ b/inc/woocommerce.php @@ -11,6 +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 * * @return void */ From f26859169b2310aefca592b1b83dae98bed7c810 Mon Sep 17 00:00:00 2001 From: Tiago Noronha Date: Fri, 18 Aug 2017 19:03:03 +0100 Subject: [PATCH 016/107] Tweaks to docblocks. --- inc/woocommerce.php | 58 ++++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/inc/woocommerce.php b/inc/woocommerce.php index 40d524ab..4d8bc3c1 100644 --- a/inc/woocommerce.php +++ b/inc/woocommerce.php @@ -24,7 +24,7 @@ function _s_woocommerce_setup() { add_action( 'after_setup_theme', '_s_woocommerce_setup' ); /** - * WooCommerce specific scripts & stylesheets + * WooCommerce specific scripts & stylesheets. * * @return void */ @@ -34,7 +34,7 @@ function _s_woocommerce_scripts() { add_action( 'wp_enqueue_scripts', '_s_woocommerce_scripts' ); /** - * Disable the default WooCommerce stylesheet + * Disable the default WooCommerce stylesheet. * * Removing the default WooCommerce stylesheet and enqueing your own will * protect you during WooCommerce core updates. @@ -44,10 +44,10 @@ add_action( 'wp_enqueue_scripts', '_s_woocommerce_scripts' ); add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' ); /** - * Add 'woocommerce-active' class to the body tag + * Add 'woocommerce-active' class to the body tag. * - * @param array $classes css classes applied to the body tag. - * @return array $classes modified to include 'woocommerce-active' class + * @param array $classes CSS classes applied to the body tag. + * @return array $classes modified to include 'woocommerce-active' class. */ function _s_woocommerce_active_body_class( $classes ) { $classes[] = 'woocommerce-active'; @@ -57,9 +57,9 @@ function _s_woocommerce_active_body_class( $classes ) { add_filter( 'body_class', '_s_woocommerce_active_body_class' ); /** - * Products per page + * Products per page. * - * @return integer number of products + * @return integer number of products. */ function _s_woocommerce_products_per_page() { return 12; @@ -67,9 +67,9 @@ function _s_woocommerce_products_per_page() { add_filter( 'loop_shop_per_page', '_s_woocommerce_products_per_page' ); /** - * Product gallery thumnbail columns + * Product gallery thumnbail columns. * - * @return integer number of columns + * @return integer number of columns. */ function _s_woocommerce_thumbnail_columns() { return 4; @@ -77,9 +77,9 @@ function _s_woocommerce_thumbnail_columns() { add_filter( 'woocommerce_product_thumbnails_columns', '_s_woocommerce_thumbnail_columns' ); /** - * Default loop columns on product archives + * Default loop columns on product archives. * - * @return integer products per row + * @return integer products per row. */ function _s_woocommerce_loop_columns() { return 3; @@ -87,10 +87,10 @@ function _s_woocommerce_loop_columns() { add_filter( 'loop_shop_columns', '_s_woocommerce_loop_columns' ); /** - * Related Products Args + * Related Products Args. * * @param array $args related products args. - * @return array $args related products args + * @return array $args related products args. */ function _s_woocommerce_related_products_args( $args ) { $args = wp_parse_args( array( 'posts_per_page' => 3, 'columns' => 3 ), $args ); @@ -100,7 +100,7 @@ add_filter( 'woocommerce_output_related_products_args', '_s_woocommerce_related_ if ( ! function_exists( '_s_woocommerce_product_columns_wrapper' ) ) { /** - * Product columns wrapper + * Product columns wrapper. * * @return void */ @@ -113,7 +113,7 @@ add_action( 'woocommerce_before_shop_loop', '_s_woocommerce_product_columns_wrap if ( ! function_exists( '_s_woocommerce_product_columns_wrapper_close' ) ) { /** - * Product columns wrapper close + * Product columns wrapper close. * * @return void */ @@ -124,15 +124,16 @@ if ( ! function_exists( '_s_woocommerce_product_columns_wrapper_close' ) ) { add_action( 'woocommerce_after_shop_loop', '_s_woocommerce_product_columns_wrapper_close', 40 ); /** - * Remove default WooCommerce wrapper + * Remove default WooCommerce wrapper. */ remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10 ); remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10 ); if ( ! function_exists( '_s_woocommerce_wrapper_before' ) ) { /** - * Before Content - * Wraps all WooCommerce content in wrappers which match the theme markup + * Before Content. + * + * Wraps all WooCommerce content in wrappers which match the theme markup. * * @return void */ @@ -147,8 +148,9 @@ add_action( 'woocommerce_before_main_content', '_s_woocommerce_wrapper_before' ) if ( ! function_exists( '_s_woocommerce_wrapper_after' ) ) { /** - * After Content - * Closes the wrapping divs + * After Content. + * + * Closes the wrapping divs. * * @return void */ @@ -162,7 +164,7 @@ if ( ! function_exists( '_s_woocommerce_wrapper_after' ) ) { add_action( 'woocommerce_after_main_content', '_s_woocommerce_wrapper_after' ); /** - * Sample implementation of the WooCommerce Mini Cart + * Sample implementation of the WooCommerce Mini Cart. * * You can add the WooCommerce Mini Cart to header.php like so ... * @@ -175,11 +177,12 @@ add_action( 'woocommerce_after_main_content', '_s_woocommerce_wrapper_after' ); if ( ! function_exists( '_s_woocommerce_cart_link_fragment' ) ) { /** - * Cart Fragments - * Ensure cart contents update when products are added to the cart via AJAX + * Cart Fragments. + * + * Ensure cart contents update when products are added to the cart via AJAX. * * @param array $fragments Fragments to refresh via AJAX. - * @return array Fragments to refresh via AJAX + * @return array Fragments to refresh via AJAX. */ function _s_woocommerce_cart_link_fragment( $fragments ) { ob_start(); @@ -193,8 +196,9 @@ add_filter( 'woocommerce_add_to_cart_fragments', '_s_woocommerce_cart_link_fragm if ( ! function_exists( '_s_woocommerce_cart_link' ) ) { /** - * Cart Link - * Displayed a link to the cart including the number of items present and the cart total + * Cart Link. + * + * Displayed a link to the cart including the number of items present and the cart total. * * @return void */ @@ -210,7 +214,7 @@ if ( ! function_exists( '_s_woocommerce_cart_link' ) ) { if ( ! function_exists( '_s_woocommerce_header_cart' ) ) { /** - * Display Header Cart + * Display Header Cart. * * @return void */ From 7cb40fa6cef4e1c4d6e95fc5bff65e66db86ba4e Mon Sep 17 00:00:00 2001 From: Tiago Noronha Date: Fri, 18 Aug 2017 19:09:44 +0100 Subject: [PATCH 017/107] Associative arrays keys should start on a new line. --- inc/woocommerce.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/inc/woocommerce.php b/inc/woocommerce.php index 4d8bc3c1..7d2d85b1 100644 --- a/inc/woocommerce.php +++ b/inc/woocommerce.php @@ -93,7 +93,13 @@ add_filter( 'loop_shop_columns', '_s_woocommerce_loop_columns' ); * @return array $args related products args. */ function _s_woocommerce_related_products_args( $args ) { - $args = wp_parse_args( array( 'posts_per_page' => 3, 'columns' => 3 ), $args ); + $defaults = array( + 'posts_per_page' => 3, + 'columns' => 3 + ); + + $args = wp_parse_args( $defaults, $args ); + return $args; } add_filter( 'woocommerce_output_related_products_args', '_s_woocommerce_related_products_args' ); @@ -230,7 +236,13 @@ if ( ! function_exists( '_s_woocommerce_header_cart' ) ) {
  • - '' ) ); ?> + '' + ); + + the_widget( 'WC_Widget_Cart', $instance ); + ?>
  • Date: Fri, 18 Aug 2017 19:10:10 +0100 Subject: [PATCH 018/107] Newline character. --- inc/custom-header.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/custom-header.php b/inc/custom-header.php index 8e29a1cb..97b1db28 100644 --- a/inc/custom-header.php +++ b/inc/custom-header.php @@ -69,4 +69,4 @@ if ( ! function_exists( '_s_header_style' ) ) : Date: Fri, 18 Aug 2017 19:13:21 +0100 Subject: [PATCH 019/107] Add commas to each array value. --- inc/woocommerce.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/woocommerce.php b/inc/woocommerce.php index 7d2d85b1..9413c51e 100644 --- a/inc/woocommerce.php +++ b/inc/woocommerce.php @@ -95,7 +95,7 @@ add_filter( 'loop_shop_columns', '_s_woocommerce_loop_columns' ); function _s_woocommerce_related_products_args( $args ) { $defaults = array( 'posts_per_page' => 3, - 'columns' => 3 + 'columns' => 3, ); $args = wp_parse_args( $defaults, $args ); @@ -238,7 +238,7 @@ if ( ! function_exists( '_s_woocommerce_header_cart' ) ) {
  • '' + 'title' => '', ); the_widget( 'WC_Widget_Cart', $instance ); From af3353c783e55cf553e5ae42c9cdff226e8c7591 Mon Sep 17 00:00:00 2001 From: Tiago Noronha Date: Wed, 23 Aug 2017 17:13:49 +0100 Subject: [PATCH 020/107] Fix column-width sass mixin. --- sass/mixins/_mixins-master.scss | 2 +- woocommerce.css | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sass/mixins/_mixins-master.scss b/sass/mixins/_mixins-master.scss index ba81d023..cf5d8863 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 ) ) / 3 ); + width: map-get( $columns, $numberColumns ) - ( ( $columns__margin * ( $numberColumns - 1 ) ) / $numberColumns ); } \ No newline at end of file diff --git a/woocommerce.css b/woocommerce.css index ef900445..d9aa9c53 100644 --- a/woocommerce.css +++ b/woocommerce.css @@ -96,15 +96,15 @@ ul.products { float: none; width: 100%; } .columns-2 ul.products li.product { - width: 48.7333333333%; } + width: 48.1%; } .columns-3 ul.products li.product { width: 30.7966666667%; } .columns-4 ul.products li.product { - width: 21.2%; } + width: 22.15%; } .columns-5 ul.products li.product { - width: 14.9333333333%; } + width: 16.96%; } .columns-6 ul.products li.product { - width: 10.3266666667%; } } + width: 13.4933333333%; } } /** * Single product @@ -144,7 +144,7 @@ ul.products { .single-product div.product .woocommerce-product-gallery .flex-control-thumbs li:hover img { opacity: 1; } .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-2 .flex-control-thumbs li { - width: 48.7333333333%; } + width: 48.1%; } .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-2 .flex-control-thumbs li:nth-child(2n) { margin-right: 0; } .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-2 .flex-control-thumbs li:nth-child(2n+1) { @@ -156,13 +156,13 @@ ul.products { .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-3 .flex-control-thumbs li:nth-child(3n+1) { clear: both; } .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-4 .flex-control-thumbs li { - width: 21.2%; } + width: 22.15%; } .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-4 .flex-control-thumbs li:nth-child(4n) { margin-right: 0; } .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-4 .flex-control-thumbs li:nth-child(4n+1) { clear: both; } .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-5 .flex-control-thumbs li { - width: 14.9333333333%; } + width: 16.96%; } .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-5 .flex-control-thumbs li:nth-child(5n) { margin-right: 0; } .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-5 .flex-control-thumbs li:nth-child(5n+1) { @@ -192,7 +192,7 @@ ul.products { margin-right: 0; } .col2-set .form-row-first, .col2-set .form-row-last { - width: 48.7333333333%; } } + width: 48.1%; } } /** * General WooCommerce components From db7f3ed04f028fbe3f4f9241643b4a6fb1c32f88 Mon Sep 17 00:00:00 2001 From: Jeffrey Pearce Date: Fri, 25 Aug 2017 16:52:26 +0200 Subject: [PATCH 021/107] Adds WooCommerce plugin file paths. Related Pull Request #1191 --- sass/woocommerce.scss | 16 +++++++++++----- woocommerce.css | 3 +++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/sass/woocommerce.scss b/sass/woocommerce.scss index 2d259d39..6a67e2eb 100644 --- a/sass/woocommerce.scss +++ b/sass/woocommerce.scss @@ -4,6 +4,12 @@ Theme Name: _s WooCommerce styles override */ +/** + * WooCommerce Plugin path variables + */ +$woocommerce__plugin-path: '../../plugins/woocommerce/'; +$woocommerce__plugin-assets-font-path: '#{$woocommerce__plugin-path}assets/fonts/'; + /** * WooCommerce color variables */ @@ -22,11 +28,11 @@ $woocommerce__color-info: #3D9CD2; */ @font-face { font-family: 'star'; - src: url('../../plugins/woocommerce/assets/fonts/star.eot'); - src: url('../../plugins/woocommerce/assets/fonts/star.eot?#iefix') format('embedded-opentype'), - url('../../plugins/woocommerce/assets/fonts/star.woff') format('woff'), - url('../../plugins/woocommerce/assets/fonts/star.ttf') format('truetype'), - url('../../plugins/woocommerce/assets/fonts/star.svg#star') format('svg'); + src: url('#{$woocommerce__plugin-assets-font-path}star.eot'); + src: url('#{$woocommerce__plugin-assets-font-path}star.eot?#iefix') format('embedded-opentype'), + url('#{$woocommerce__plugin-assets-font-path}star.woff') format('woff'), + url('#{$woocommerce__plugin-assets-font-path}star.ttf') format('truetype'), + url('#{$woocommerce__plugin-assets-font-path}star.svg#star') format('svg'); font-weight: normal; font-style: normal; } diff --git a/woocommerce.css b/woocommerce.css index d9aa9c53..c3dcbac8 100644 --- a/woocommerce.css +++ b/woocommerce.css @@ -3,6 +3,9 @@ Theme Name: _s WooCommerce styles override */ +/** + * WooCommerce Plugin path variables + */ /** * WooCommerce color variables */ From 24b0596c716d3cfa4a3474d43f3c099abaec9158 Mon Sep 17 00:00:00 2001 From: Tiago Noronha Date: Mon, 28 Aug 2017 22:15:22 +0100 Subject: [PATCH 022/107] Load WooCommerce Star fonts via inline styles. --- inc/woocommerce.php | 14 ++++++++++++++ sass/woocommerce.scss | 20 -------------------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/inc/woocommerce.php b/inc/woocommerce.php index 9413c51e..3f664bf8 100644 --- a/inc/woocommerce.php +++ b/inc/woocommerce.php @@ -30,6 +30,20 @@ add_action( 'after_setup_theme', '_s_woocommerce_setup' ); */ function _s_woocommerce_scripts() { wp_enqueue_style( '_s-woocommerce-style', get_template_directory_uri() . '/woocommerce.css' ); + + $font_path = WC()->plugin_url() . '/assets/fonts/'; + $inline_font = '@font-face { + font-family: "star"; + src: url("' . $font_path . 'star.eot"); + src: url("' . $font_path . 'star.eot?#iefix") format("embedded-opentype"), + url("' . $font_path . 'star.woff") format("woff"), + url("' . $font_path . 'star.ttf") format("truetype"), + url("' . $font_path . 'star.svg#star") format("svg"); + font-weight: normal; + font-style: normal; + }'; + + wp_add_inline_style( '_s-woocommerce-style', $inline_font ); } add_action( 'wp_enqueue_scripts', '_s_woocommerce_scripts' ); diff --git a/sass/woocommerce.scss b/sass/woocommerce.scss index 6a67e2eb..4cf57490 100644 --- a/sass/woocommerce.scss +++ b/sass/woocommerce.scss @@ -4,12 +4,6 @@ Theme Name: _s WooCommerce styles override */ -/** - * WooCommerce Plugin path variables - */ -$woocommerce__plugin-path: '../../plugins/woocommerce/'; -$woocommerce__plugin-assets-font-path: '#{$woocommerce__plugin-path}assets/fonts/'; - /** * WooCommerce color variables */ @@ -23,20 +17,6 @@ $woocommerce__color-info: #3D9CD2; @import "variables-site/variables-site"; @import "mixins/mixins-master"; -/** - * Fonts - */ -@font-face { - font-family: 'star'; - src: url('#{$woocommerce__plugin-assets-font-path}star.eot'); - src: url('#{$woocommerce__plugin-assets-font-path}star.eot?#iefix') format('embedded-opentype'), - url('#{$woocommerce__plugin-assets-font-path}star.woff') format('woff'), - url('#{$woocommerce__plugin-assets-font-path}star.ttf') format('truetype'), - url('#{$woocommerce__plugin-assets-font-path}star.svg#star') format('svg'); - font-weight: normal; - font-style: normal; -} - /** * Shop tables */ From 5f5eaa4bbfb5c0672d26fed142f8ad51bb819b55 Mon Sep 17 00:00:00 2001 From: Tiago Noronha Date: Wed, 30 Aug 2017 12:03:53 +0100 Subject: [PATCH 023/107] File must end with a newline character. --- sass/mixins/_mixins-master.scss | 2 +- sass/shop/_checkout.scss | 2 +- sass/shop/_components.scss | 6 +++--- sass/shop/_products.scss | 2 +- sass/shop/_single-product.scss | 2 +- sass/shop/_tables.scss | 2 +- sass/shop/_widgets.scss | 2 +- sass/woocommerce.scss | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sass/mixins/_mixins-master.scss b/sass/mixins/_mixins-master.scss index cf5d8863..2578a21c 100644 --- a/sass/mixins/_mixins-master.scss +++ b/sass/mixins/_mixins-master.scss @@ -26,4 +26,4 @@ // Column width with margin @mixin column-width($numberColumns: 3) { width: map-get( $columns, $numberColumns ) - ( ( $columns__margin * ( $numberColumns - 1 ) ) / $numberColumns ); -} \ No newline at end of file +} diff --git a/sass/shop/_checkout.scss b/sass/shop/_checkout.scss index 145ca0fa..3aebbcc9 100644 --- a/sass/shop/_checkout.scss +++ b/sass/shop/_checkout.scss @@ -18,4 +18,4 @@ @include column-width(2); } } -} \ No newline at end of file +} diff --git a/sass/shop/_components.scss b/sass/shop/_components.scss index 02e1f8ca..413a5aaf 100644 --- a/sass/shop/_components.scss +++ b/sass/shop/_components.scss @@ -141,7 +141,7 @@ p.stars { .woocommerce-tabs { ul.tabs { list-style: none; - margin: 0; + margin: 0; padding: 0; text-align: left; @@ -213,7 +213,7 @@ p.stars { */ .woocommerce-message, .woocommerce-info, -.woocommerce-error, +.woocommerce-error, .woocommerce-noreviews, p.no-comments { @include clearfix; @@ -272,4 +272,4 @@ p.no-comments { } } } -} \ No newline at end of file +} diff --git a/sass/shop/_products.scss b/sass/shop/_products.scss index 7f8b0e2b..3d4dd985 100644 --- a/sass/shop/_products.scss +++ b/sass/shop/_products.scss @@ -60,4 +60,4 @@ ul.products { } } } -} \ No newline at end of file +} diff --git a/sass/shop/_single-product.scss b/sass/shop/_single-product.scss index 30fd418a..7c0fe1c3 100644 --- a/sass/shop/_single-product.scss +++ b/sass/shop/_single-product.scss @@ -80,4 +80,4 @@ &.out-of-stock { color: $woocommerce__color-error; } -} \ No newline at end of file +} diff --git a/sass/shop/_tables.scss b/sass/shop/_tables.scss index 819c75eb..0b282811 100644 --- a/sass/shop/_tables.scss +++ b/sass/shop/_tables.scss @@ -76,4 +76,4 @@ table.shop_table_responsive { } } } -} \ No newline at end of file +} diff --git a/sass/shop/_widgets.scss b/sass/shop/_widgets.scss index ff81f035..82f2bda9 100644 --- a/sass/shop/_widgets.scss +++ b/sass/shop/_widgets.scss @@ -61,4 +61,4 @@ .ui-slider-horizontal .ui-slider-range { height: 100%; } -} \ No newline at end of file +} diff --git a/sass/woocommerce.scss b/sass/woocommerce.scss index 4cf57490..e8b987eb 100644 --- a/sass/woocommerce.scss +++ b/sass/woocommerce.scss @@ -45,4 +45,4 @@ $woocommerce__color-info: #3D9CD2; /** * WooCommerce widgets */ -@import "shop/widgets"; \ No newline at end of file +@import "shop/widgets"; From 649b59d0633a9e66379e9b5c47401e58c9604983 Mon Sep 17 00:00:00 2001 From: Tiago Noronha Date: Wed, 30 Aug 2017 12:14:55 +0100 Subject: [PATCH 024/107] New lines and spacing. --- sass/shop/_widgets.scss | 2 +- sass/variables-site/_columns.scss | 2 +- sass/variables-site/_variables-site.scss | 2 +- style.css | 768 ++++++++++++++--------- woocommerce.css | 748 +++++++++++++--------- 5 files changed, 909 insertions(+), 613 deletions(-) diff --git a/sass/shop/_widgets.scss b/sass/shop/_widgets.scss index 82f2bda9..63324b2d 100644 --- a/sass/shop/_widgets.scss +++ b/sass/shop/_widgets.scss @@ -42,7 +42,7 @@ } } - .ui-slider .ui-slider-range { + .ui-slider .ui-slider-range { position: absolute; z-index: 1; display: block; diff --git a/sass/variables-site/_columns.scss b/sass/variables-site/_columns.scss index f27e24ce..27918b3e 100644 --- a/sass/variables-site/_columns.scss +++ b/sass/variables-site/_columns.scss @@ -10,4 +10,4 @@ $columns: ( 9: 11.11% ); -$columns__margin: 3.8%; \ No newline at end of file +$columns__margin: 3.8%; diff --git a/sass/variables-site/_variables-site.scss b/sass/variables-site/_variables-site.scss index 6325541c..1b23d510 100644 --- a/sass/variables-site/_variables-site.scss +++ b/sass/variables-site/_variables-site.scss @@ -1,4 +1,4 @@ @import "colors"; @import "typography"; @import "structure"; -@import "columns"; \ No newline at end of file +@import "columns"; diff --git a/style.css b/style.css index c754193a..bd787e1d 100644 --- a/style.css +++ b/style.css @@ -45,12 +45,14 @@ Nicolas Gallagher and Jonathan Neal http://necolas.github.io/normalize.css/ # Normalize --------------------------------------------------------------*/ html { - font-family: sans-serif; - -webkit-text-size-adjust: 100%; - -ms-text-size-adjust: 100%; } + font-family: sans-serif; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; +} body { - margin: 0; } + margin: 0; +} article, aside, @@ -64,157 +66,194 @@ menu, nav, section, summary { - display: block; } + display: block; +} audio, canvas, progress, video { - display: inline-block; - vertical-align: baseline; } + display: inline-block; + vertical-align: baseline; +} audio:not([controls]) { - display: none; - height: 0; } + display: none; + height: 0; +} [hidden], template { - display: none; } + display: none; +} a { - background-color: transparent; } + background-color: transparent; +} a:active, a:hover { - outline: 0; } + outline: 0; +} abbr[title] { - border-bottom: 1px dotted; } + border-bottom: 1px dotted; +} b, strong { - font-weight: bold; } + font-weight: bold; +} dfn { - font-style: italic; } + font-style: italic; +} h1 { - font-size: 2em; - margin: 0.67em 0; } + font-size: 2em; + margin: 0.67em 0; +} mark { - background: #ff0; - color: #000; } + background: #ff0; + color: #000; +} small { - font-size: 80%; } + font-size: 80%; +} sub, sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; } + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} sup { - top: -0.5em; } + top: -0.5em; +} sub { - bottom: -0.25em; } + bottom: -0.25em; +} img { - border: 0; } + border: 0; +} svg:not(:root) { - overflow: hidden; } + overflow: hidden; +} figure { - margin: 1em 40px; } + margin: 1em 40px; +} hr { - box-sizing: content-box; - height: 0; } + box-sizing: content-box; + height: 0; +} pre { - overflow: auto; } + overflow: auto; +} code, kbd, pre, samp { - font-family: monospace, monospace; - font-size: 1em; } + font-family: monospace, monospace; + font-size: 1em; +} button, input, optgroup, select, textarea { - color: inherit; - font: inherit; - margin: 0; } + color: inherit; + font: inherit; + margin: 0; +} button { - overflow: visible; } + overflow: visible; +} button, select { - text-transform: none; } + text-transform: none; +} button, html input[type="button"], input[type="reset"], input[type="submit"] { - -webkit-appearance: button; - cursor: pointer; } + -webkit-appearance: button; + cursor: pointer; +} button[disabled], html input[disabled] { - cursor: default; } + cursor: default; +} button::-moz-focus-inner, input::-moz-focus-inner { - border: 0; - padding: 0; } + border: 0; + padding: 0; +} input { - line-height: normal; } + line-height: normal; +} input[type="checkbox"], input[type="radio"] { - box-sizing: border-box; - padding: 0; } + box-sizing: border-box; + padding: 0; +} input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { - height: auto; } + height: auto; +} input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; } + -webkit-appearance: none; +} fieldset { - border: 1px solid #c0c0c0; - margin: 0 2px; - padding: 0.35em 0.625em 0.75em; } + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} legend { - border: 0; - padding: 0; } + border: 0; + padding: 0; +} textarea { - overflow: auto; } + overflow: auto; +} optgroup { - font-weight: bold; } + font-weight: bold; +} table { - border-collapse: collapse; - border-spacing: 0; } + border-collapse: collapse; + border-spacing: 0; +} td, th { - padding: 0; } + padding: 0; +} /*-------------------------------------------------------------- # Typography @@ -225,114 +264,141 @@ input, select, optgroup, textarea { - color: #404040; - font-family: sans-serif; - font-size: 16px; - font-size: 1rem; - line-height: 1.5; } + color: #404040; + font-family: sans-serif; + font-size: 16px; + font-size: 1rem; + line-height: 1.5; +} h1, h2, h3, h4, h5, h6 { - clear: both; } + clear: both; +} p { - margin-bottom: 1.5em; } + margin-bottom: 1.5em; +} dfn, cite, em, i { - font-style: italic; } + font-style: italic; +} blockquote { - margin: 0 1.5em; } + margin: 0 1.5em; +} address { - margin: 0 0 1.5em; } + margin: 0 0 1.5em; +} pre { - background: #eee; - font-family: "Courier 10 Pitch", Courier, monospace; - font-size: 15px; - font-size: 0.9375rem; - line-height: 1.6; - margin-bottom: 1.6em; - max-width: 100%; - overflow: auto; - padding: 1.6em; } + background: #eee; + font-family: "Courier 10 Pitch", Courier, monospace; + font-size: 15px; + font-size: 0.9375rem; + line-height: 1.6; + margin-bottom: 1.6em; + max-width: 100%; + overflow: auto; + padding: 1.6em; +} code, kbd, tt, var { - font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; - font-size: 15px; - font-size: 0.9375rem; } + font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; + font-size: 15px; + font-size: 0.9375rem; +} abbr, acronym { - border-bottom: 1px dotted #666; - cursor: help; } + border-bottom: 1px dotted #666; + cursor: help; +} mark, ins { - background: #fff9c0; - text-decoration: none; } + background: #fff9c0; + text-decoration: none; +} big { - font-size: 125%; } + font-size: 125%; +} /*-------------------------------------------------------------- # Elements --------------------------------------------------------------*/ html { - box-sizing: border-box; } + box-sizing: border-box; +} *, *:before, *:after { - /* Inherit box-sizing to make it easier to change the property for components that leverage other behavior; see http://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ */ - box-sizing: inherit; } + /* Inherit box-sizing to make it easier to change the property for components that leverage other behavior; see http://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. */ } + background: #fff; + /* Fallback for when there is no custom background color defined. */ +} blockquote, q { - quotes: "" ""; } - blockquote:before, blockquote:after, q:before, q:after { - content: ""; } + quotes: "" ""; +} + +blockquote:before, blockquote:after, q:before, q:after { + content: ""; +} hr { - background-color: #ccc; - border: 0; - height: 1px; - margin-bottom: 1.5em; } + background-color: #ccc; + border: 0; + height: 1px; + margin-bottom: 1.5em; +} ul, ol { - margin: 0 0 1.5em 3em; } + margin: 0 0 1.5em 3em; +} ul { - list-style: disc; } + list-style: disc; +} ol { - list-style: decimal; } + list-style: decimal; +} li > ul, li > ol { - margin-bottom: 0; - margin-left: 1.5em; } + margin-bottom: 0; + margin-left: 1.5em; +} dt { - font-weight: bold; } + font-weight: bold; +} dd { - margin: 0 1.5em 1.5em; } + margin: 0 1.5em 1.5em; +} 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. */ +} table { - margin: 0 0 1.5em; - width: 100%; } + margin: 0 0 1.5em; + width: 100%; +} /*-------------------------------------------------------------- # Forms @@ -341,28 +407,33 @@ button, input[type="button"], input[type="reset"], input[type="submit"] { - border: 1px solid; - border-color: #ccc #ccc #bbb; - border-radius: 3px; - background: #e6e6e6; - color: rgba(0, 0, 0, 0.8); - font-size: 12px; - font-size: 0.75rem; - line-height: 1; - padding: .6em 1em .4em; } - button:hover, - input[type="button"]:hover, - input[type="reset"]:hover, - input[type="submit"]:hover { - border-color: #ccc #bbb #aaa; } - button:active, button:focus, - input[type="button"]:active, - input[type="button"]:focus, - input[type="reset"]:active, - input[type="reset"]:focus, - input[type="submit"]:active, - input[type="submit"]:focus { - border-color: #aaa #bbb #bbb; } + border: 1px solid; + border-color: #ccc #ccc #bbb; + border-radius: 3px; + background: #e6e6e6; + color: rgba(0, 0, 0, 0.8); + font-size: 12px; + font-size: 0.75rem; + line-height: 1; + padding: .6em 1em .4em; +} + +button:hover, +input[type="button"]:hover, +input[type="reset"]:hover, +input[type="submit"]:hover { + border-color: #ccc #bbb #aaa; +} + +button:active, button:focus, +input[type="button"]:active, +input[type="button"]:focus, +input[type="reset"]:active, +input[type="reset"]:focus, +input[type="submit"]:active, +input[type="submit"]:focus { + border-color: #aaa #bbb #bbb; +} input[type="text"], input[type="email"], @@ -380,33 +451,38 @@ input[type="datetime"], input[type="datetime-local"], input[type="color"], textarea { - color: #666; - border: 1px solid #ccc; - border-radius: 3px; - padding: 3px; } - input[type="text"]:focus, - input[type="email"]:focus, - input[type="url"]:focus, - input[type="password"]:focus, - input[type="search"]:focus, - input[type="number"]:focus, - input[type="tel"]:focus, - input[type="range"]:focus, - input[type="date"]:focus, - input[type="month"]:focus, - input[type="week"]:focus, - input[type="time"]:focus, - input[type="datetime"]:focus, - input[type="datetime-local"]:focus, - input[type="color"]:focus, - textarea:focus { - color: #111; } + color: #666; + border: 1px solid #ccc; + border-radius: 3px; + padding: 3px; +} + +input[type="text"]:focus, +input[type="email"]:focus, +input[type="url"]:focus, +input[type="password"]:focus, +input[type="search"]:focus, +input[type="number"]:focus, +input[type="tel"]:focus, +input[type="range"]:focus, +input[type="date"]:focus, +input[type="month"]:focus, +input[type="week"]:focus, +input[type="time"]:focus, +input[type="datetime"]:focus, +input[type="datetime-local"]:focus, +input[type="color"]:focus, +textarea:focus { + color: #111; +} select { - border: 1px solid #ccc; } + border: 1px solid #ccc; +} textarea { - width: 100%; } + width: 100%; +} /*-------------------------------------------------------------- # Navigation @@ -415,138 +491,178 @@ textarea { ## Links --------------------------------------------------------------*/ a { - color: royalblue; } - a:visited { - color: purple; } - a:hover, a:focus, a:active { - color: midnightblue; } - a:focus { - outline: thin dotted; } - a:hover, a:active { - outline: 0; } + color: royalblue; +} + +a:visited { + color: purple; +} + +a:hover, a:focus, a:active { + color: midnightblue; +} + +a:focus { + outline: thin dotted; +} + +a:hover, a:active { + outline: 0; +} /*-------------------------------------------------------------- ## Menus --------------------------------------------------------------*/ .main-navigation { - clear: both; - display: block; - float: left; - width: 100%; } - .main-navigation ul { - display: none; - list-style: none; - margin: 0; - padding-left: 0; } - .main-navigation ul ul { - box-shadow: 0 3px 3px rgba(0, 0, 0, 0.2); - float: left; - position: absolute; - top: 100%; - left: -999em; - z-index: 99999; } - .main-navigation ul ul ul { - left: -999em; - top: 0; } - .main-navigation ul ul li:hover > ul, - .main-navigation ul ul li.focus > ul { - left: 100%; } - .main-navigation ul ul a { - width: 200px; } - .main-navigation ul li:hover > ul, - .main-navigation ul li.focus > ul { - left: auto; } - .main-navigation li { - float: left; - position: relative; } - .main-navigation a { - display: block; - text-decoration: none; } + clear: both; + display: block; + float: left; + width: 100%; +} + +.main-navigation ul { + display: none; + list-style: none; + margin: 0; + padding-left: 0; +} + +.main-navigation ul ul { + box-shadow: 0 3px 3px rgba(0, 0, 0, 0.2); + float: left; + position: absolute; + top: 100%; + left: -999em; + z-index: 99999; +} + +.main-navigation ul ul ul { + left: -999em; + top: 0; +} + +.main-navigation ul ul li:hover > ul, +.main-navigation ul ul li.focus > ul { + left: 100%; +} + +.main-navigation ul ul a { + width: 200px; +} + +.main-navigation ul li:hover > ul, +.main-navigation ul li.focus > ul { + left: auto; +} + +.main-navigation li { + float: left; + position: relative; +} + +.main-navigation a { + display: block; + text-decoration: none; +} /* Small menu. */ .menu-toggle, .main-navigation.toggled ul { - display: block; } + display: block; +} @media screen and (min-width: 37.5em) { - .menu-toggle { - display: none; } - .main-navigation ul { - display: block; } } + .menu-toggle { + display: none; + } + .main-navigation ul { + display: block; + } +} .site-main .comment-navigation, .site-main .posts-navigation, .site-main .post-navigation { - margin: 0 0 1.5em; - overflow: hidden; } + margin: 0 0 1.5em; + overflow: hidden; +} .comment-navigation .nav-previous, .posts-navigation .nav-previous, .post-navigation .nav-previous { - float: left; - width: 50%; } + float: left; + width: 50%; +} .comment-navigation .nav-next, .posts-navigation .nav-next, .post-navigation .nav-next { - float: right; - text-align: right; - width: 50%; } + float: right; + text-align: right; + width: 50%; +} /*-------------------------------------------------------------- # Accessibility --------------------------------------------------------------*/ /* Text meant only for screen readers. */ .screen-reader-text { - clip: rect(1px, 1px, 1px, 1px); - position: absolute !important; - height: 1px; - width: 1px; - overflow: hidden; - word-wrap: normal !important; - /* Many screen reader and browser combinations announce broken words as they would appear visually. */ } - .screen-reader-text:focus { - background-color: #f1f1f1; - border-radius: 3px; - box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6); - clip: auto !important; - color: #21759b; - display: block; - font-size: 14px; - font-size: 0.875rem; - font-weight: bold; - height: auto; - left: 5px; - line-height: normal; - padding: 15px 23px 14px; - text-decoration: none; - top: 5px; - width: auto; - z-index: 100000; - /* Above WP toolbar. */ } + clip: rect(1px, 1px, 1px, 1px); + position: absolute !important; + height: 1px; + width: 1px; + overflow: hidden; + word-wrap: normal !important; + /* Many screen reader and browser combinations announce broken words as they would appear visually. */ +} + +.screen-reader-text:focus { + background-color: #f1f1f1; + border-radius: 3px; + box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6); + clip: auto !important; + color: #21759b; + display: block; + font-size: 14px; + font-size: 0.875rem; + font-weight: bold; + height: auto; + left: 5px; + line-height: normal; + padding: 15px 23px 14px; + text-decoration: none; + top: 5px; + width: auto; + z-index: 100000; + /* Above WP toolbar. */ +} /* Do not show the outline on the skip link target. */ #content[tabindex="-1"]:focus { - outline: 0; } + outline: 0; +} /*-------------------------------------------------------------- # Alignments --------------------------------------------------------------*/ .alignleft { - display: inline; - float: left; - margin-right: 1.5em; } + display: inline; + float: left; + margin-right: 1.5em; +} .alignright { - display: inline; - float: right; - margin-left: 1.5em; } + display: inline; + float: right; + margin-left: 1.5em; +} .aligncenter { - clear: both; - display: block; - margin-left: auto; - margin-right: auto; } + clear: both; + display: block; + margin-left: auto; + margin-right: auto; +} /*-------------------------------------------------------------- # Clearings @@ -563,9 +679,10 @@ a { .site-content:after, .site-footer:before, .site-footer:after { - content: ""; - display: table; - table-layout: fixed; } + content: ""; + display: table; + table-layout: fixed; +} .clear:after, .entry-content:after, @@ -573,16 +690,20 @@ a { .site-header:after, .site-content:after, .site-footer:after { - clear: both; } + clear: both; +} /*-------------------------------------------------------------- # Widgets --------------------------------------------------------------*/ .widget { - margin: 0 0 1.5em; - /* Make sure select elements fit in widgets. */ } - .widget select { - max-width: 100%; } + margin: 0 0 1.5em; + /* Make sure select elements fit in widgets. */ +} + +.widget select { + max-width: 100%; +} /*-------------------------------------------------------------- # Content @@ -591,31 +712,38 @@ a { ## Posts and pages --------------------------------------------------------------*/ .sticky { - display: block; } + display: block; +} .hentry { - margin: 0 0 1.5em; } + margin: 0 0 1.5em; +} .updated:not(.published) { - display: none; } + display: none; +} .page-content, .entry-content, .entry-summary { - margin: 1.5em 0 0; } + margin: 1.5em 0 0; +} .page-links { - clear: both; - margin: 0 0 1.5em; } + clear: both; + margin: 0 0 1.5em; +} /*-------------------------------------------------------------- ## Comments --------------------------------------------------------------*/ .comment-content a { - word-wrap: break-word; } + word-wrap: break-word; +} .bypostauthor { - display: block; } + display: block; +} /*-------------------------------------------------------------- # Infinite scroll @@ -623,12 +751,14 @@ a { /* Globally hidden elements when Infinite Scroll is supported and in use. */ .infinite-scroll .posts-navigation, .infinite-scroll.neverending .site-footer { - /* Theme Footer (when set to scrolling) */ - display: none; } + /* 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. */ .infinity-end.neverending .site-footer { - display: block; } + display: block; +} /*-------------------------------------------------------------- # Media @@ -636,64 +766,92 @@ a { .page-content .wp-smiley, .entry-content .wp-smiley, .comment-content .wp-smiley { - border: none; - margin-bottom: 0; - margin-top: 0; - padding: 0; } + border: none; + margin-bottom: 0; + margin-top: 0; + padding: 0; +} /* Make sure embeds and iframes fit their containers. */ embed, iframe, object { - max-width: 100%; } + max-width: 100%; +} /* Make sure logo link wraps around logo image. */ .custom-logo-link { - display: inline-block; } + display: inline-block; +} /*-------------------------------------------------------------- ## Captions --------------------------------------------------------------*/ .wp-caption { - margin-bottom: 1.5em; - max-width: 100%; } - .wp-caption img[class*="wp-image-"] { - display: block; - margin-left: auto; - margin-right: auto; } - .wp-caption .wp-caption-text { - margin: 0.8075em 0; } + margin-bottom: 1.5em; + max-width: 100%; +} + +.wp-caption img[class*="wp-image-"] { + display: block; + margin-left: auto; + margin-right: auto; +} + +.wp-caption .wp-caption-text { + margin: 0.8075em 0; +} .wp-caption-text { - text-align: center; } + text-align: center; +} /*-------------------------------------------------------------- ## Galleries --------------------------------------------------------------*/ .gallery { - margin-bottom: 1.5em; } + margin-bottom: 1.5em; +} .gallery-item { - display: inline-block; - text-align: center; - vertical-align: top; - width: 100%; } - .gallery-columns-2 .gallery-item { - max-width: 50%; } - .gallery-columns-3 .gallery-item { - max-width: 33.33%; } - .gallery-columns-4 .gallery-item { - max-width: 25%; } - .gallery-columns-5 .gallery-item { - max-width: 20%; } - .gallery-columns-6 .gallery-item { - max-width: 16.66%; } - .gallery-columns-7 .gallery-item { - max-width: 14.28%; } - .gallery-columns-8 .gallery-item { - max-width: 12.5%; } - .gallery-columns-9 .gallery-item { - max-width: 11.11%; } + display: inline-block; + text-align: center; + vertical-align: top; + width: 100%; +} + +.gallery-columns-2 .gallery-item { + max-width: 50%; +} + +.gallery-columns-3 .gallery-item { + max-width: 33.33%; +} + +.gallery-columns-4 .gallery-item { + max-width: 25%; +} + +.gallery-columns-5 .gallery-item { + max-width: 20%; +} + +.gallery-columns-6 .gallery-item { + max-width: 16.66%; +} + +.gallery-columns-7 .gallery-item { + max-width: 14.28%; +} + +.gallery-columns-8 .gallery-item { + max-width: 12.5%; +} + +.gallery-columns-9 .gallery-item { + max-width: 11.11%; +} .gallery-caption { - display: block; } + display: block; +} diff --git a/woocommerce.css b/woocommerce.css index c3dcbac8..2ac06a09 100644 --- a/woocommerce.css +++ b/woocommerce.css @@ -3,25 +3,12 @@ Theme Name: _s WooCommerce styles override */ -/** - * WooCommerce Plugin path variables - */ /** * WooCommerce color variables */ /** * Imports */ -/** - * Fonts - */ -@font-face { - font-family: 'star'; - src: url("../../plugins/woocommerce/assets/fonts/star.eot"); - src: url("../../plugins/woocommerce/assets/fonts/star.eot?#iefix") format("embedded-opentype"), url("../../plugins/woocommerce/assets/fonts/star.woff") format("woff"), url("../../plugins/woocommerce/assets/fonts/star.ttf") format("truetype"), url("../../plugins/woocommerce/assets/fonts/star.svg#star") format("svg"); - font-weight: normal; - font-style: normal; } - /** * Shop tables */ @@ -29,39 +16,58 @@ WooCommerce styles override * Shop tables */ table.shop_table_responsive thead { - display: none; } + display: none; +} table.shop_table_responsive tbody th { - display: none; } + display: none; +} table.shop_table_responsive tr td { - display: block; - text-align: right; - clear: both; } - table.shop_table_responsive tr td:before { - content: attr(data-title) ": "; - float: left; } - table.shop_table_responsive tr td.product-remove a { - text-align: left; } - 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 { - display: none; } - table.shop_table_responsive tr td.download-actions .button { - display: block; - text-align: center; } + display: block; + text-align: right; + clear: both; +} + +table.shop_table_responsive tr td:before { + content: attr(data-title) ": "; + float: left; +} + +table.shop_table_responsive tr td.product-remove a { + text-align: left; +} + +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 { + display: none; +} + +table.shop_table_responsive tr td.download-actions .button { + display: block; + text-align: center; +} @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 { - text-align: left; } - table.shop_table_responsive tr td { - display: table-cell; } - table.shop_table_responsive tr td:before { - display: none; } } + 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 { + text-align: left; + } + table.shop_table_responsive tr td { + display: table-cell; + } + table.shop_table_responsive tr td:before { + display: none; + } +} /** * Products @@ -70,44 +76,63 @@ table.shop_table_responsive tr td { * Products */ ul.products { - content: ""; - display: table; - table-layout: fixed; - margin: 0; - padding: 0; } - ul.products li.product { - list-style: none; - position: relative; - margin-bottom: 2em; } - ul.products li.product .woocommerce-loop-product__title { - font-size: 1rem; } - ul.products li.product img { - display: block; } - ul.products li.product .button { - display: block; } + content: ""; + display: table; + table-layout: fixed; + margin: 0; + padding: 0; +} + +ul.products li.product { + list-style: none; + position: relative; + margin-bottom: 2em; +} + +ul.products li.product .woocommerce-loop-product__title { + font-size: 1rem; +} + +ul.products li.product img { + display: block; +} + +ul.products li.product .button { + display: block; +} @media screen and (min-width: 48em) { - ul.products li.product { - width: 30.7966666667%; - 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%; } - .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%; } } + ul.products li.product { + width: 30.7966666667%; + 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%; + } + .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%; + } +} /** * Single product @@ -116,69 +141,113 @@ ul.products { * Single Product */ .single-product div.product { - content: ""; - display: table; - table-layout: fixed; - position: relative; } - .single-product div.product .woocommerce-product-gallery { - position: relative; } - .single-product div.product .woocommerce-product-gallery .woocommerce-product-gallery__trigger { - position: absolute; - top: 1em; - right: 1em; - display: block; - z-index: 99; } - .single-product div.product .woocommerce-product-gallery .flex-viewport { - margin-bottom: 1em; } - .single-product div.product .woocommerce-product-gallery .flex-control-thumbs { - content: ""; - display: table; - table-layout: fixed; - margin: 0; - padding: 0; } - .single-product div.product .woocommerce-product-gallery .flex-control-thumbs li { - list-style: none; - cursor: pointer; - float: left; } - .single-product div.product .woocommerce-product-gallery .flex-control-thumbs li img { - opacity: .5; } - .single-product div.product .woocommerce-product-gallery .flex-control-thumbs li img.flex-active { - opacity: 1; } - .single-product div.product .woocommerce-product-gallery .flex-control-thumbs li:hover img { - opacity: 1; } - .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-2 .flex-control-thumbs li { - width: 48.1%; } - .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-2 .flex-control-thumbs li:nth-child(2n) { - margin-right: 0; } - .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-2 .flex-control-thumbs li:nth-child(2n+1) { - clear: both; } - .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-3 .flex-control-thumbs li { - width: 30.7966666667%; } - .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-3 .flex-control-thumbs li:nth-child(3n) { - margin-right: 0; } - .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-3 .flex-control-thumbs li:nth-child(3n+1) { - clear: both; } - .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-4 .flex-control-thumbs li { - width: 22.15%; } - .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-4 .flex-control-thumbs li:nth-child(4n) { - margin-right: 0; } - .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-4 .flex-control-thumbs li:nth-child(4n+1) { - clear: both; } - .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-5 .flex-control-thumbs li { - width: 16.96%; } - .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-5 .flex-control-thumbs li:nth-child(5n) { - margin-right: 0; } - .single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-5 .flex-control-thumbs li:nth-child(5n+1) { - clear: both; } + content: ""; + display: table; + table-layout: fixed; + position: relative; +} + +.single-product div.product .woocommerce-product-gallery { + position: relative; +} + +.single-product div.product .woocommerce-product-gallery .woocommerce-product-gallery__trigger { + position: absolute; + top: 1em; + right: 1em; + display: block; + z-index: 99; +} + +.single-product div.product .woocommerce-product-gallery .flex-viewport { + margin-bottom: 1em; +} + +.single-product div.product .woocommerce-product-gallery .flex-control-thumbs { + content: ""; + display: table; + table-layout: fixed; + margin: 0; + padding: 0; +} + +.single-product div.product .woocommerce-product-gallery .flex-control-thumbs li { + list-style: none; + cursor: pointer; + float: left; +} + +.single-product div.product .woocommerce-product-gallery .flex-control-thumbs li img { + opacity: .5; +} + +.single-product div.product .woocommerce-product-gallery .flex-control-thumbs li img.flex-active { + opacity: 1; +} + +.single-product div.product .woocommerce-product-gallery .flex-control-thumbs li:hover img { + opacity: 1; +} + +.single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-2 .flex-control-thumbs li { + width: 48.1%; +} + +.single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-2 .flex-control-thumbs li:nth-child(2n) { + margin-right: 0; +} + +.single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-2 .flex-control-thumbs li:nth-child(2n+1) { + clear: both; +} + +.single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-3 .flex-control-thumbs li { + width: 30.7966666667%; +} + +.single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-3 .flex-control-thumbs li:nth-child(3n) { + margin-right: 0; +} + +.single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-3 .flex-control-thumbs li:nth-child(3n+1) { + clear: both; +} + +.single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-4 .flex-control-thumbs li { + width: 22.15%; +} + +.single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-4 .flex-control-thumbs li:nth-child(4n) { + margin-right: 0; +} + +.single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-4 .flex-control-thumbs li:nth-child(4n+1) { + clear: both; +} + +.single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-5 .flex-control-thumbs li { + width: 16.96%; +} + +.single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-5 .flex-control-thumbs li:nth-child(5n) { + margin-right: 0; +} + +.single-product div.product .woocommerce-product-gallery.woocommerce-product-gallery--columns-5 .flex-control-thumbs li:nth-child(5n+1) { + clear: both; +} .stock:empty:before { - display: none; } + display: none; +} .stock.in-stock { - color: #0f834d; } + color: #0f834d; +} .stock.out-of-stock { - color: #e2401c; } + color: #e2401c; +} /** * Checkout @@ -187,15 +256,19 @@ ul.products { * 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%; } } + .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%; + } +} /** * General WooCommerce components @@ -204,146 +277,189 @@ ul.products { * Header cart */ .site-header-cart { - position: relative; - margin: 0; - padding: 0; - content: ""; - display: table; - table-layout: fixed; } - .site-header-cart .cart-contents { - text-decoration: none; } - .site-header-cart .cart-contents .icon { - display: none; } - .site-header-cart .widget_shopping_cart { - display: none; } - .site-header-cart .product_list_widget { - margin: 0; - padding: 0; } + position: relative; + margin: 0; + padding: 0; + content: ""; + display: table; + table-layout: fixed; +} + +.site-header-cart .cart-contents { + text-decoration: none; +} + +.site-header-cart .cart-contents .icon { + display: none; +} + +.site-header-cart .widget_shopping_cart { + display: none; +} + +.site-header-cart .product_list_widget { + margin: 0; + padding: 0; +} /** * Star rating */ .star-rating { - overflow: hidden; - position: relative; - height: 1.618em; - line-height: 1.618; - font-size: 1em; - width: 5.3em; - font-family: 'star'; - font-weight: 400; } - .star-rating:before { - content: "\53\53\53\53\53"; - opacity: .25; - float: left; - top: 0; - left: 0; - position: absolute; } - .star-rating span { - overflow: hidden; - float: left; - top: 0; - left: 0; - position: absolute; - padding-top: 1.5em; } - .star-rating span:before { - content: "\53\53\53\53\53"; - top: 0; - position: absolute; - left: 0; - color: royalblue; } + overflow: hidden; + position: relative; + height: 1.618em; + line-height: 1.618; + font-size: 1em; + width: 5.3em; + font-family: 'star'; + font-weight: 400; +} + +.star-rating:before { + content: "\53\53\53\53\53"; + opacity: .25; + float: left; + top: 0; + left: 0; + position: absolute; +} + +.star-rating span { + overflow: hidden; + float: left; + top: 0; + left: 0; + position: absolute; + padding-top: 1.5em; +} + +.star-rating span:before { + content: "\53\53\53\53\53"; + top: 0; + position: absolute; + left: 0; + color: royalblue; +} p.stars a { - position: relative; - height: 1em; - width: 1em; - text-indent: -999em; - display: inline-block; - text-decoration: none; - margin-right: 1px; - font-weight: 400; } - p.stars a:before { - display: block; - position: absolute; - top: 0; - left: 0; - width: 1em; - height: 1em; - line-height: 1; - font-family: "star"; - content: "\53"; - color: #404040; - text-indent: 0; - opacity: .25; } - p.stars a:hover ~ a:before { - content: "\53"; - color: #404040; - opacity: .25; } + position: relative; + height: 1em; + width: 1em; + text-indent: -999em; + display: inline-block; + text-decoration: none; + margin-right: 1px; + font-weight: 400; +} + +p.stars a:before { + display: block; + position: absolute; + top: 0; + left: 0; + width: 1em; + height: 1em; + line-height: 1; + font-family: "star"; + content: "\53"; + color: #404040; + text-indent: 0; + opacity: .25; +} + +p.stars a:hover ~ a:before { + content: "\53"; + color: #404040; + opacity: .25; +} p.stars:hover a:before { - content: "\53"; - color: royalblue; - opacity: 1; } + content: "\53"; + color: royalblue; + opacity: 1; +} p.stars.selected a.active:before { - content: "\53"; - color: royalblue; - opacity: 1; } + content: "\53"; + color: royalblue; + opacity: 1; +} p.stars.selected a.active ~ a:before { - content: "\53"; - color: #404040; - opacity: .25; } + content: "\53"; + color: #404040; + opacity: .25; +} p.stars.selected a:not(.active):before { - content: "\53"; - color: royalblue; - opacity: 1; } + content: "\53"; + color: royalblue; + opacity: 1; +} /** * Tabs */ .woocommerce-tabs ul.tabs { - list-style: none; - margin: 0; - padding: 0; - text-align: left; } - .woocommerce-tabs ul.tabs li { - display: block; - margin: 0; - position: relative; } - .woocommerce-tabs ul.tabs li a { - padding: 1em 0; - display: block; } + list-style: none; + margin: 0; + padding: 0; + text-align: left; +} + +.woocommerce-tabs ul.tabs li { + display: block; + margin: 0; + position: relative; +} + +.woocommerce-tabs ul.tabs li a { + padding: 1em 0; + display: block; +} .woocommerce-tabs .panel h2:first-of-type { - margin-bottom: 1em; } + margin-bottom: 1em; +} /** * Password strength meter */ .woocommerce-password-strength { - text-align: right; } - .woocommerce-password-strength.strong { - color: #0f834d; } - .woocommerce-password-strength.short { - color: #e2401c; } - .woocommerce-password-strength.bad { - color: #e2401c; } - .woocommerce-password-strength.good { - color: #3D9CD2; } + text-align: right; +} + +.woocommerce-password-strength.strong { + color: #0f834d; +} + +.woocommerce-password-strength.short { + color: #e2401c; +} + +.woocommerce-password-strength.bad { + color: #e2401c; +} + +.woocommerce-password-strength.good { + color: #3D9CD2; +} /** * Forms */ .form-row.woocommerce-validated input.input-text { - box-shadow: inset 2px 0 0 #0f834d; } + box-shadow: inset 2px 0 0 #0f834d; +} .form-row.woocommerce-invalid input.input-text { - box-shadow: inset 2px 0 0 #e2401c; } + box-shadow: inset 2px 0 0 #e2401c; +} .required { - color: red; } + color: red; +} /** * Notices @@ -353,48 +469,56 @@ p.stars.selected a:not(.active):before { .woocommerce-error, .woocommerce-noreviews, p.no-comments { - content: ""; - display: table; - table-layout: fixed; - background-color: #0f834d; - clear: both; } + content: ""; + display: table; + table-layout: fixed; + background-color: #0f834d; + clear: both; +} .woocommerce-info, .woocommerce-noreviews, p.no-comments { - background-color: #3D9CD2; } + background-color: #3D9CD2; +} .woocommerce-error { - background-color: #e2401c; } + background-color: #e2401c; +} .demo_store { - position: fixed; - left: 0; - bottom: 0; - right: 0; - margin: 0; - padding: 1em; - background-color: #3D9CD2; - z-index: 9999; } + position: fixed; + left: 0; + bottom: 0; + right: 0; + margin: 0; + padding: 1em; + background-color: #3D9CD2; + z-index: 9999; +} @media screen and (min-width: 48em) { - /** + /** * Header cart */ - .site-header-cart .widget_shopping_cart { - position: absolute; - top: 100%; - width: 100%; - z-index: 999999; - font-size: ms(-1); - left: -999em; - display: block; - box-shadow: 0 3px 3px rgba(0, 0, 0, 0.2); } - .site-header-cart .cart-contents .icon { - display: inline; } - .site-header-cart:hover .widget_shopping_cart, .site-header-cart.focus .widget_shopping_cart { - left: 0; - display: block; } } + .site-header-cart .widget_shopping_cart { + position: absolute; + top: 100%; + width: 100%; + z-index: 999999; + font-size: ms(-1); + left: -999em; + display: block; + box-shadow: 0 3px 3px rgba(0, 0, 0, 0.2); + } + .site-header-cart .cart-contents .icon { + display: inline; + } + .site-header-cart:hover .widget_shopping_cart, .site-header-cart.focus .widget_shopping_cart { + left: 0; + display: block; + } +} /** * WooCommerce widgets @@ -403,46 +527,60 @@ p.no-comments { * WooCommerce Price Filter */ .widget_price_filter .price_slider { - margin-bottom: 1.5em; } + margin-bottom: 1.5em; +} .widget_price_filter .price_slider_amount { - text-align: right; - line-height: 2.4em; } - .widget_price_filter .price_slider_amount .button { - float: left; } + text-align: right; + line-height: 2.4em; +} + +.widget_price_filter .price_slider_amount .button { + float: left; +} .widget_price_filter .ui-slider { - position: relative; - text-align: left; } + position: relative; + text-align: left; +} .widget_price_filter .ui-slider .ui-slider-handle { - position: absolute; - z-index: 2; - width: 1em; - height: 1em; - cursor: ew-resize; - outline: none; - background: royalblue; - box-sizing: border-box; - margin-top: -.25em; - opacity: 1; } - .widget_price_filter .ui-slider .ui-slider-handle:last-child { - margin-left: -1em; } - .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); } + position: absolute; + z-index: 2; + width: 1em; + height: 1em; + cursor: ew-resize; + outline: none; + background: royalblue; + box-sizing: border-box; + margin-top: -.25em; + opacity: 1; +} + +.widget_price_filter .ui-slider .ui-slider-handle:last-child { + margin-left: -1em; +} + +.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); +} .widget_price_filter .ui-slider .ui-slider-range { - position: absolute; - z-index: 1; - display: block; - border: 0; - background: royalblue; } + position: absolute; + z-index: 1; + display: block; + border: 0; + background: royalblue; +} .widget_price_filter .price_slider_wrapper .ui-widget-content { - background: rgba(0, 0, 0, 0.1); } + background: rgba(0, 0, 0, 0.1); +} .widget_price_filter .ui-slider-horizontal { - height: .5em; } + height: .5em; +} .widget_price_filter .ui-slider-horizontal .ui-slider-range { - height: 100%; } + height: 100%; +} From 196ee7775512652894a7338ed77c4889cd474a30 Mon Sep 17 00:00:00 2001 From: Tiago Noronha Date: Thu, 31 Aug 2017 08:59:25 +0100 Subject: [PATCH 025/107] Remove unused CSS. --- sass/shop/_components.scss | 11 ----------- woocommerce.css | 8 -------- 2 files changed, 19 deletions(-) diff --git a/sass/shop/_components.scss b/sass/shop/_components.scss index 413a5aaf..996116a8 100644 --- a/sass/shop/_components.scss +++ b/sass/shop/_components.scss @@ -9,10 +9,6 @@ .cart-contents { text-decoration: none; - - .icon { - display: none; - } } .widget_shopping_cart { @@ -252,18 +248,11 @@ p.no-comments { top: 100%; width: 100%; z-index: 999999; - font-size: ms(-1); left: -999em; display: block; box-shadow: 0 3px 3px rgba(0, 0, 0, 0.2); } - .cart-contents { - .icon { - display: inline; - } - } - &:hover, &.focus { .widget_shopping_cart { diff --git a/woocommerce.css b/woocommerce.css index 2ac06a09..d1308c51 100644 --- a/woocommerce.css +++ b/woocommerce.css @@ -289,10 +289,6 @@ ul.products li.product .button { text-decoration: none; } -.site-header-cart .cart-contents .icon { - display: none; -} - .site-header-cart .widget_shopping_cart { display: none; } @@ -506,14 +502,10 @@ p.no-comments { top: 100%; width: 100%; z-index: 999999; - font-size: ms(-1); left: -999em; display: block; box-shadow: 0 3px 3px rgba(0, 0, 0, 0.2); } - .site-header-cart .cart-contents .icon { - display: inline; - } .site-header-cart:hover .widget_shopping_cart, .site-header-cart.focus .widget_shopping_cart { left: 0; display: block; From fa137f01123ef123085f5658c8e26d01b3494d02 Mon Sep 17 00:00:00 2001 From: Stephen Hoult Date: Mon, 11 Sep 2017 10:04:16 +0100 Subject: [PATCH 026/107] Remove CSS rules for quotes - Issue #1192 --- sass/elements/_elements.scss | 9 --------- style.css | 8 -------- 2 files changed, 17 deletions(-) diff --git a/sass/elements/_elements.scss b/sass/elements/_elements.scss index 38f91c4a..c4a96159 100644 --- a/sass/elements/_elements.scss +++ b/sass/elements/_elements.scss @@ -12,15 +12,6 @@ body { background: $color__background-body; /* Fallback for when there is no custom background color defined. */ } -blockquote, q { - quotes: "" ""; - - &:before, - &:after { - content: ""; - } -} - hr { background-color: $color__background-hr; border: 0; diff --git a/style.css b/style.css index bd787e1d..380dac3c 100644 --- a/style.css +++ b/style.css @@ -342,14 +342,6 @@ body { /* Fallback for when there is no custom background color defined. */ } -blockquote, q { - quotes: "" ""; -} - -blockquote:before, blockquote:after, q:before, q:after { - content: ""; -} - hr { background-color: #ccc; border: 0; From 420b44af223f0b9aa98d85ffa4fdb5943cb6fdcb Mon Sep 17 00:00:00 2001 From: jrfnl Date: Wed, 13 Sep 2017 20:47:58 +0200 Subject: [PATCH 027/107] Travis: build against highest available PHP version The new Trusty images as per Sept 7 include an image for PHP 7.2 (even though it hasn't been released yet). The `_s` build tests are run against the lowest/highest supported PHP version for 5 and 7. As `7.2` is now available, it should replace the `7.1` build. --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 18a0ea73..48384217 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,8 +29,8 @@ matrix: env: SNIFF=1 # aliased to a recent 7.0.x version - php: '7.0' - # aliased to a recent 7.1.x version - - php: '7.1' + # aliased to a recent 7.2.x version + - php: '7.2' # aliased to a recent hhvm version - php: 'hhvm' From 3b7b0309f1589700ac14b444cbde20621284ba4f Mon Sep 17 00:00:00 2001 From: Andrei Surdu Date: Thu, 21 Sep 2017 20:02:23 +0300 Subject: [PATCH 028/107] Added a note about the need to rename `_s.pot`. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 20627c6a..2e244d15 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ OR 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` and the links in `footer.php` with your own information. Next, update or delete this readme. +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 theme's slug. Next, update or delete this readme. Now you're ready to go! The next step is easy to say, but harder to do: make an awesome WordPress theme. :) From ce47408461ae586210d2ff8fba2426d2d4e4cb10 Mon Sep 17 00:00:00 2001 From: Thomas Guillot Date: Thu, 28 Sep 2017 16:00:04 +0100 Subject: [PATCH 029/107] Remove `aria-hidden` attribute from the post thumbnail link --- inc/template-tags.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/template-tags.php b/inc/template-tags.php index 6a0330b6..19cb67c3 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -155,7 +155,7 @@ function _s_post_thumbnail() { - the_title_attribute( 'echo=0' ), From e4665250ddfeed2052cdc8215f0b744e7f681b9f Mon Sep 17 00:00:00 2001 From: Bappi Date: Tue, 10 Oct 2017 23:29:36 +0600 Subject: [PATCH 030/107] Change links http:// to https:// All necessary links checked and updated to https, some remain as http as those aren't using secured protocol yet --- .github/CONTRIBUTING.md | 6 +++--- .travis.yml | 12 ++++++------ README.md | 2 +- languages/_s.pot | 4 ++-- readme.txt | 4 ++-- sass/elements/_elements.scss | 2 +- sass/style.scss | 8 ++++---- style.css | 10 +++++----- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 2d87782b..11c023c4 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -27,8 +27,8 @@ By contributing code to `_s`, you grant its use under the [GNU General Public Li ## Underscores.me -If your issue is specific to the [Underscores.me](http://underscores.me) website, the [Underscores.me GitHub repo](https://github.com/Automattic/underscores.me) is the right place for you. +If your issue is specific to the [Underscores.me](https://underscores.me) website, the [Underscores.me GitHub repo](https://github.com/Automattic/underscores.me) is the right place for you. -The preferred method of generating a new theme based on `_s` is the [Underscores.me](http://underscores.me) website. If you have an alternative method, such as a shell script, write a blog post about it or host it in a separate repo -- and make sure to mention [@underscoresme](https://twitter.com/underscoresme) in your tweets! +The preferred method of generating a new theme based on `_s` is the [Underscores.me](https://underscores.me) website. If you have an alternative method, such as a shell script, write a blog post about it or host it in a separate repo -- and make sure to mention [@underscoresme](https://twitter.com/underscoresme) in your tweets! -Want to have your avatar listed as one of the `_s` contributors [here](http://underscores.me/#contribute)? Just make sure you have an email address added to both GitHub and your local Git installation. \ No newline at end of file +Want to have your avatar listed as one of the `_s` contributors [here](https://underscores.me/#contribute)? Just make sure you have an email address added to both GitHub and your local Git installation. \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 48384217..a40b9756 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,17 +5,17 @@ # @link https://github.com/Automattic/_s # Ditch sudo and use containers. -# @link http://docs.travis-ci.com/user/migrating-from-legacy/#Why-migrate-to-container-based-infrastructure%3F -# @link http://docs.travis-ci.com/user/workers/container-based-infrastructure/#Routing-your-build-to-container-based-infrastructure +# @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 dist: trusty # Declare project language. -# @link http://about.travis-ci.org/docs/user/languages/php/ +# @link https://about.travis-ci.org/docs/user/languages/php/ language: php # Declare versions of PHP to use. Use one decimal max. -# @link http://docs.travis-ci.com/user/build-configuration/ +# @link https://docs.travis-ci.com/user/build-configuration/ matrix: fast_finish: true @@ -80,12 +80,12 @@ script: - if [[ "$SNIFF" == "1" ]]; then jscs .; fi # WordPress Coding Standards. # @link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards - # @link http://pear.php.net/package/PHP_CodeSniffer/ + # @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/scripts/phpcs; fi # Receive notifications for build results. -# @link http://docs.travis-ci.com/user/notifications/#Email-notifications +# @link https://docs.travis-ci.com/user/notifications/#Email-notifications notifications: email: false diff --git a/README.md b/README.md index 20627c6a..3816744c 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ My ultra-minimal CSS might make me look like theme tartare but that means less s Getting Started --------------- -If you want to keep it simple, head over to http://underscores.me and generate your `_s` based theme from there. You just input the name of the theme you want to create, click the "Generate" button, and you get your ready-to-awesomize starter theme. +If you want to keep it simple, head over to https://underscores.me and generate your `_s` based theme from there. You just input the name of the theme you want to create, click the "Generate" button, and you get your ready-to-awesomize starter theme. If you want to set things up manually, download `_s` from GitHub. The first thing you want to do is copy the `_s` directory and change the name to something else (like, say, `megatherium-is-awesome`), and then you'll need to do a five-step find and replace on the name in all the templates. diff --git a/languages/_s.pot b/languages/_s.pot index adf857a4..59216a24 100644 --- a/languages/_s.pot +++ b/languages/_s.pot @@ -140,7 +140,7 @@ msgid "_s" msgstr "" #. Theme URI of the plugin/theme -msgid "http://underscores.me/" +msgid "https://underscores.me/" msgstr "" #. Description of the plugin/theme @@ -156,7 +156,7 @@ msgid "Automattic" msgstr "" #. Author URI of the plugin/theme -msgid "http://automattic.com/" +msgid "https://automattic.com/" msgstr "" #: comments.php:40 diff --git a/readme.txt b/readme.txt index 0beaaefd..20aa32b7 100644 --- a/readme.txt +++ b/readme.txt @@ -34,5 +34,5 @@ _s includes support for Infinite Scroll in Jetpack. == Credits == -* Based on Underscores http://underscores.me/, (C) 2012-2017 Automattic, Inc., [GPLv2 or later](https://www.gnu.org/licenses/gpl-2.0.html) -* normalize.css http://necolas.github.io/normalize.css/, (C) 2012-2016 Nicolas Gallagher and Jonathan Neal, [MIT](http://opensource.org/licenses/MIT) +* Based on Underscores https://underscores.me/, (C) 2012-2017 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) diff --git a/sass/elements/_elements.scss b/sass/elements/_elements.scss index c4a96159..2f688149 100644 --- a/sass/elements/_elements.scss +++ b/sass/elements/_elements.scss @@ -4,7 +4,7 @@ html { *, *:before, -*:after { /* Inherit box-sizing to make it easier to change the property for components that leverage other behavior; see http://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ */ +*: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; } diff --git a/sass/style.scss b/sass/style.scss index a53fef63..60840dbf 100644 --- a/sass/style.scss +++ b/sass/style.scss @@ -1,8 +1,8 @@ /*! Theme Name: _s -Theme URI: http://underscores.me/ +Theme URI: https://underscores.me/ Author: Automattic -Author URI: http://automattic.com/ +Author URI: https://automattic.com/ 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. Version: 1.0.0 License: GNU General Public License v2 or later @@ -13,11 +13,11 @@ 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 http://underscores.me/, (C) 2012-2016 Automattic, Inc. +_s is based on Underscores https://underscores.me/, (C) 2012-2016 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 -Nicolas Gallagher and Jonathan Neal http://necolas.github.io/normalize.css/ +Nicolas Gallagher and Jonathan Neal https://necolas.github.io/normalize.css/ */ /*-------------------------------------------------------------- diff --git a/style.css b/style.css index 380dac3c..d4a4e113 100644 --- a/style.css +++ b/style.css @@ -1,8 +1,8 @@ /*! Theme Name: _s -Theme URI: http://underscores.me/ +Theme URI: https://underscores.me/ Author: Automattic -Author URI: http://automattic.com/ +Author URI: https://automattic.com/ 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. Version: 1.0.0 License: GNU General Public License v2 or later @@ -13,11 +13,11 @@ 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 http://underscores.me/, (C) 2012-2016 Automattic, Inc. +_s is based on Underscores https://underscores.me/, (C) 2012-2016 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 -Nicolas Gallagher and Jonathan Neal http://necolas.github.io/normalize.css/ +Nicolas Gallagher and Jonathan Neal https://necolas.github.io/normalize.css/ */ /*-------------------------------------------------------------- >>> TABLE OF CONTENTS: @@ -333,7 +333,7 @@ html { *, *:before, *:after { - /* Inherit box-sizing to make it easier to change the property for components that leverage other behavior; see http://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ */ + /* 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; } From 8d9886c5359ab4c4aec261c8547357d707d43c4a Mon Sep 17 00:00:00 2001 From: Bappi Date: Tue, 10 Oct 2017 23:30:46 +0600 Subject: [PATCH 031/107] Add necessay backticks --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3816744c..9b519316 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ If you want to set things up manually, download `_s` from GitHub. The first thin 1. Search for `'_s'` (inside single quotations) to capture the text domain. 2. Search for `_s_` to capture all the function names. -3. Search for `Text Domain: _s` in style.css. +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. @@ -34,7 +34,7 @@ OR 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. +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-` From aca1c3bc0dbddda1f7c503671ec097b2394b4371 Mon Sep 17 00:00:00 2001 From: Oliver Juhas Date: Thu, 19 Oct 2017 14:21:36 +0200 Subject: [PATCH 032/107] Fixing "Upload Theme" button text --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 0beaaefd..c51de46e 100644 --- a/readme.txt +++ b/readme.txt @@ -18,7 +18,7 @@ Hi. I'm a starter theme called _s, or underscores, if you like. I'm a theme mean == Installation == 1. In your admin panel, go to Appearance > Themes and click the Add New button. -2. Click Upload and Choose File, then select the theme's .zip file. Click Install Now. +2. Click Upload Theme and Choose File, then select the theme's .zip file. Click Install Now. 3. Click Activate to use your new theme right away. == Frequently Asked Questions == From 3f9c31b6a1fe06f48c8e5c4dfb40716f3cbe8508 Mon Sep 17 00:00:00 2001 From: Sami Keijonen Date: Sun, 22 Oct 2017 19:00:06 +0300 Subject: [PATCH 033/107] Update screen-reader-text class. --- sass/modules/_accessibility.scss | 9 +++++++-- style.css | 12 ++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/sass/modules/_accessibility.scss b/sass/modules/_accessibility.scss index f71106bd..469887cc 100644 --- a/sass/modules/_accessibility.scss +++ b/sass/modules/_accessibility.scss @@ -1,10 +1,14 @@ /* Text meant only for screen readers. */ .screen-reader-text { + border: 0; clip: rect(1px, 1px, 1px, 1px); - position: absolute !important; + clip-path: inset(50%); height: 1px; - width: 1px; + margin: -1px; overflow: hidden; + 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. */ &:focus { @@ -12,6 +16,7 @@ border-radius: 3px; box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6); clip: auto !important; + clip-path: none; color: $color__text-screen; display: block; @include font-size(0.875); diff --git a/style.css b/style.css index 380dac3c..97018e5b 100644 --- a/style.css +++ b/style.css @@ -599,13 +599,16 @@ a:hover, a:active { --------------------------------------------------------------*/ /* Text meant only for screen readers. */ .screen-reader-text { + border: 0; clip: rect(1px, 1px, 1px, 1px); - position: absolute !important; + clip-path: inset(50%); height: 1px; - width: 1px; + margin: -1px; overflow: hidden; - word-wrap: normal !important; - /* Many screen reader and browser combinations announce broken words as they would appear visually. */ + 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. */ } .screen-reader-text:focus { @@ -613,6 +616,7 @@ a:hover, a:active { border-radius: 3px; box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6); clip: auto !important; + clip-path: none; color: #21759b; display: block; font-size: 14px; From 6bd8c2b88865f56531d1db7e0e994f895bef7b4c Mon Sep 17 00:00:00 2001 From: Bappi Date: Wed, 25 Oct 2017 21:53:29 +0600 Subject: [PATCH 034/107] Remove unnecessary ! --- style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/style.css b/style.css index 15a4ffd2..d8e5f7be 100644 --- a/style.css +++ b/style.css @@ -1,4 +1,4 @@ -/*! +/* Theme Name: _s Theme URI: https://underscores.me/ Author: Automattic From 0112701c1f3ec833c2493190f663291869e73960 Mon Sep 17 00:00:00 2001 From: "David A. Kennedy" Date: Wed, 25 Oct 2017 14:29:53 -0400 Subject: [PATCH 035/107] Remove extra `!` in `style.scss` * Related: #1220. --- sass/style.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sass/style.scss b/sass/style.scss index 60840dbf..59c8350b 100644 --- a/sass/style.scss +++ b/sass/style.scss @@ -1,4 +1,4 @@ -/*! +/* Theme Name: _s Theme URI: https://underscores.me/ Author: Automattic From 6454bfb0bb4bf2f6b7769713e951dd2f04de653d Mon Sep 17 00:00:00 2001 From: Bappi Date: Thu, 26 Oct 2017 01:14:02 +0600 Subject: [PATCH 036/107] Update year to the latest --- sass/style.scss | 2 +- style.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sass/style.scss b/sass/style.scss index 59c8350b..2d4d3460 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 with others. -_s is based on Underscores https://underscores.me/, (C) 2012-2016 Automattic, Inc. +_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. Normalizing styles have been helped along thanks to the fine work of diff --git a/style.css b/style.css index d8e5f7be..8ec6421c 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-2016 Automattic, Inc. +_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. Normalizing styles have been helped along thanks to the fine work of From 6bc640792a63f81f2f1d78fb339b5729a5d8f246 Mon Sep 17 00:00:00 2001 From: Bappi Date: Sun, 29 Oct 2017 14:51:29 +0600 Subject: [PATCH 037/107] Update template hierarchy link --- archive.php | 2 +- comments.php | 2 +- index.php | 2 +- page.php | 2 +- template-parts/content-none.php | 2 +- template-parts/content-page.php | 2 +- template-parts/content-search.php | 2 +- template-parts/content.php | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/archive.php b/archive.php index d5de83de..9cf53756 100644 --- a/archive.php +++ b/archive.php @@ -2,7 +2,7 @@ /** * The template for displaying archive pages * - * @link https://codex.wordpress.org/Template_Hierarchy + * @link https://developer.wordpress.org/themes/basics/template-hierarchy/ * * @package _s */ diff --git a/comments.php b/comments.php index 30b2e88b..aba21bc4 100644 --- a/comments.php +++ b/comments.php @@ -5,7 +5,7 @@ * This is the template that displays the area of the page that contains both the current comments * and the comment form. * - * @link https://codex.wordpress.org/Template_Hierarchy + * @link https://developer.wordpress.org/themes/basics/template-hierarchy/ * * @package _s */ diff --git a/index.php b/index.php index c9d96f7a..39fccd5a 100644 --- a/index.php +++ b/index.php @@ -7,7 +7,7 @@ * It is used to display a page when nothing more specific matches a query. * E.g., it puts together the home page when no home.php file exists. * - * @link https://codex.wordpress.org/Template_Hierarchy + * @link https://developer.wordpress.org/themes/basics/template-hierarchy/ * * @package _s */ diff --git a/page.php b/page.php index f41e4455..e04d218f 100644 --- a/page.php +++ b/page.php @@ -7,7 +7,7 @@ * and that other 'pages' on your WordPress site may use a * different template. * - * @link https://codex.wordpress.org/Template_Hierarchy + * @link https://developer.wordpress.org/themes/basics/template-hierarchy/ * * @package _s */ diff --git a/template-parts/content-none.php b/template-parts/content-none.php index 50c2c21b..6aea2da4 100644 --- a/template-parts/content-none.php +++ b/template-parts/content-none.php @@ -2,7 +2,7 @@ /** * Template part for displaying a message that posts cannot be found * - * @link https://codex.wordpress.org/Template_Hierarchy + * @link https://developer.wordpress.org/themes/basics/template-hierarchy/ * * @package _s */ diff --git a/template-parts/content-page.php b/template-parts/content-page.php index 0c8ad09b..9407aa92 100644 --- a/template-parts/content-page.php +++ b/template-parts/content-page.php @@ -2,7 +2,7 @@ /** * Template part for displaying page content in page.php * - * @link https://codex.wordpress.org/Template_Hierarchy + * @link https://developer.wordpress.org/themes/basics/template-hierarchy/ * * @package _s */ diff --git a/template-parts/content-search.php b/template-parts/content-search.php index b7ac2ff9..a60c31eb 100644 --- a/template-parts/content-search.php +++ b/template-parts/content-search.php @@ -2,7 +2,7 @@ /** * Template part for displaying results in search pages * - * @link https://codex.wordpress.org/Template_Hierarchy + * @link https://developer.wordpress.org/themes/basics/template-hierarchy/ * * @package _s */ diff --git a/template-parts/content.php b/template-parts/content.php index 6e3b38f0..8f0fab6a 100644 --- a/template-parts/content.php +++ b/template-parts/content.php @@ -2,7 +2,7 @@ /** * Template part for displaying posts * - * @link https://codex.wordpress.org/Template_Hierarchy + * @link https://developer.wordpress.org/themes/basics/template-hierarchy/ * * @package _s */ From 6d34e9a8a0a7bcbc707cd43e96c2c75d949bdebd Mon Sep 17 00:00:00 2001 From: Ben Date: Sun, 29 Oct 2017 09:15:21 +0000 Subject: [PATCH 038/107] Update README.md Correct grammar --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b7e78c0a..7083c865 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ OR 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 theme's slug. Next, update or delete this readme. +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. Now you're ready to go! The next step is easy to say, but harder to do: make an awesome WordPress theme. :) From 2d74ebd7c9573d1517733395a7c2d22d3cfd3aa6 Mon Sep 17 00:00:00 2001 From: Ismail El Korchi Date: Sun, 29 Oct 2017 15:31:22 +0000 Subject: [PATCH 039/107] Split _s_posted_on into two functions --- inc/template-tags.php | 14 ++++++++++++-- template-parts/content-search.php | 5 ++++- template-parts/content.php | 5 ++++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/inc/template-tags.php b/inc/template-tags.php index 3260c44e..880c1e31 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -9,7 +9,7 @@ if ( ! function_exists( '_s_posted_on' ) ) : /** - * Prints HTML with meta information for the current post-date/time and author. + * Prints HTML with meta information for the current post-date/time. */ function _s_posted_on() { $time_string = ''; @@ -30,13 +30,23 @@ if ( ! function_exists( '_s_posted_on' ) ) : '' . $time_string . '' ); + echo '' . $posted_on . ''; // WPCS: XSS OK. + + } +endif; + +if ( ! function_exists( '_s_posted_by' ) ) : + /** + * Prints HTML with meta information for the current author. + */ + function _s_posted_by() { $byline = sprintf( /* translators: %s: post author. */ esc_html_x( 'by %s', 'post author', '_s' ), '' . esc_html( get_the_author() ) . '' ); - echo '' . $posted_on . ''; // WPCS: XSS OK. + echo ''; // WPCS: XSS OK. } endif; diff --git a/template-parts/content-search.php b/template-parts/content-search.php index b7ac2ff9..97136de9 100644 --- a/template-parts/content-search.php +++ b/template-parts/content-search.php @@ -15,7 +15,10 @@ diff --git a/template-parts/content.php b/template-parts/content.php index 6e3b38f0..f8718862 100644 --- a/template-parts/content.php +++ b/template-parts/content.php @@ -20,7 +20,10 @@ if ( 'post' === get_post_type() ) : ?> From f99c9b5bd0aeedbec46d3b1991814b1107fac2eb Mon Sep 17 00:00:00 2001 From: Ismail El Korchi Date: Sun, 29 Oct 2017 21:30:50 +0000 Subject: [PATCH 040/107] Fix the indentation of the PHP tags --- template-parts/content-search.php | 4 ++-- template-parts/content.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/template-parts/content-search.php b/template-parts/content-search.php index 97136de9..37bc0971 100644 --- a/template-parts/content-search.php +++ b/template-parts/content-search.php @@ -16,8 +16,8 @@ diff --git a/template-parts/content.php b/template-parts/content.php index f8718862..2b885925 100644 --- a/template-parts/content.php +++ b/template-parts/content.php @@ -21,8 +21,8 @@ if ( 'post' === get_post_type() ) : ?> Date: Mon, 30 Oct 2017 10:57:58 +0000 Subject: [PATCH 041/107] Replace `'echo=0'` with `array( 'echo' => false )` and remove duplicate function --- inc/template-tags.php | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/inc/template-tags.php b/inc/template-tags.php index 19cb67c3..fdf1929f 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -125,40 +125,7 @@ function _s_post_thumbnail() { - - - -
    - -
    - - - - - the_title_attribute( 'echo=0' ), + 'alt' => the_title_attribute( array( 'echo' => false ) ), ) ); ?> From 558f12ce9fe11c67b880b230c279c5ca010b0789 Mon Sep 17 00:00:00 2001 From: "David A. Kennedy" Date: Tue, 31 Oct 2017 12:21:27 -0400 Subject: [PATCH 042/107] Revert "Remove unnecessary !" --- style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/style.css b/style.css index 8ec6421c..951f48cc 100644 --- a/style.css +++ b/style.css @@ -1,4 +1,4 @@ -/* +/*! Theme Name: _s Theme URI: https://underscores.me/ Author: Automattic From efd37d13a6622bcd20e8c7b35309102c06981c71 Mon Sep 17 00:00:00 2001 From: "David A. Kennedy" Date: Tue, 31 Oct 2017 13:04:47 -0400 Subject: [PATCH 043/107] Revert 0112701c1f3ec833c2493190f663291869e73960 * This is needed code. See: #770. * Also, see Automattic/_s#1220. --- sass/style.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sass/style.scss b/sass/style.scss index 2d4d3460..1d5190d3 100644 --- a/sass/style.scss +++ b/sass/style.scss @@ -1,4 +1,4 @@ -/* +/*! Theme Name: _s Theme URI: https://underscores.me/ Author: Automattic From e5da804748f43f70c8813e3b79b3027f93e9b636 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 1 Nov 2017 03:05:24 +0100 Subject: [PATCH 044/107] Fix comment number comparison in comments.php --- comments.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comments.php b/comments.php index aba21bc4..09294029 100644 --- a/comments.php +++ b/comments.php @@ -28,7 +28,7 @@ if ( post_password_required() ) {

    Date: Wed, 1 Nov 2017 03:17:09 +0100 Subject: [PATCH 045/107] Clarify "singularly identifiable articles" --- inc/template-functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/template-functions.php b/inc/template-functions.php index 340e6775..d430b28f 100644 --- a/inc/template-functions.php +++ b/inc/template-functions.php @@ -22,7 +22,7 @@ function _s_body_classes( $classes ) { add_filter( 'body_class', '_s_body_classes' ); /** - * Add a pingback url auto-discovery header for singularly identifiable articles. + * Add a pingback url auto-discovery header for single posts, pages, or attachments. */ function _s_pingback_header() { if ( is_singular() && pings_open() ) { From eb3945f37b013fa2e24ec76dc28ca817062fc92b Mon Sep 17 00:00:00 2001 From: Oliver Juhas Date: Sun, 5 Nov 2017 19:13:42 +0100 Subject: [PATCH 046/107] Fixing localization function inside `printf()` --- comments.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comments.php b/comments.php index aba21bc4..3187b075 100644 --- a/comments.php +++ b/comments.php @@ -31,7 +31,7 @@ if ( post_password_required() ) { if ( 1 === $comment_count ) { printf( /* translators: 1: title. */ - esc_html_e( 'One thought on “%1$s”', '_s' ), + esc_html__( 'One thought on “%1$s”', '_s' ), '' . get_the_title() . '' ); } else { From 100081feeed1467231d23da95d7aa9cd3927a500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benoi=CC=82t=20Chantre?= Date: Mon, 10 Jul 2017 18:03:55 +0200 Subject: [PATCH 047/107] =?UTF-8?q?Use=20full=20width=20layout=20when=20th?= =?UTF-8?q?ere=E2=80=99s=20no=20sidebar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + inc/template-functions.php | 5 +++++ layouts/content-sidebar.css | 9 +++++++++ layouts/sidebar-content.css | 9 +++++++++ sass/layout/_content-sidebar.scss | 2 ++ sass/layout/_no-sidebar.scss | 11 +++++++++++ sass/layout/_sidebar-content.scss | 2 ++ sass/site/_site.scss | 1 + 8 files changed, 40 insertions(+) create mode 100644 sass/layout/_no-sidebar.scss diff --git a/README.md b/README.md index b7e78c0a..efd98e83 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ My ultra-minimal CSS might make me look like theme tartare but that means less s * Some small tweaks in `inc/template-functions.php` that can improve your theming experience. * A script at `js/navigation.js` that makes your menu a toggled dropdown on small screens (like your phone), ready for CSS artistry. It's enqueued in `functions.php`. * 2 sample CSS layouts in `layouts/` for a sidebar on either side of your content. +Note: `.no-sidebar` styles are not automatically loaded. * Smartly organized starter CSS in `style.css` that will help you to quickly get your design off the ground. * Licensed under GPLv2 or later. :) Use it to make something cool. diff --git a/inc/template-functions.php b/inc/template-functions.php index 340e6775..a03ed3bd 100644 --- a/inc/template-functions.php +++ b/inc/template-functions.php @@ -17,6 +17,11 @@ function _s_body_classes( $classes ) { $classes[] = 'hfeed'; } + // Adds a class of no-sidebar when there is no sidebar present. + if ( ! is_active_sidebar( 'sidebar-1' ) ) { + $classes[] = 'no-sidebar'; + } + return $classes; } add_filter( 'body_class', '_s_body_classes' ); diff --git a/layouts/content-sidebar.css b/layouts/content-sidebar.css index 1e25ae8b..60b85d0b 100644 --- a/layouts/content-sidebar.css +++ b/layouts/content-sidebar.css @@ -23,3 +23,12 @@ clear: both; width: 100%; } + +.no-sidebar .content-area { + float: none; + margin-left: auto; + margin-right: auto; +} +.no-sidebar .site-main { + margin-right: 0; +} diff --git a/layouts/sidebar-content.css b/layouts/sidebar-content.css index 66342d0f..0dda00ee 100644 --- a/layouts/sidebar-content.css +++ b/layouts/sidebar-content.css @@ -23,3 +23,12 @@ clear: both; width: 100%; } + +.no-sidebar .content-area { + float: none; + margin-left: auto; + margin-right: auto; +} +.no-sidebar .site-main { + margin-right: 0; +} diff --git a/sass/layout/_content-sidebar.scss b/sass/layout/_content-sidebar.scss index 2af13c9a..507cc595 100644 --- a/sass/layout/_content-sidebar.scss +++ b/sass/layout/_content-sidebar.scss @@ -18,3 +18,5 @@ clear: both; width: $size__site-main; } + +@import "no-sidebar"; diff --git a/sass/layout/_no-sidebar.scss b/sass/layout/_no-sidebar.scss new file mode 100644 index 00000000..ae44e48c --- /dev/null +++ b/sass/layout/_no-sidebar.scss @@ -0,0 +1,11 @@ +.no-sidebar { + .content-area { + float: none; + margin-left: auto; + margin-right: auto; + } + + .site-main { + margin-right: 0; + } +} diff --git a/sass/layout/_sidebar-content.scss b/sass/layout/_sidebar-content.scss index 03eb2d84..e765590e 100644 --- a/sass/layout/_sidebar-content.scss +++ b/sass/layout/_sidebar-content.scss @@ -18,3 +18,5 @@ clear: both; width: $size__site-main; } + +@import "no-sidebar"; diff --git a/sass/site/_site.scss b/sass/site/_site.scss index 9e4b9db4..23408f0c 100644 --- a/sass/site/_site.scss +++ b/sass/site/_site.scss @@ -1,5 +1,6 @@ // @import "../layout/content-sidebar"; // @import "../layout/sidebar-content"; + /*-------------------------------------------------------------- ## Posts and pages --------------------------------------------------------------*/ From c6427768ef20dece15e0d8efeea9a38538062e02 Mon Sep 17 00:00:00 2001 From: laurelfulford Date: Tue, 12 Dec 2017 15:26:47 -1000 Subject: [PATCH 048/107] Update array using associative keys to have each value on a new line. --- inc/template-tags.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inc/template-tags.php b/inc/template-tags.php index fdf1929f..fb2d4534 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -125,7 +125,9 @@ function _s_post_thumbnail() { From 7963cf16c180d1e13daab5836aab52a39e6a2f7a Mon Sep 17 00:00:00 2001 From: Ram Ratan Maurya Date: Mon, 19 Feb 2018 16:07:07 +0530 Subject: [PATCH 049/107] Update header.php --- header.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/header.php b/header.php index 8f020723..b25ecc90 100644 --- a/header.php +++ b/header.php @@ -15,7 +15,7 @@ - + From 97620dcd7918cef26e6065373d30bfa9811e4626 Mon Sep 17 00:00:00 2001 From: Chris Runnells Date: Mon, 26 Feb 2018 14:54:27 -1000 Subject: [PATCH 050/107] Update minimum version requirement the_custom_logo() was introduced in WP 4.5, so the requirement needed to be updated to reflect this. Fixes #1249 --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index a3a47d1d..55559d10 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: automattic Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready -Requires at least: 4.0 +Requires at least: 4.5 Tested up to: 4.8 Stable tag: 1.0.0 License: GNU General Public License v2 or later From 90e08bd964a6c17093ef36fa65e8d4503139d534 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Mon, 15 Jan 2018 03:25:47 +0100 Subject: [PATCH 051/107] Travis: speed up build times by disabling Xdebug Xdebug is only **needed** when creating code coverage reports. Otherwise, it's just a nice extra, but a slow extra. Disabling it will speed up the build times. As suggested by John Blackbourn in https://johnblackbourn.com/reducing-travis-ci-build-times-for-wordpress-projects/ With an additional improvement to stabilize the command as suggested by Niklas Keller in https://twitter.com/kelunik/status/954242454676475904 --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index a40b9756..8bfa851b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,6 +46,9 @@ matrix: # 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 SNIFFS_DIR=/tmp/sniffs # Install CodeSniffer for WordPress Coding Standards checks. From 6a0e5b8df10892e26f051e8ee9aa0062bc2a60bf Mon Sep 17 00:00:00 2001 From: jrfnl Date: Mon, 15 Jan 2018 03:29:23 +0100 Subject: [PATCH 052/107] Travis: stop build testing against HHVM, test against nightly At some point in time, PHP was lagging behind and HHVM seemed like the future. What with PHP 7 being released and doing incredibly well, that time has passed and the popularity of HHVM is now marginal. This commit drops testing against HHVM and starts testing against bleeding edge PHP nightly instead. --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8bfa851b..957756ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,11 +31,11 @@ matrix: - php: '7.0' # aliased to a recent 7.2.x version - php: '7.2' - # aliased to a recent hhvm version - - php: 'hhvm' + # bleeding edge PHP + - php: 'nightly' allow_failures: - - php: 'hhvm' + - php: 'nightly' # Use this to prepare the system to install prerequisites or dependencies. # e.g. sudo apt-get update. From a0d2892cadbc290ac7e4eb507c7e5cfc55202a53 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Mon, 12 Jun 2017 01:23:31 +0200 Subject: [PATCH 053/107] :wrench: Travis: update the versions used by the various PHPCS libaries As WPCS and PHPCompatibility were for a little while (May - July 2017) not compatible with PHPCS 3.x, the library tags cloned were previously fixed to prevent issues with that. As both WPCS as well as the PHPCompatibility standard are now compatible with PHPCS 3.x, the changes made in PR 1110 and PR 1183 can be reverted. Notes: * PHPCS - use `master`. WPCS uses a limited set of sniffs from PHPCS itself. Most of these sniffs are long established, stable and rarely get updated, so using PHPCS `master` should be safe. * WPCS - use the latest release `0.14.0`. WPCS is the main source of CS violations and is under active development. This means that new versions of WPCS will easily break the build, so should be managed. * PHPCompatibility - use `master`. PHPCompatibility checks PHP cross-version compatibility. It is actively developed and heavily unit tested, so any new violations found in `_s` because of changes in that library, should actually be addressed in `_s` ASAP. The PHPCompatibility library became compatible with PHPCS 3.x and improved compatibility with Composer installs in version `8.0.0` which was a breaking change. To account for that, the location where the library is cloned to and the `phpcs --installed_paths` command have been updated. Ref: https://github.com/wimg/PHPCompatibility/pull/446 --- .travis.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index a40b9756..182a5677 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,16 +47,17 @@ matrix: # Failures in this section will result in build status 'errored'. before_script: - export PHPCS_DIR=/tmp/phpcs - - export SNIFFS_DIR=/tmp/sniffs + - export WPCS_DIR=/tmp/wpcs + - export PHPCOMPAT_DIR=/tmp/phpcompatibility # Install CodeSniffer for WordPress Coding Standards checks. - - if [[ "$SNIFF" == "1" ]]; then git clone -b 2.9.1 --depth 1 https://github.com/squizlabs/PHP_CodeSniffer.git $PHPCS_DIR; fi + - 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.11.0 --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git $SNIFFS_DIR; fi + - 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 7.1.5 --depth 1 https://github.com/wimg/PHPCompatibility.git $SNIFFS_DIR/PHPCompatibility; fi + - 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/scripts/phpcs --config-set installed_paths $SNIFFS_DIR; fi + - 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. @@ -83,7 +84,7 @@ script: # @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/scripts/phpcs; fi + - if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/bin/phpcs; fi # Receive notifications for build results. # @link https://docs.travis-ci.com/user/notifications/#Email-notifications From 94767ab0513f744375bfcb07412b26f61b1f9526 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Tue, 27 Feb 2018 10:18:26 +0100 Subject: [PATCH 054/107] :wrench: PHPCS: tidy up config file Comply with strict XML standard. --- phpcs.xml.dist | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 5a4ab66b..b6571958 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -24,16 +24,16 @@ - - - + + + - + @@ -41,7 +41,7 @@ on the theme hierarchy. --> - + @@ -50,7 +50,7 @@ as set in the "Requires at least" tag in the readme.txt file. --> - + From 92d8673e4a087767d3f4cf9bd084f9bd1a956bc1 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Tue, 27 Feb 2018 11:08:06 +0100 Subject: [PATCH 055/107] :wrench: PHPCS: add section headings This is intended to make it clearer for a newcomer to PHPCS to understand how the ruleset is build up and what each part of the ruleset means. --- phpcs.xml.dist | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/phpcs.xml.dist b/phpcs.xml.dist index b6571958..c8e95d43 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -8,6 +8,14 @@ A custom set of code standard rules to check for WordPress themes. + + + . - + + + + + + @@ -54,7 +75,13 @@ - + + + From c453749f7aec170c4ea1641a7f0ede04df159fda Mon Sep 17 00:00:00 2001 From: jrfnl Date: Tue, 27 Feb 2018 11:09:06 +0100 Subject: [PATCH 056/107] :wrench: PHPCS: don't ignore warnings, don't list scanned files The `-n` flag will ignore warnings completely, while often it is useful to see them and to fix them. Using `--runtime-set ignore_warnings_on_exit 1` in the Travis script instead, warnings will be shown, both when a developer runs PHPCS on their own machine, as well as in Travis, but warnings will not cause a failed Travis build. The `-v` flag will list each file being scanned. This is intended for debugging purposes and not needed for normal use. --- .travis.yml | 2 +- phpcs.xml.dist | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 182a5677..cb3b4105 100644 --- a/.travis.yml +++ b/.travis.yml @@ -84,7 +84,7 @@ script: # @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; fi + - if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/bin/phpcs --runtime-set ignore_warnings_on_exit 1; fi # Receive notifications for build results. # @link https://docs.travis-ci.com/user/notifications/#Email-notifications diff --git a/phpcs.xml.dist b/phpcs.xml.dist index c8e95d43..69e0c59f 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -19,10 +19,8 @@ - + From dd7a1604e6331976b2f1d04243eacd751b8fe005 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Tue, 27 Feb 2018 10:29:07 +0100 Subject: [PATCH 057/107] :wrench: PHPCS: clean up the file paths PHPCS shows This uses a new feature which is available since PHPCS 3.x. --- phpcs.xml.dist | 3 +++ 1 file changed, 3 insertions(+) diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 69e0c59f..8e9ed7b8 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -22,6 +22,9 @@ --> + + + From 878fbde6c49a88f9298aeb76653ce4218772b208 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Tue, 27 Feb 2018 10:31:24 +0100 Subject: [PATCH 058/107] :wrench: PHPCS: speed up by checking files in parallel This uses a new feature which is available since PHPCS 3.x. The effect will depend on the system on which PHPCS is being run, but if parallel processing can be run, the build should be faster using this option. --- phpcs.xml.dist | 3 +++ 1 file changed, 3 insertions(+) diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 8e9ed7b8..bc7a1eec 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -25,6 +25,9 @@ + + + From 9ff286964b68e3acdc63e64ab5ee5f5ba19734d1 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Tue, 27 Feb 2018 10:34:58 +0100 Subject: [PATCH 059/107] :wrench: PHPCS: specify the minimum supported WP version A number of additional sniffs have been added to WPCS which all use the `minimum_supported_version` property to know which WP version to check against. As setting these properties for each sniff becomes tedious and would necessitate the ruleset to be adjusted each time a new sniff which uses that property becomes available, WPCS now offers a (forward-compatible) way to set the minimum supported WP version for all sniffs in one go. --- phpcs.xml.dist | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/phpcs.xml.dist b/phpcs.xml.dist index bc7a1eec..2fe41af1 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -70,14 +70,10 @@ - - - - - - + + + + + + + + + + + + + + + + + + + From cb7117a40891573e541f4cc9b2796de5892740ae Mon Sep 17 00:00:00 2001 From: jrfnl Date: Tue, 27 Feb 2018 10:49:06 +0100 Subject: [PATCH 062/107] :wrench: PHPCS: add a comprehensive PHPCompatibility exceptions ruleset WordPress provides backfills for a number of PHP native functions and constants. These can therefore be safely used in themes and plugins. This commit adds a whitelist for the PHPCompatibility ruleset of the backfills currently provided by WP. N.B.: At this moment, none of the whitelisted classes/constants/functions/interfaces are used in `_s`. However, `_s` is also a teaching tool and an example for others, so having this whitelist block in there serves that purpose and allows for themes which are build onto `_s` to use these PHP features without having to worry about cross-version compatibility notices. --- phpcs.xml.dist | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 66317a71..ad4fab4c 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -103,5 +103,34 @@ - + + + + + + + + + + + + + + + + + + + + + + + + From 7c24fc751d24707148071a71bae63fc6a1222dac Mon Sep 17 00:00:00 2001 From: jrfnl Date: Tue, 27 Feb 2018 14:06:45 +0100 Subject: [PATCH 063/107] :wrench: PHPCS: remove exclusions The ruleset contained some exclusions which are no longer needed. --- phpcs.xml.dist | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/phpcs.xml.dist b/phpcs.xml.dist index ad4fab4c..578ce025 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -41,11 +41,7 @@ ############################################################################# --> - - - - - + ' . sprintf( esc_html__( 'Try looking in the monthly archives. %1$s', '_s' ), convert_smilies( ':)' ) ) . '

    '; + the_widget( 'WP_Widget_Archives', 'dropdown=1', "after_title=

    $archive_content" ); - /* translators: %1$s: smiley */ - $archive_content = '

    ' . sprintf( esc_html__( 'Try looking in the monthly archives. %1$s', '_s' ), convert_smilies( ':)' ) ) . '

    '; - the_widget( 'WP_Widget_Archives', 'dropdown=1', "after_title=$archive_content" ); - - the_widget( 'WP_Widget_Tag_Cloud' ); + the_widget( 'WP_Widget_Tag_Cloud' ); ?>
  • diff --git a/archive.php b/archive.php index 9cf53756..84d760ca 100644 --- a/archive.php +++ b/archive.php @@ -7,24 +7,25 @@ * @package _s */ -get_header(); ?> +get_header(); +?>
    - + get_template_part( 'template-parts/content', 'none' ); - endif; ?> + endif; + ?>
    diff --git a/comments.php b/comments.php index 28ebdbb1..dc2853e1 100644 --- a/comments.php +++ b/comments.php @@ -24,7 +24,8 @@ if ( post_password_required() ) { + if ( have_comments() ) : + ?>

    'ol', - 'short_ping' => true, - ) ); + wp_list_comments( array( + 'style' => 'ol', + 'short_ping' => true, + ) ); ?> - + if ( ! comments_open() ) : + ?>

    -
    - "> + + ?> + | - Automattic' ); - ?> + ?>

    diff --git a/header.php b/header.php index 8f020723..c0396e48 100644 --- a/header.php +++ b/header.php @@ -28,27 +28,29 @@
    + if ( is_front_page() && is_home() ) : + ?>

    - +

    - + if ( $description || is_customize_preview() ) : + ?>

    - +
    diff --git a/inc/custom-header.php b/inc/custom-header.php index 97b1db28..d42fbadd 100644 --- a/inc/custom-header.php +++ b/inc/custom-header.php @@ -51,16 +51,16 @@ if ( ! function_exists( '_s_header_style' ) ) : + ?> .site-title, .site-description { position: absolute; clip: rect(1px, 1px, 1px, 1px); } - + ?> .site-title a, .site-description { color: #; diff --git a/index.php b/index.php index 39fccd5a..07b627e4 100644 --- a/index.php +++ b/index.php @@ -12,7 +12,8 @@ * @package _s */ -get_header(); ?> +get_header(); +?>
    @@ -20,16 +21,17 @@ get_header(); ?> + if ( is_home() && ! is_front_page() ) : + ?>

    - - get_template_part( 'template-parts/content', 'none' ); - endif; ?> + endif; + ?>
    diff --git a/page.php b/page.php index e04d218f..9c840673 100644 --- a/page.php +++ b/page.php @@ -12,23 +12,25 @@ * @package _s */ -get_header(); ?> +get_header(); +?>
    - + endwhile; // End of the loop. + ?>
    diff --git a/search.php b/search.php index 9f6b79df..d0914266 100644 --- a/search.php +++ b/search.php @@ -7,24 +7,27 @@ * @package _s */ -get_header(); ?> +get_header(); +?>
    - + get_template_part( 'template-parts/content', 'none' ); - endif; ?> + endif; + ?>
    diff --git a/single.php b/single.php index b17f8a29..4d60b1e7 100644 --- a/single.php +++ b/single.php @@ -7,13 +7,15 @@ * @package _s */ -get_header(); ?> +get_header(); +?>
    + if ( is_home() && current_user_can( 'publish_posts' ) ) : -

    Get started here.', '_s' ), - array( - 'a' => array( - 'href' => array(), - ), - ) - ), - esc_url( admin_url( 'post-new.php' ) ) - ); - ?>

    + printf( + '

    ' . wp_kses( + /* translators: 1: link to WP admin new post page. */ + __( 'Ready to publish your first post? Get started here.', '_s' ), + array( + 'a' => array( + 'href' => array(), + ), + ) + ) . '

    ', + esc_url( admin_url( 'post-new.php' ) ) + ); - + elseif ( is_search() ) : + ?>

    + else : + ?>

    + endif; + ?>
    diff --git a/template-parts/content-page.php b/template-parts/content-page.php index e26d5d05..b20eff0c 100644 --- a/template-parts/content-page.php +++ b/template-parts/content-page.php @@ -18,34 +18,34 @@
    '', - ) ); + wp_link_pages( array( + 'before' => '', + ) ); ?>
    %s', '_s' ), - array( - 'span' => array( - 'class' => array(), - ), - ) - ), - get_the_title() + edit_post_link( + sprintf( + wp_kses( + /* translators: %s: Name of current post. Only visible to screen readers */ + __( 'Edit %s', '_s' ), + array( + 'span' => array( + 'class' => array(), + ), + ) ), - '', - '' - ); + get_the_title() + ), + '', + '' + ); ?>
    diff --git a/template-parts/content.php b/template-parts/content.php index a74522cd..65ab4bb2 100644 --- a/template-parts/content.php +++ b/template-parts/content.php @@ -18,38 +18,38 @@ the_title( '

    ', '

    ' ); endif; - if ( 'post' === get_post_type() ) : ?> - +
    "%s"', '_s' ), - array( - 'span' => array( - 'class' => array(), - ), - ) - ), - 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(), + ), + ) + ), + get_the_title() + ) ); - wp_link_pages( array( - 'before' => '', - ) ); + wp_link_pages( array( + 'before' => '', + ) ); ?>
    From ec877e48c3dc2fbf22d5f10d031f6d916f32512e Mon Sep 17 00:00:00 2001 From: jrfnl Date: Tue, 27 Feb 2018 11:18:50 +0100 Subject: [PATCH 066/107] CS: fix up embedded PHP inconsistencies introduced in the mean time. --- 404.php | 4 ++-- inc/custom-header.php | 6 +++--- inc/template-tags.php | 21 +++++++++++---------- inc/woocommerce.php | 20 ++++++++++---------- template-parts/content-search.php | 4 ++-- template-parts/content.php | 4 ++-- 6 files changed, 30 insertions(+), 29 deletions(-) diff --git a/404.php b/404.php index ea8c1a20..9cc9cb66 100644 --- a/404.php +++ b/404.php @@ -22,9 +22,9 @@ get_header();

    diff --git a/inc/custom-header.php b/inc/custom-header.php index d42fbadd..a4c2a6cc 100644 --- a/inc/custom-header.php +++ b/inc/custom-header.php @@ -57,9 +57,9 @@ if ( ! function_exists( '_s_header_style' ) ) : position: absolute; clip: rect(1px, 1px, 1px, 1px); } - .site-title a, .site-description { diff --git a/inc/template-tags.php b/inc/template-tags.php index 164970ab..f02759c5 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -124,24 +124,25 @@ function _s_post_thumbnail() { } if ( is_singular() ) : - ?> + ?> -
    - -
    +
    + +
    -
    - + ?>
    - - - cart->get_cart_subtotal() ); ?> cart->get_cart_contents_count(), '_s' ), WC()->cart->get_cart_contents_count() ) );?> - + + + cart->get_cart_subtotal() ); ?> cart->get_cart_contents_count(), '_s' ), WC()->cart->get_cart_contents_count() ) ); ?> +
  • '', - ); + $instance = array( + 'title' => '', + ); - the_widget( 'WC_Widget_Cart', $instance ); + the_widget( 'WC_Widget_Cart', $instance ); ?>
  • diff --git a/template-parts/content-search.php b/template-parts/content-search.php index 4068b8bb..b25dadf2 100644 --- a/template-parts/content-search.php +++ b/template-parts/content-search.php @@ -16,8 +16,8 @@ diff --git a/template-parts/content.php b/template-parts/content.php index 65ab4bb2..0573e82e 100644 --- a/template-parts/content.php +++ b/template-parts/content.php @@ -21,10 +21,10 @@ if ( 'post' === get_post_type() ) : ?> From 98e3e75109b5636a4801f367f1e4403b4d7c48bb Mon Sep 17 00:00:00 2001 From: jrfnl Date: Tue, 27 Feb 2018 11:35:30 +0100 Subject: [PATCH 067/107] CS: prefix all variables While template files are intended to be included from within a function, this doesn't guarantee they always will be. Therefore all variables declared within template files also need to be prefixed with a theme specific prefix. As these are "local" variables, renaming them does not constitute a BC-break. --- 404.php | 4 ++-- comments.php | 8 ++++---- header.php | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/404.php b/404.php index 9cc9cb66..62c3e068 100644 --- a/404.php +++ b/404.php @@ -44,8 +44,8 @@ get_header(); ' . sprintf( esc_html__( 'Try looking in the monthly archives. %1$s', '_s' ), convert_smilies( ':)' ) ) . '

    '; - the_widget( 'WP_Widget_Archives', 'dropdown=1', "after_title=$archive_content" ); + $_s_archive_content = '

    ' . sprintf( esc_html__( 'Try looking in the monthly archives. %1$s', '_s' ), convert_smilies( ':)' ) ) . '

    '; + the_widget( 'WP_Widget_Archives', 'dropdown=1', "after_title=$_s_archive_content" ); the_widget( 'WP_Widget_Tag_Cloud' ); ?> diff --git a/comments.php b/comments.php index dc2853e1..2c94bfd0 100644 --- a/comments.php +++ b/comments.php @@ -28,8 +28,8 @@ if ( post_password_required() ) { ?>

    ' . get_the_title() . '' ); } diff --git a/header.php b/header.php index c0396e48..776cbdcd 100644 --- a/header.php +++ b/header.php @@ -37,10 +37,10 @@

    -

    +

    From 1abaebcdaa3bdc189208de6c4f3cefd2ef9787d4 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Tue, 27 Feb 2018 13:59:07 +0100 Subject: [PATCH 068/107] CS: correct indentation of a newly introduced function --- inc/template-tags.php | 56 +++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/inc/template-tags.php b/inc/template-tags.php index f02759c5..056291d5 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -112,37 +112,37 @@ if ( ! function_exists( '_s_entry_footer' ) ) : endif; if ( ! function_exists( '_s_post_thumbnail' ) ) : -/** - * Displays an optional post thumbnail. - * - * Wraps the post thumbnail in an anchor element on index views, or a div - * element when on single views. - */ -function _s_post_thumbnail() { - if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { - return; - } + /** + * Displays an optional post thumbnail. + * + * Wraps the post thumbnail in an anchor element on index views, or a div + * element when on single views. + */ + function _s_post_thumbnail() { + if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { + return; + } - if ( is_singular() ) : - ?> + if ( is_singular() ) : + ?> -
    - -
    +
    + +
    - + + + - - - Date: Tue, 27 Feb 2018 14:05:41 +0100 Subject: [PATCH 069/107] CS: reformat a very long line This line was quite unreadable. Additionally, it was using the "heavy" `wp_kses_data()` function to escape item count phrase, while that phrase should not contain HTML in the first place and therefore can use the lighter `esc_html()` function to do the output escaping. --- inc/woocommerce.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/inc/woocommerce.php b/inc/woocommerce.php index 28933f35..6d6000ed 100644 --- a/inc/woocommerce.php +++ b/inc/woocommerce.php @@ -225,8 +225,14 @@ if ( ! function_exists( '_s_woocommerce_cart_link' ) ) { function _s_woocommerce_cart_link() { ?> - - cart->get_cart_subtotal() ); ?> cart->get_cart_contents_count(), '_s' ), WC()->cart->get_cart_contents_count() ) ); ?> + cart->get_cart_contents_count(), '_s' ), + WC()->cart->get_cart_contents_count() + ); + ?> + cart->get_cart_subtotal() ); ?> Date: Tue, 27 Feb 2018 15:03:17 +0100 Subject: [PATCH 070/107] Contributing: add directive about compliance with WPCS --- .github/CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 11c023c4..a8bbf9bb 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -22,6 +22,7 @@ Found a bug you can fix? Fantastic! Patches are always welcome. Here's a few tip * Include the purpose of your PR. Be explicit about the issue your PR solves. * Reference any existing issues that relate to your PR. This allows everyone to easily see all related discussions. * When submitting a change that affects CSS, please make sure that both SCSS sources and output CSS have been updated equally. +* `_s` complies with the [WordPress Coding Standards](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/) and any PR should comply as well. By contributing code to `_s`, you grant its use under the [GNU General Public License v2 (or later)](LICENSE). From 47829ce9cdc02f0c1807e2bc7164b0dcc2032422 Mon Sep 17 00:00:00 2001 From: Laurel Fulford Date: Tue, 27 Feb 2018 17:07:58 -0800 Subject: [PATCH 071/107] Replace the get_post_format() calls in get_template_part() to complete the post format removal that was started in #1017. Fixes #1148. --- archive.php | 6 +++--- inc/jetpack.php | 2 +- index.php | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/archive.php b/archive.php index 9cf53756..856d8a1b 100644 --- a/archive.php +++ b/archive.php @@ -27,11 +27,11 @@ get_header(); ?> while ( have_posts() ) : the_post(); /* - * Include the Post-Format-specific template for the content. + * Include the Post-Type-specific template for the content. * If you want to override this in a child theme, then include a file - * called content-___.php (where ___ is the Post Format name) and that will be used instead. + * called content-___.php (where ___ is the Post Type name) and that will be used instead. */ - get_template_part( 'template-parts/content', get_post_format() ); + get_template_part( 'template-parts/content', get_post_type() ); endwhile; diff --git a/inc/jetpack.php b/inc/jetpack.php index 172afb81..38310991 100644 --- a/inc/jetpack.php +++ b/inc/jetpack.php @@ -53,7 +53,7 @@ function _s_infinite_scroll_render() { if ( is_search() ) : get_template_part( 'template-parts/content', 'search' ); else : - get_template_part( 'template-parts/content', get_post_format() ); + get_template_part( 'template-parts/content', get_post_type() ); endif; } } diff --git a/index.php b/index.php index 39fccd5a..9cf6a60e 100644 --- a/index.php +++ b/index.php @@ -32,11 +32,11 @@ get_header(); ?> while ( have_posts() ) : the_post(); /* - * Include the Post-Format-specific template for the content. + * Include the Post-Type-specific template for the content. * If you want to override this in a child theme, then include a file - * called content-___.php (where ___ is the Post Format name) and that will be used instead. + * called content-___.php (where ___ is the Post Type name) and that will be used instead. */ - get_template_part( 'template-parts/content', get_post_format() ); + get_template_part( 'template-parts/content', get_post_type() ); endwhile; From 36d551ea406ec906306627cd29bb92386078f5aa Mon Sep 17 00:00:00 2001 From: Ismail El Korchi Date: Wed, 28 Feb 2018 14:22:10 +0000 Subject: [PATCH 072/107] Update Normalize.css to v8.0.0 Fixes https://github.com/Automattic/_s/issues/1269 --- sass/_normalize.scss | 397 ++++++++++++++++++++++++++++--------------- style.css | 397 ++++++++++++++++++++++++++++--------------- 2 files changed, 528 insertions(+), 266 deletions(-) diff --git a/sass/_normalize.scss b/sass/_normalize.scss index 3046bebc..c5ad67a1 100644 --- a/sass/_normalize.scss +++ b/sass/_normalize.scss @@ -1,82 +1,119 @@ +/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */ + +/* Document + ========================================================================== */ + +/** + * 1. Correct the line height in all browsers. + * 2. Prevent adjustments of font size after orientation changes in iOS. + */ + html { - font-family: sans-serif; - -webkit-text-size-adjust: 100%; - -ms-text-size-adjust: 100%; + line-height: 1.15; /* 1 */ + -webkit-text-size-adjust: 100%; /* 2 */ } +/* Sections + ========================================================================== */ + +/** + * Remove the margin in all browsers. + */ + body { margin: 0; } -article, -aside, -details, -figcaption, -figure, -footer, -header, -main, -menu, -nav, -section, -summary { - display: block; -} - -audio, -canvas, -progress, -video { - display: inline-block; - vertical-align: baseline; -} - -audio:not([controls]) { - display: none; - height: 0; -} - -[hidden], -template { - display: none; -} - -a { - background-color: transparent; -} - -a:active, -a:hover { - outline: 0; -} - -abbr[title] { - border-bottom: 1px dotted; -} - -b, -strong { - font-weight: bold; -} - -dfn { - font-style: italic; -} +/** + * 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; } -mark { - background: #ff0; - color: #000; +/* Grouping content + ========================================================================== */ + +/** + * 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 */ } +/** + * 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 */ +} + +/* Text-level semantics + ========================================================================== */ + +/** + * Remove the gray background on active links in IE 10. + */ + +a { + background-color: transparent; +} + +/** + * 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 */ +} + +/** + * Add the correct font weight in Chrome, Edge, and Safari. + */ + +b, +strong { + font-weight: bolder; +} + +/** + * 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 */ +} + +/** + * Add the correct font size in all browsers. + */ + small { font-size: 80%; } +/** + * Prevent `sub` and `sup` elements from affecting the line height in + * all browsers. + */ + sub, sup { font-size: 75%; @@ -85,126 +122,220 @@ sup { vertical-align: baseline; } -sup { - top: -0.5em; -} - sub { bottom: -0.25em; } +sup { + top: -0.5em; +} + +/* Embedded content + ========================================================================== */ + +/** + * Remove the border on images inside links in IE 10. + */ + img { - border: 0; + border-style: none; } -svg:not(:root) { - overflow: hidden; -} +/* Forms + ========================================================================== */ -figure { - margin: 1em 40px; -} - -hr { - box-sizing: content-box; - height: 0; -} - -pre { - overflow: auto; -} - -code, -kbd, -pre, -samp { - font-family: monospace, monospace; - font-size: 1em; -} +/** + * 1. Change the font styles in all browsers. + * 2. Remove the margin in Firefox and Safari. + */ button, input, optgroup, select, textarea { - color: inherit; - font: inherit; - margin: 0; + font-family: inherit; /* 1 */ + font-size: 100%; /* 1 */ + line-height: 1.15; /* 1 */ + margin: 0; /* 2 */ } -button { +/** + * Show the overflow in IE. + * 1. Show the overflow in Edge. + */ + +button, +input { /* 1 */ overflow: visible; } +/** + * Remove the inheritance of text transform in Edge, Firefox, and IE. + * 1. Remove the inheritance of text transform in Firefox. + */ + button, -select { +select { /* 1 */ text-transform: none; } +/** + * Correct the inability to style clickable types in iOS and Safari. + */ + button, -html input[type="button"], -input[type="reset"], -input[type="submit"] { +[type="button"], +[type="reset"], +[type="submit"] { -webkit-appearance: button; - cursor: pointer; } -button[disabled], -html input[disabled] { - cursor: default; -} +/** + * Remove the inner border and padding in Firefox. + */ button::-moz-focus-inner, -input::-moz-focus-inner { - border: 0; +[type="button"]::-moz-focus-inner, +[type="reset"]::-moz-focus-inner, +[type="submit"]::-moz-focus-inner { + border-style: none; padding: 0; } -input { - line-height: normal; +/** + * Restore the focus styles unset by the previous rule. + */ + +button:-moz-focusring, +[type="button"]:-moz-focusring, +[type="reset"]:-moz-focusring, +[type="submit"]:-moz-focusring { + outline: 1px dotted ButtonText; } -input[type="checkbox"], -input[type="radio"] { - box-sizing: border-box; - padding: 0; -} - -input[type="number"]::-webkit-inner-spin-button, -input[type="number"]::-webkit-outer-spin-button { - height: auto; -} - -input[type="search"]::-webkit-search-cancel-button, -input[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; -} +/** + * Correct the padding in Firefox. + */ fieldset { - border: 1px solid #c0c0c0; - margin: 0 2px; - padding: 0.35em 0.625em 0.75em; + padding: 0.35em 0.75em 0.625em; } +/** + * 1. Correct the text wrapping in Edge and IE. + * 2. Correct the color inheritance from `fieldset` elements in IE. + * 3. Remove the padding so developers are not caught out when they zero out + * `fieldset` elements in all browsers. + */ + legend { - border: 0; - padding: 0; + box-sizing: border-box; /* 1 */ + color: inherit; /* 2 */ + display: table; /* 1 */ + max-width: 100%; /* 1 */ + padding: 0; /* 3 */ + white-space: normal; /* 1 */ } +/** + * Add the correct vertical alignment in Chrome, Firefox, and Opera. + */ + +progress { + vertical-align: baseline; +} + +/** + * Remove the default vertical scrollbar in IE 10+. + */ + textarea { overflow: auto; } -optgroup { - font-weight: bold; +/** + * 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 */ } -table { - border-collapse: collapse; - border-spacing: 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; } -td, -th { - padding: 0; +/** + * 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 */ +} + +/** + * Remove the inner padding in Chrome and Safari on macOS. + */ + +[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * 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 */ +} + +/* Interactive + ========================================================================== */ + +/* + * Add the correct display in Edge, IE 10+, and Firefox. + */ + +details { + display: block; +} + +/* + * Add the correct display in all browsers. + */ + +summary { + display: list-item; +} + +/* Misc + ========================================================================== */ + +/** + * Add the correct display in IE 10+. + */ + +template { + display: none; +} + +/** + * Add the correct display in IE 10. + */ + +[hidden] { + display: none; } diff --git a/style.css b/style.css index 8ec6421c..acda325c 100644 --- a/style.css +++ b/style.css @@ -44,85 +44,122 @@ Nicolas Gallagher and Jonathan Neal https://necolas.github.io/normalize.css/ /*-------------------------------------------------------------- # Normalize --------------------------------------------------------------*/ +/* normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */ + +/* Document + ========================================================================== */ + +/** + * 1. Correct the line height in all browsers. + * 2. Prevent adjustments of font size after orientation changes in iOS. + */ + html { - font-family: sans-serif; - -webkit-text-size-adjust: 100%; - -ms-text-size-adjust: 100%; + line-height: 1.15; /* 1 */ + -webkit-text-size-adjust: 100%; /* 2 */ } +/* Sections + ========================================================================== */ + +/** + * Remove the margin in all browsers. + */ + body { margin: 0; } -article, -aside, -details, -figcaption, -figure, -footer, -header, -main, -menu, -nav, -section, -summary { - display: block; -} - -audio, -canvas, -progress, -video { - display: inline-block; - vertical-align: baseline; -} - -audio:not([controls]) { - display: none; - height: 0; -} - -[hidden], -template { - display: none; -} - -a { - background-color: transparent; -} - -a:active, -a:hover { - outline: 0; -} - -abbr[title] { - border-bottom: 1px dotted; -} - -b, -strong { - font-weight: bold; -} - -dfn { - font-style: italic; -} +/** + * 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; } -mark { - background: #ff0; - color: #000; +/* Grouping content + ========================================================================== */ + +/** + * 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 */ } +/** + * 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 */ +} + +/* Text-level semantics + ========================================================================== */ + +/** + * Remove the gray background on active links in IE 10. + */ + +a { + background-color: transparent; +} + +/** + * 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 */ +} + +/** + * Add the correct font weight in Chrome, Edge, and Safari. + */ + +b, +strong { + font-weight: bolder; +} + +/** + * 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 */ +} + +/** + * Add the correct font size in all browsers. + */ + small { font-size: 80%; } +/** + * Prevent `sub` and `sup` elements from affecting the line height in + * all browsers. + */ + sub, sup { font-size: 75%; @@ -131,128 +168,222 @@ sup { vertical-align: baseline; } -sup { - top: -0.5em; -} - sub { bottom: -0.25em; } +sup { + top: -0.5em; +} + +/* Embedded content + ========================================================================== */ + +/** + * Remove the border on images inside links in IE 10. + */ + img { - border: 0; + border-style: none; } -svg:not(:root) { - overflow: hidden; -} +/* Forms + ========================================================================== */ -figure { - margin: 1em 40px; -} - -hr { - box-sizing: content-box; - height: 0; -} - -pre { - overflow: auto; -} - -code, -kbd, -pre, -samp { - font-family: monospace, monospace; - font-size: 1em; -} +/** + * 1. Change the font styles in all browsers. + * 2. Remove the margin in Firefox and Safari. + */ button, input, optgroup, select, textarea { - color: inherit; - font: inherit; - margin: 0; + font-family: inherit; /* 1 */ + font-size: 100%; /* 1 */ + line-height: 1.15; /* 1 */ + margin: 0; /* 2 */ } -button { +/** + * Show the overflow in IE. + * 1. Show the overflow in Edge. + */ + +button, +input { /* 1 */ overflow: visible; } +/** + * Remove the inheritance of text transform in Edge, Firefox, and IE. + * 1. Remove the inheritance of text transform in Firefox. + */ + button, -select { +select { /* 1 */ text-transform: none; } +/** + * Correct the inability to style clickable types in iOS and Safari. + */ + button, -html input[type="button"], -input[type="reset"], -input[type="submit"] { +[type="button"], +[type="reset"], +[type="submit"] { -webkit-appearance: button; - cursor: pointer; } -button[disabled], -html input[disabled] { - cursor: default; -} +/** + * Remove the inner border and padding in Firefox. + */ button::-moz-focus-inner, -input::-moz-focus-inner { - border: 0; +[type="button"]::-moz-focus-inner, +[type="reset"]::-moz-focus-inner, +[type="submit"]::-moz-focus-inner { + border-style: none; padding: 0; } -input { - line-height: normal; +/** + * Restore the focus styles unset by the previous rule. + */ + +button:-moz-focusring, +[type="button"]:-moz-focusring, +[type="reset"]:-moz-focusring, +[type="submit"]:-moz-focusring { + outline: 1px dotted ButtonText; } -input[type="checkbox"], -input[type="radio"] { - box-sizing: border-box; - padding: 0; -} - -input[type="number"]::-webkit-inner-spin-button, -input[type="number"]::-webkit-outer-spin-button { - height: auto; -} - -input[type="search"]::-webkit-search-cancel-button, -input[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; -} +/** + * Correct the padding in Firefox. + */ fieldset { - border: 1px solid #c0c0c0; - margin: 0 2px; - padding: 0.35em 0.625em 0.75em; + padding: 0.35em 0.75em 0.625em; } +/** + * 1. Correct the text wrapping in Edge and IE. + * 2. Correct the color inheritance from `fieldset` elements in IE. + * 3. Remove the padding so developers are not caught out when they zero out + * `fieldset` elements in all browsers. + */ + legend { - border: 0; - padding: 0; + box-sizing: border-box; /* 1 */ + color: inherit; /* 2 */ + display: table; /* 1 */ + max-width: 100%; /* 1 */ + padding: 0; /* 3 */ + white-space: normal; /* 1 */ } +/** + * Add the correct vertical alignment in Chrome, Firefox, and Opera. + */ + +progress { + vertical-align: baseline; +} + +/** + * Remove the default vertical scrollbar in IE 10+. + */ + textarea { overflow: auto; } -optgroup { - font-weight: bold; +/** + * 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 */ } -table { - border-collapse: collapse; - border-spacing: 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; } -td, -th { - padding: 0; +/** + * 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 */ +} + +/** + * Remove the inner padding in Chrome and Safari on macOS. + */ + +[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * 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 */ +} + +/* Interactive + ========================================================================== */ + +/* + * Add the correct display in Edge, IE 10+, and Firefox. + */ + +details { + display: block; +} + +/* + * Add the correct display in all browsers. + */ + +summary { + display: list-item; +} + +/* Misc + ========================================================================== */ + +/** + * Add the correct display in IE 10+. + */ + +template { + display: none; +} + +/** + * Add the correct display in IE 10. + */ + +[hidden] { + display: none; } /*-------------------------------------------------------------- From 884a7b082161f0ff98f61d864a60cc5fa0de60b9 Mon Sep 17 00:00:00 2001 From: Matthew Boynes Date: Fri, 16 Mar 2018 20:39:14 -0400 Subject: [PATCH 073/107] Fix datetime values --- inc/template-tags.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/template-tags.php b/inc/template-tags.php index 056291d5..769c6ac1 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -18,9 +18,9 @@ if ( ! function_exists( '_s_posted_on' ) ) : } $time_string = sprintf( $time_string, - esc_attr( get_the_date( 'c' ) ), + esc_attr( get_the_date( DATE_W3C ) ), esc_html( get_the_date() ), - esc_attr( get_the_modified_date( 'c' ) ), + esc_attr( get_the_modified_date( DATE_W3C ) ), esc_html( get_the_modified_date() ) ); From 43cfcb96dd3c75941c40ad32c946c4dcaf901edc Mon Sep 17 00:00:00 2001 From: Laurel Fulford Date: Fri, 26 Jan 2018 10:10:16 -0800 Subject: [PATCH 074/107] Add 'tabindex=-1' to the featured image markup, to improve accessibility. --- inc/template-tags.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/template-tags.php b/inc/template-tags.php index 056291d5..19dc5916 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -132,7 +132,7 @@ if ( ! function_exists( '_s_post_thumbnail' ) ) : -
    diff --git a/inc/template-tags.php b/inc/template-tags.php index bc5fd31f..652709e0 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 082/107] 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 6d6000ed..2bc6ff98 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 083/107] 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 2c94bfd0..adf9b157 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 652709e0..3c7426af 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 b20eff0c..7339a9c3 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 0573e82e..2e58962e 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 084/107] 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 62c3e068..ba5d537a 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 adf9b157..364973f5 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 b7134e76..c440ca41 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 0b9ec523..527ab38b 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 39cb10b0..5176f171 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 190c3d9f..10e277d1 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 38310991..2a82dfb5 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 3c7426af..a9a1f1b0 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 757367a2..94c739b6 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 3ffa7cc8..fa926517 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 0037752e..bf9367e0 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 2f688149..cf93249a 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 fcda0c11..f1263664 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 cc54f951..cdd89c32 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 2036ef92..94fd5bd8 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 ae44e48c..07cce07c 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 c299bfe8..1f7f60c3 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 c1773b8c..f42aa463 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 2578a21c..54ff5336 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 469887cc..13617885 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 853df289..c74338d9 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 444b6b60..facc0934 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 11721379..87a79869 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 95a5b4d2..2e59a073 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 1a2b0402..d88b0a68 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 3aebbcc9..fbd8d4af 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 996116a8..9a4633d7 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 3d4dd985..ddbe13c1 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 7c0fe1c3..db1e7231 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 0b282811..7b76ceed 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 63324b2d..2336d79d 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 13760c5c..df8485a0 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 1d5190d3..e3fd9d74 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 db7411f3..31b11f4d 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 8333692d..2c41a742 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 b25e6cc2..db6f863a 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 f2dba39a..3b9e719e 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 302891ea..324432fd 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 e8b987eb..80bc7422 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 7339a9c3..3d34fc34 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 2e58962e..4f7ee77d 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 085/107] 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 3d51c6e6..624e244c 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 c440ca41..32d2dcc2 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 086/107] 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 55559d10..5b1c18ce 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 087/107] 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 00000000..961aa9c2 --- /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 00000000..fff7c8fa --- /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 edf97acd..00000000 --- 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 eef19b5c..00000000 --- a/.jshintignore +++ /dev/null @@ -1 +0,0 @@ -js/**.min.js diff --git a/.stylelintrc.json b/.stylelintrc.json new file mode 100644 index 00000000..1927566c --- /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 4840c9fe..61cc0a39 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 00000000..2199d47e --- /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 00000000..7465b0cd --- /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 578ce025..2105118f 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 088/107] Disable block-no-empty rule --- .stylelintrc.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.stylelintrc.json b/.stylelintrc.json index 1927566c..2a2f6fd7 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 089/107] Update dependencies --- composer.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 2199d47e..ba9666b3 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 7465b0cd..7e91688b 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 090/107] 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 2a2f6fd7..2c7b6b4b 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 61cc0a39..4545c1dd 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 091/107] 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 59216a24..3097dc76 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 5b1c18ce..66fc7663 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 e3fd9d74..445764d2 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 7c2b6452..5f925a3b 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 092/107] 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 2c7b6b4b..55b598d8 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 7e91688b..da584ee8 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 c59ed61e..8729dfd8 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 c5ad67a1..a7301ab6 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 cf93249a..51ebb301 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 13617885..b935555b 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 87a79869..88674446 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 fbd8d4af..abe52aa9 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 ddbe13c1..ec403b18 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 db1e7231..d3ecff59 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 7b76ceed..36a0ffd8 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 09b3d742..418343e5 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 80bc7422..0a442c0b 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 5f925a3b..ca1e0eaf 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 d1308c51..d8d0b74a 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 093/107] 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 ba9666b3..d96462f7 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 094/107] 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 fa926517..2dc69932 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 095/107] 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 2dc69932..ee18d754 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 096/107] 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 d96462f7..4bfdcb98 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 3097dc76..22e332b9 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 097/107] 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 fff16adf..a66e74bd 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 ec403b18..5d39372e 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 d8d0b74a..a8844005 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%; } } From b44cdaecbcfeff57ff7c03d1bb6daa552a7b90ed Mon Sep 17 00:00:00 2001 From: Jared Caraway Date: Wed, 27 Jun 2018 17:03:36 -0500 Subject: [PATCH 098/107] Remove unnecessary aria-expanded attribute on ul Remove another irrelevant instance of aria-expanded --- js/navigation.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/js/navigation.js b/js/navigation.js index ee18d754..cf5a0b06 100644 --- a/js/navigation.js +++ b/js/navigation.js @@ -25,7 +25,6 @@ return; } - menu.setAttribute( 'aria-expanded', 'false' ); if ( -1 === menu.className.indexOf( 'nav-menu' ) ) { menu.className += ' nav-menu'; } @@ -34,11 +33,9 @@ if ( -1 !== container.className.indexOf( 'toggled' ) ) { container.className = container.className.replace( ' toggled', '' ); button.setAttribute( 'aria-expanded', 'false' ); - menu.setAttribute( 'aria-expanded', 'false' ); } else { container.className += ' toggled'; button.setAttribute( 'aria-expanded', 'true' ); - menu.setAttribute( 'aria-expanded', 'true' ); } }; @@ -49,7 +46,6 @@ if ( ! isClickInside ) { container.className = container.className.replace( ' toggled', '' ); button.setAttribute( 'aria-expanded', 'false' ); - menu.setAttribute( 'aria-expanded', 'false' ); } } ); From 504be8d6691c57192ee15fd2323019486db0d445 Mon Sep 17 00:00:00 2001 From: Ismail El Korchi Date: Sat, 11 Apr 2020 22:23:54 +0100 Subject: [PATCH 099/107] Use build tooling to compile the RTL CSS --- functions.php | 1 + package.json | 65 ++-- rtl.css | 17 - style-rtl.css | 981 ++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 1022 insertions(+), 42 deletions(-) delete mode 100644 rtl.css create mode 100644 style-rtl.css diff --git a/functions.php b/functions.php index 32d2dcc2..b62a4a29 100644 --- a/functions.php +++ b/functions.php @@ -142,6 +142,7 @@ add_action( 'widgets_init', '_s_widgets_init' ); */ function _s_scripts() { wp_enqueue_style( '_s-style', get_stylesheet_uri(), array(), _S_VERSION ); + wp_style_add_data( '_s-style', 'rtl', 'replace' ); wp_enqueue_script( '_s-navigation', get_template_directory_uri() . '/js/navigation.js', array(), _S_VERSION, true ); diff --git a/package.json b/package.json index da584ee8..df4c7a3f 100644 --- a/package.json +++ b/package.json @@ -1,28 +1,43 @@ { - "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" + "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.2.0", + "node-sass": "^4.13.1", + "rtlcss": "^2.5.0" + }, + "rtlcssConfig": { + "options": { + "autoRename": false, + "autoRenameStrict": false, + "blacklist": {}, + "clean": true, + "greedy": false, + "processUrls": false, + "stringMap": [] }, - "bugs": { - "url": "https://github.com/Automattic/_s/issues" - }, - "devDependencies": { - "node-sass": "^4.13.1", - "@wordpress/scripts": "^7.2.0" - }, - "scripts": { - "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'" - } + "plugins": [], + "map": false + }, + "scripts": { + "compile:css": "node-sass sass/style.scss style.css && node-sass sass/woocommerce.scss woocommerce.css && stylelint '*.css' --fix || true && stylelint '*.css' --fix", + "compile:rtl": "rtlcss style.css style-rtl.css", + "lint:scss": "wp-scripts lint-style 'sass/**/*.scss'", + "lint:js": "wp-scripts lint-js 'js/*.js'" + } } diff --git a/rtl.css b/rtl.css deleted file mode 100644 index 8729dfd8..00000000 --- a/rtl.css +++ /dev/null @@ -1,17 +0,0 @@ -/* -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 -of your CSS stylesheet in a separate stylesheet file named rtl.css. - -https://codex.wordpress.org/Right-to-Left_Language_Support - -*/ - -/* -body { - direction: rtl; - unicode-bidi: embed; -} -*/ diff --git a/style-rtl.css b/style-rtl.css new file mode 100644 index 00000000..7aae515e --- /dev/null +++ b/style-rtl.css @@ -0,0 +1,981 @@ +/*! +Theme Name: _s +Theme URI: https://underscores.me/ +Author: Automattic +Author URI: https://automattic.com/ +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. +Version: 1.0.0 +License: GNU General Public License v2 or later +License URI: LICENSE +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. + +_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 +Nicolas Gallagher and Jonathan Neal https://necolas.github.io/normalize.css/ +*/ + +/*-------------------------------------------------------------- +>>> TABLE OF CONTENTS: +---------------------------------------------------------------- +# Normalize +# Typography +# Elements +# Forms +# Navigation + ## Links + ## Menus +# Accessibility +# Alignments +# Clearings +# Widgets +# Content + ## Posts and pages + ## Comments +# Infinite scroll +# Media + ## Captions + ## Galleries +--------------------------------------------------------------*/ + +/*-------------------------------------------------------------- +# Normalize +--------------------------------------------------------------*/ + +/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */ + +/* Document + ========================================================================== */ + +/** + * 1. Correct the line height in all browsers. + * 2. Prevent adjustments of font size after orientation changes in iOS. + */ +html { + line-height: 1.15; + -webkit-text-size-adjust: 100%; +} + +/* Sections + ========================================================================== */ + +/** + * Remove the margin in all browsers. + */ +body { + margin: 0; +} + +/** + * 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; +} + +/* Grouping content + ========================================================================== */ + +/** + * 1. Add the correct box sizing in Firefox. + * 2. Show the overflow in Edge and IE. + */ +hr { + 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; + font-size: 1em; +} + +/* Text-level semantics + ========================================================================== */ + +/** + * Remove the gray background on active links in IE 10. + */ +a { + background-color: transparent; +} + +/** + * 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; + text-decoration: underline; + text-decoration: underline dotted; +} + +/** + * Add the correct font weight in Chrome, Edge, and Safari. + */ +b, +strong { + font-weight: bolder; +} + +/** + * 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; + font-size: 1em; +} + +/** + * Add the correct font size in all browsers. + */ +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` elements from affecting the line height in + * all browsers. + */ +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sub { + bottom: -0.25em; +} + +sup { + top: -0.5em; +} + +/* Embedded content + ========================================================================== */ + +/** + * Remove the border on images inside links in IE 10. + */ +img { + border-style: none; +} + +/* Forms + ========================================================================== */ + +/** + * 1. Change the font styles in all browsers. + * 2. Remove the margin in Firefox and Safari. + */ +button, +input, +optgroup, +select, +textarea { + 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 { + overflow: visible; +} + +/** + * Remove the inheritance of text transform in Edge, Firefox, and IE. + * 1. Remove the inheritance of text transform in Firefox. + */ +button, +select { + text-transform: none; +} + +/** + * Correct the inability to style clickable types in iOS and Safari. + */ +button, +[type="button"], +[type="reset"], +[type="submit"] { + -webkit-appearance: button; +} + +/** + * Remove the inner border and padding in Firefox. + */ +button::-moz-focus-inner, +[type="button"]::-moz-focus-inner, +[type="reset"]::-moz-focus-inner, +[type="submit"]::-moz-focus-inner { + border-style: none; + padding: 0; +} + +/** + * Restore the focus styles unset by the previous rule. + */ +button:-moz-focusring, +[type="button"]:-moz-focusring, +[type="reset"]:-moz-focusring, +[type="submit"]:-moz-focusring { + outline: 1px dotted ButtonText; +} + +/** + * Correct the padding in Firefox. + */ +fieldset { + padding: 0.35em 0.75em 0.625em; +} + +/** + * 1. Correct the text wrapping in Edge and IE. + * 2. Correct the color inheritance from `fieldset` elements in IE. + * 3. Remove the padding so developers are not caught out when they zero out + * `fieldset` elements in all browsers. + */ +legend { + 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; +} + +/** + * Remove the default vertical scrollbar in IE 10+. + */ +textarea { + overflow: auto; +} + +/** + * 1. Add the correct box sizing in IE 10. + * 2. Remove the padding in IE 10. + */ +[type="checkbox"], +[type="radio"] { + 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; +} + +/** + * 1. Correct the odd appearance in Chrome and Safari. + * 2. Correct the outline style in Safari. + */ +[type="search"] { + -webkit-appearance: textfield; + outline-offset: -2px; +} + +/** + * Remove the inner padding in Chrome and Safari on macOS. + */ +[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * 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; + font: inherit; +} + +/* Interactive + ========================================================================== */ + +/* + * Add the correct display in Edge, IE 10+, and Firefox. + */ +details { + display: block; +} + +/* + * Add the correct display in all browsers. + */ +summary { + display: list-item; +} + +/* Misc + ========================================================================== */ + +/** + * Add the correct display in IE 10+. + */ +template { + display: none; +} + +/** + * Add the correct display in IE 10. + */ +[hidden] { + display: none; +} + +/*-------------------------------------------------------------- +# Typography +--------------------------------------------------------------*/ +body, +button, +input, +select, +optgroup, +textarea { + color: #404040; + font-family: sans-serif; + font-size: 16px; + font-size: 1rem; + line-height: 1.5; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + clear: both; +} + +p { + margin-bottom: 1.5em; +} + +dfn, +cite, +em, +i { + font-style: italic; +} + +blockquote { + margin: 0 1.5em; +} + +address { + margin: 0 0 1.5em; +} + +pre { + background: #eee; + font-family: "Courier 10 Pitch", courier, monospace; + font-size: 15px; + font-size: 0.9375rem; + line-height: 1.6; + margin-bottom: 1.6em; + max-width: 100%; + overflow: auto; + padding: 1.6em; +} + +code, +kbd, +tt, +var { + font-family: monaco, consolas, "Andale Mono", "DejaVu Sans Mono", monospace; + font-size: 15px; + font-size: 0.9375rem; +} + +abbr, +acronym { + border-bottom: 1px dotted #666; + cursor: help; +} + +mark, +ins { + background: #fff9c0; + text-decoration: none; +} + +big { + font-size: 125%; +} + +/*-------------------------------------------------------------- +# 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; +} + +body { + background: #fff; +} + +hr { + background-color: #ccc; + border: 0; + height: 1px; + margin-bottom: 1.5em; +} + +ul, +ol { + margin: 0 3em 1.5em 0; +} + +ul { + list-style: disc; +} + +ol { + list-style: decimal; +} + +li > ul, +li > ol { + margin-bottom: 0; + margin-right: 1.5em; +} + +dt { + font-weight: 700; +} + +dd { + margin: 0 1.5em 1.5em; +} + +img { + height: auto; + max-width: 100%; +} + +figure { + margin: 1em 0; +} + +table { + margin: 0 0 1.5em; + width: 100%; +} + +/*-------------------------------------------------------------- +# Forms +--------------------------------------------------------------*/ +button, +input[type="button"], +input[type="reset"], +input[type="submit"] { + border: 1px solid; + border-color: #ccc #ccc #bbb; + border-radius: 3px; + background: #e6e6e6; + color: rgba(0, 0, 0, 0.8); + font-size: 12px; + font-size: 0.75rem; + line-height: 1; + padding: 0.6em 1em 0.4em; +} + +button:hover, +input[type="button"]:hover, +input[type="reset"]:hover, +input[type="submit"]:hover { + border-color: #ccc #bbb #aaa; +} + +button:active, +button:focus, +input[type="button"]:active, +input[type="button"]:focus, +input[type="reset"]:active, +input[type="reset"]:focus, +input[type="submit"]:active, +input[type="submit"]:focus { + border-color: #aaa #bbb #bbb; +} + +input[type="text"], +input[type="email"], +input[type="url"], +input[type="password"], +input[type="search"], +input[type="number"], +input[type="tel"], +input[type="range"], +input[type="date"], +input[type="month"], +input[type="week"], +input[type="time"], +input[type="datetime"], +input[type="datetime-local"], +input[type="color"], +textarea { + color: #666; + border: 1px solid #ccc; + border-radius: 3px; + padding: 3px; +} + +input[type="text"]:focus, +input[type="email"]:focus, +input[type="url"]:focus, +input[type="password"]:focus, +input[type="search"]:focus, +input[type="number"]:focus, +input[type="tel"]:focus, +input[type="range"]:focus, +input[type="date"]:focus, +input[type="month"]:focus, +input[type="week"]:focus, +input[type="time"]:focus, +input[type="datetime"]:focus, +input[type="datetime-local"]:focus, +input[type="color"]:focus, +textarea:focus { + color: #111; +} + +select { + border: 1px solid #ccc; +} + +textarea { + width: 100%; +} + +/*-------------------------------------------------------------- +# Navigation +--------------------------------------------------------------*/ + +/*-------------------------------------------------------------- +## Links +--------------------------------------------------------------*/ +a { + color: #4169e1; +} + +a:visited { + color: #800080; +} + +a:hover, +a:focus, +a:active { + color: #191970; +} + +a:focus { + outline: thin dotted; +} + +a:hover, +a:active { + outline: 0; +} + +/*-------------------------------------------------------------- +## Menus +--------------------------------------------------------------*/ +.main-navigation { + clear: both; + display: block; + float: right; + width: 100%; +} + +.main-navigation ul { + display: none; + list-style: none; + margin: 0; + padding-right: 0; +} + +.main-navigation ul ul { + box-shadow: 0 3px 3px rgba(0, 0, 0, 0.2); + float: right; + position: absolute; + top: 100%; + right: -999em; + z-index: 99999; +} + +.main-navigation ul ul ul { + right: -999em; + top: 0; +} + +.main-navigation ul ul li:hover > ul, +.main-navigation ul ul li.focus > ul { + right: 100%; +} + +.main-navigation ul ul a { + width: 200px; +} + +.main-navigation ul li:hover > ul, +.main-navigation ul li.focus > ul { + right: auto; +} + +.main-navigation li { + float: right; + position: relative; +} + +.main-navigation a { + display: block; + text-decoration: none; +} + +/* Small menu. */ +.menu-toggle, +.main-navigation.toggled ul { + display: block; +} + +@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 +.post-navigation { + margin: 0 0 1.5em; + overflow: hidden; +} + +.comment-navigation .nav-previous, +.posts-navigation .nav-previous, +.post-navigation .nav-previous { + float: right; + width: 50%; +} + +.comment-navigation .nav-next, +.posts-navigation .nav-next, +.post-navigation .nav-next { + float: left; + text-align: left; + width: 50%; +} + +/*-------------------------------------------------------------- +# Accessibility +--------------------------------------------------------------*/ + +/* Text meant only for screen readers. */ +.screen-reader-text { + border: 0; + clip: rect(1px, 1px, 1px, 1px); + clip-path: inset(50%); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute !important; + width: 1px; + word-wrap: normal !important; +} + +.screen-reader-text:focus { + background-color: #f1f1f1; + border-radius: 3px; + box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6); + clip: auto !important; + clip-path: none; + color: #21759b; + display: block; + font-size: 14px; + font-size: 0.875rem; + font-weight: 700; + height: auto; + right: 5px; + line-height: normal; + padding: 15px 23px 14px; + text-decoration: none; + top: 5px; + width: auto; + z-index: 100000; +} + +/* Do not show the outline on the skip link target. */ +#content[tabindex="-1"]:focus { + outline: 0; +} + +/*-------------------------------------------------------------- +# Alignments +--------------------------------------------------------------*/ +.alignleft { + display: inline; + float: right; + margin-left: 1.5em; + margin-bottom: 1.5em; +} + +.alignright { + display: inline; + float: left; + margin-right: 1.5em; + margin-bottom: 1.5em; +} + +.aligncenter { + clear: both; + display: block; + margin-right: auto; + margin-left: auto; + margin-bottom: 1.5em; +} + +/*-------------------------------------------------------------- +# 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 { + content: ""; + display: table; + table-layout: fixed; +} + +.clear::after, +.entry-content::after, +.comment-content::after, +.site-header::after, +.site-content::after, +.site-footer::after { + clear: both; +} + +/*-------------------------------------------------------------- +# Widgets +--------------------------------------------------------------*/ +.widget { + margin: 0 0 1.5em; +} + +.widget select { + max-width: 100%; +} + +/*-------------------------------------------------------------- +# Content +--------------------------------------------------------------*/ + +/*-------------------------------------------------------------- +## Posts and pages +--------------------------------------------------------------*/ +.sticky { + display: block; +} + +.post, +.page { + margin: 0 0 1.5em; +} + +.updated:not(.published) { + display: none; +} + +.page-content, +.entry-content, +.entry-summary { + margin: 1.5em 0 0; +} + +.page-links { + clear: both; + margin: 0 0 1.5em; +} + +/*-------------------------------------------------------------- +## Comments +--------------------------------------------------------------*/ +.comment-content a { + word-wrap: break-word; +} + +.bypostauthor { + display: block; +} + +/*-------------------------------------------------------------- +# Infinite scroll +--------------------------------------------------------------*/ + +/* Hide the Posts Navigation and the Footer when Infinite Scroll is in use. */ +.infinite-scroll .posts-navigation, +.infinite-scroll.neverending .site-footer { + display: none; +} + +/* Re-display the Theme Footer when Infinite Scroll has reached its end. */ +.infinity-end.neverending .site-footer { + display: block; +} + +/*-------------------------------------------------------------- +# Media +--------------------------------------------------------------*/ +.page-content .wp-smiley, +.entry-content .wp-smiley, +.comment-content .wp-smiley { + border: none; + margin-bottom: 0; + margin-top: 0; + padding: 0; +} + +/* Make sure embeds and iframes fit their containers. */ +embed, +iframe, +object { + max-width: 100%; +} + +/* Make sure logo link wraps around logo image. */ +.custom-logo-link { + display: inline-block; +} + +/*-------------------------------------------------------------- +## Captions +--------------------------------------------------------------*/ +.wp-caption { + margin-bottom: 1.5em; + max-width: 100%; +} + +.wp-caption img[class*="wp-image-"] { + display: block; + margin-right: auto; + margin-left: auto; +} + +.wp-caption .wp-caption-text { + margin: 0.8075em 0; +} + +.wp-caption-text { + text-align: center; +} + +/*-------------------------------------------------------------- +## Galleries +--------------------------------------------------------------*/ +.gallery { + margin-bottom: 1.5em; +} + +.gallery-item { + display: inline-block; + text-align: center; + vertical-align: top; + width: 100%; +} + +.gallery-columns-2 .gallery-item { + max-width: 50%; +} + +.gallery-columns-3 .gallery-item { + max-width: 33.33%; +} + +.gallery-columns-4 .gallery-item { + max-width: 25%; +} + +.gallery-columns-5 .gallery-item { + max-width: 20%; +} + +.gallery-columns-6 .gallery-item { + max-width: 16.66%; +} + +.gallery-columns-7 .gallery-item { + max-width: 14.28%; +} + +.gallery-columns-8 .gallery-item { + max-width: 12.5%; +} + +.gallery-columns-9 .gallery-item { + max-width: 11.11%; +} + +.gallery-caption { + display: block; +} From 0430a060daf346c0a4610b0651757aac9ff2e8d1 Mon Sep 17 00:00:00 2001 From: Ismail El Korchi Date: Sun, 12 Apr 2020 21:21:35 +0100 Subject: [PATCH 100/107] Update readme.txt --- readme.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/readme.txt b/readme.txt index 66fc7663..5248be21 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,8 @@ Contributors: automattic Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready Requires at least: 4.5 -Tested up to: 4.8 +Tested up to: 5.4 +Requires PHP: 5.6 Stable tag: 1.0.0 License: GNU General Public License v2 or later License URI: LICENSE @@ -25,7 +26,7 @@ Hi. I'm a starter theme called _s, or underscores, if you like. I'm a theme mean = Does this theme support any plugins? = -_s includes support for Infinite Scroll in Jetpack. +_s includes support for WooCommerce and for Infinite Scroll in Jetpack. == Changelog == From d6f8026895f4ba478a6ccb2bf4d3f746b9ba335b Mon Sep 17 00:00:00 2001 From: Jb Date: Mon, 13 Apr 2020 00:14:06 +0200 Subject: [PATCH 101/107] Declare HTML5 scripts and styles support for better compliance with W3C validator --- functions.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/functions.php b/functions.php index 32d2dcc2..8dd786c6 100644 --- a/functions.php +++ b/functions.php @@ -66,6 +66,8 @@ if ( ! function_exists( '_s_setup' ) ) : 'comment-list', 'gallery', 'caption', + 'style', + 'script', ) ); From 5b1bf56a50dc7e3d9488329989d9cdb22f7839c6 Mon Sep 17 00:00:00 2001 From: Ismail El Korchi Date: Tue, 14 Apr 2020 18:14:58 +0100 Subject: [PATCH 102/107] Remove an unnecessary ARIA role --- inc/woocommerce.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/woocommerce.php b/inc/woocommerce.php index a66e74bd..8a3a8b9d 100644 --- a/inc/woocommerce.php +++ b/inc/woocommerce.php @@ -119,7 +119,7 @@ if ( ! function_exists( '_s_woocommerce_wrapper_before' ) ) { function _s_woocommerce_wrapper_before() { ?>
    -
    +
    Date: Tue, 14 Apr 2020 23:36:44 +0100 Subject: [PATCH 103/107] Fix the WooCommerce gallery zoom and gallery lightbox --- sass/shop/_single-product.scss | 3 ++- woocommerce.css | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sass/shop/_single-product.scss b/sass/shop/_single-product.scss index d3ecff59..e8bb8676 100644 --- a/sass/shop/_single-product.scss +++ b/sass/shop/_single-product.scss @@ -7,10 +7,11 @@ .woocommerce-product-gallery { position: relative; + float: left; .woocommerce-product-gallery__trigger { position: absolute; - top: 1em; + top: 2em; right: 1em; display: block; z-index: 99; diff --git a/woocommerce.css b/woocommerce.css index a8844005..0d5c41b6 100644 --- a/woocommerce.css +++ b/woocommerce.css @@ -151,11 +151,12 @@ ul.products li.product .button { .single-product div.product .woocommerce-product-gallery { position: relative; + float: left; } .single-product div.product .woocommerce-product-gallery .woocommerce-product-gallery__trigger { position: absolute; - top: 1em; + top: 2em; right: 1em; display: block; z-index: 99; From 21d52ac87a1432856e1480373f6ceeb1e42309c0 Mon Sep 17 00:00:00 2001 From: Ismail El Korchi Date: Tue, 14 Apr 2020 22:18:23 +0100 Subject: [PATCH 104/107] Bump the Linux distribution on Travis from Trusty to Xenial And add missing OS and change matrix to jobs --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4545c1dd..d1a543fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,9 @@ # For use with the Underscores WordPress theme. # @link https://github.com/Automattic/_s -# Tell Travis CI which distro to use. -dist: trusty +# Tell Travis CI which OS and which distro to use. +os: linux +dist: xenial # Cache directories between builds. # @link https://docs.travis-ci.com/user/caching/#arbitrary-directories @@ -30,7 +31,7 @@ php: - 7.2 - 7.3 -matrix: +jobs: fast_finish: true include: - php: 7.4 From 3749eb6bae371168a39cc007f82f599c75dfdbd7 Mon Sep 17 00:00:00 2001 From: Neil Abraham Date: Thu, 16 Apr 2020 09:20:40 +0100 Subject: [PATCH 105/107] Readme: now six-step find and replace --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 624e244c..9239747f 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Getting Started If you want to keep it simple, head over to https://underscores.me and generate your `_s` based theme from there. You just input the name of the theme you want to create, click the "Generate" button, and you get your ready-to-awesomize starter theme. -If you want to set things up manually, download `_s` from GitHub. The first thing you want to do is copy the `_s` directory and change the name to something else (like, say, `megatherium-is-awesome`), and then you'll need to do a five-step find and replace on the name in all the templates. +If you want to set things up manually, download `_s` from GitHub. The first thing you want to do is copy the `_s` directory and change the name to something else (like, say, `megatherium-is-awesome`), and then you'll need to do a six-step find and replace on the name in all the templates. 1. Search for `'_s'` (inside single quotations) to capture the text domain. 2. Search for `_s_` to capture all the function names. From 253b7a08d8fd28cecbf73ae59035d7fee312423d Mon Sep 17 00:00:00 2001 From: Ismail El Korchi Date: Thu, 16 Apr 2020 22:32:44 +0100 Subject: [PATCH 106/107] Update @wordpress/scripts package --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index df4c7a3f..98be82e5 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "url": "https://github.com/Automattic/_s/issues" }, "devDependencies": { - "@wordpress/scripts": "^7.2.0", + "@wordpress/scripts": "^8.0.1", "node-sass": "^4.13.1", "rtlcss": "^2.5.0" }, From d8eac45712d96fa5afd9d6a28a052c4df5a165b9 Mon Sep 17 00:00:00 2001 From: Ismail El Korchi Date: Thu, 16 Apr 2020 22:51:18 +0100 Subject: [PATCH 107/107] Travis CI : dont install dependencies unless they are used --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index d1a543fb..2a7a556d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,11 +41,11 @@ 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 + - if [[ "$SNIFF" == 1 ]]; then nvm install --lts; fi # Install Composer dependencies. - composer install # Install NPM dependencies. - - npm install + - if [[ "$SNIFF" == 1 ]]; then npm install; fi script: # Validate the composer.json file.