Fix PHP, CSS AND JS coding standards

This commit is contained in:
Ismail El Korchi 2020-04-05 21:49:27 +01:00
parent 2351bef6ca
commit f94fc1e59b
42 changed files with 357 additions and 213 deletions

View File

@ -31,13 +31,15 @@ get_header();
<h2 class="widget-title"><?php esc_html_e( 'Most Used Categories', '_s' ); ?></h2> <h2 class="widget-title"><?php esc_html_e( 'Most Used Categories', '_s' ); ?></h2>
<ul> <ul>
<?php <?php
wp_list_categories( array( wp_list_categories(
array(
'orderby' => 'count', 'orderby' => 'count',
'order' => 'DESC', 'order' => 'DESC',
'show_count' => 1, 'show_count' => 1,
'title_li' => '', 'title_li' => '',
'number' => 10, 'number' => 10,
) ); )
);
?> ?>
</ul> </ul>
</div><!-- .widget --> </div><!-- .widget -->

View File

@ -36,10 +36,10 @@ if ( post_password_required() ) {
'<span>' . wp_kses_post( get_the_title() ) . '</span>' '<span>' . wp_kses_post( get_the_title() ) . '</span>'
); );
} else { } else {
printf( // WPCS: XSS OK. printf(
/* translators: 1: comment count number, 2: title. */ /* translators: 1: comment count number, 2: title. */
esc_html( _nx( '%1$s thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', $_s_comment_count, 'comments title', '_s' ) ), esc_html( _nx( '%1$s thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', $_s_comment_count, 'comments title', '_s' ) ),
number_format_i18n( $_s_comment_count ), number_format_i18n( $_s_comment_count ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
'<span>' . wp_kses_post( get_the_title() ) . '</span>' '<span>' . wp_kses_post( get_the_title() ) . '</span>'
); );
} }
@ -50,10 +50,12 @@ if ( post_password_required() ) {
<ol class="comment-list"> <ol class="comment-list">
<?php <?php
wp_list_comments( array( wp_list_comments(
array(
'style' => 'ol', 'style' => 'ol',
'short_ping' => true, 'short_ping' => true,
) ); )
);
?> ?>
</ol><!-- .comment-list --> </ol><!-- .comment-list -->

View File

@ -7,6 +7,11 @@
* @package _s * @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' ) ) : if ( ! function_exists( '_s_setup' ) ) :
/** /**
* Sets up theme defaults and registers support for various WordPress features. * 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' ); add_theme_support( 'post-thumbnails' );
// This theme uses wp_nav_menu() in one location. // This theme uses wp_nav_menu() in one location.
register_nav_menus( array( register_nav_menus(
array(
'menu-1' => esc_html__( 'Primary', '_s' ), 'menu-1' => esc_html__( 'Primary', '_s' ),
) ); )
);
/* /*
* Switch default core markup for search form, comment form, and comments * Switch default core markup for search form, comment form, and comments
* to output valid HTML5. * to output valid HTML5.
*/ */
add_theme_support( 'html5', array( add_theme_support(
'html5',
array(
'search-form', 'search-form',
'comment-form', 'comment-form',
'comment-list', 'comment-list',
'gallery', 'gallery',
'caption', 'caption',
) ); )
);
// Set up the WordPress core custom background feature. // Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( '_s_custom_background_args', array( add_theme_support(
'custom-background',
apply_filters(
'_s_custom_background_args',
array(
'default-color' => 'ffffff', 'default-color' => 'ffffff',
'default-image' => '', 'default-image' => '',
) ) ); )
)
);
// Add theme support for selective refresh for widgets. // Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' ); add_theme_support( 'customize-selective-refresh-widgets' );
@ -73,12 +89,15 @@ if ( ! function_exists( '_s_setup' ) ) :
* *
* @link https://codex.wordpress.org/Theme_Logo * @link https://codex.wordpress.org/Theme_Logo
*/ */
add_theme_support( 'custom-logo', array( add_theme_support(
'custom-logo',
array(
'height' => 250, 'height' => 250,
'width' => 250, 'width' => 250,
'flex-width' => true, 'flex-width' => true,
'flex-height' => true, 'flex-height' => true,
) ); )
);
} }
endif; endif;
add_action( 'after_setup_theme', '_s_setup' ); add_action( 'after_setup_theme', '_s_setup' );
@ -104,7 +123,8 @@ add_action( 'after_setup_theme', '_s_content_width', 0 );
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/ */
function _s_widgets_init() { function _s_widgets_init() {
register_sidebar( array( register_sidebar(
array(
'name' => esc_html__( 'Sidebar', '_s' ), 'name' => esc_html__( 'Sidebar', '_s' ),
'id' => 'sidebar-1', 'id' => 'sidebar-1',
'description' => esc_html__( 'Add widgets here.', '_s' ), 'description' => esc_html__( 'Add widgets here.', '_s' ),
@ -112,7 +132,8 @@ function _s_widgets_init() {
'after_widget' => '</section>', 'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">', 'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>', 'after_title' => '</h2>',
) ); )
);
} }
add_action( 'widgets_init', '_s_widgets_init' ); add_action( 'widgets_init', '_s_widgets_init' );
@ -120,11 +141,11 @@ add_action( 'widgets_init', '_s_widgets_init' );
* Enqueue scripts and styles. * Enqueue scripts and styles.
*/ */
function _s_scripts() { 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' ) ) { if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' ); wp_enqueue_script( 'comment-reply' );

View File

@ -41,17 +41,19 @@
$_s_description = get_bloginfo( 'description', 'display' ); $_s_description = get_bloginfo( 'description', 'display' );
if ( $_s_description || is_customize_preview() ) : if ( $_s_description || is_customize_preview() ) :
?> ?>
<p class="site-description"><?php echo $_s_description; /* WPCS: xss ok. */ ?></p> <p class="site-description"><?php echo $_s_description; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>
<?php endif; ?> <?php endif; ?>
</div><!-- .site-branding --> </div><!-- .site-branding -->
<nav id="site-navigation" class="main-navigation"> <nav id="site-navigation" class="main-navigation">
<button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false"><?php esc_html_e( 'Primary Menu', '_s' ); ?></button> <button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false"><?php esc_html_e( 'Primary Menu', '_s' ); ?></button>
<?php <?php
wp_nav_menu( array( wp_nav_menu(
array(
'theme_location' => 'menu-1', 'theme_location' => 'menu-1',
'menu_id' => 'primary-menu', 'menu_id' => 'primary-menu',
) ); )
);
?> ?>
</nav><!-- #site-navigation --> </nav><!-- #site-navigation -->
</header><!-- #masthead --> </header><!-- #masthead -->

View File

@ -17,14 +17,20 @@
* @uses _s_header_style() * @uses _s_header_style()
*/ */
function _s_custom_header_setup() { function _s_custom_header_setup() {
add_theme_support( 'custom-header', apply_filters( '_s_custom_header_args', array( add_theme_support(
'custom-header',
apply_filters(
'_s_custom_header_args',
array(
'default-image' => '', 'default-image' => '',
'default-text-color' => '000000', 'default-text-color' => '000000',
'width' => 1000, 'width' => 1000,
'height' => 250, 'height' => 250,
'flex-height' => true, 'flex-height' => true,
'wp-head-callback' => '_s_header_style', 'wp-head-callback' => '_s_header_style',
) ) ); )
)
);
} }
add_action( 'after_setup_theme', '_s_custom_header_setup' ); add_action( 'after_setup_theme', '_s_custom_header_setup' );

View File

@ -16,14 +16,20 @@ function _s_customize_register( $wp_customize ) {
$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
if ( isset( $wp_customize->selective_refresh ) ) { if ( isset( $wp_customize->selective_refresh ) ) {
$wp_customize->selective_refresh->add_partial( 'blogname', array( $wp_customize->selective_refresh->add_partial(
'blogname',
array(
'selector' => '.site-title a', 'selector' => '.site-title a',
'render_callback' => '_s_customize_partial_blogname', 'render_callback' => '_s_customize_partial_blogname',
) ); )
$wp_customize->selective_refresh->add_partial( 'blogdescription', array( );
$wp_customize->selective_refresh->add_partial(
'blogdescription',
array(
'selector' => '.site-description', 'selector' => '.site-description',
'render_callback' => '_s_customize_partial_blogdescription', 'render_callback' => '_s_customize_partial_blogdescription',
) ); )
);
} }
} }
add_action( 'customize_register', '_s_customize_register' ); add_action( 'customize_register', '_s_customize_register' );

View File

@ -16,17 +16,22 @@
*/ */
function _s_jetpack_setup() { function _s_jetpack_setup() {
// Add theme support for Infinite Scroll. // Add theme support for Infinite Scroll.
add_theme_support( 'infinite-scroll', array( add_theme_support(
'infinite-scroll',
array(
'container' => 'main', 'container' => 'main',
'render' => '_s_infinite_scroll_render', 'render' => '_s_infinite_scroll_render',
'footer' => 'page', 'footer' => 'page',
) ); )
);
// Add theme support for Responsive Videos. // Add theme support for Responsive Videos.
add_theme_support( 'jetpack-responsive-videos' ); add_theme_support( 'jetpack-responsive-videos' );
// Add theme support for Content Options. // Add theme support for Content Options.
add_theme_support( 'jetpack-content-options', array( add_theme_support(
'jetpack-content-options',
array(
'post-details' => array( 'post-details' => array(
'stylesheet' => '_s-style', 'stylesheet' => '_s-style',
'date' => '.posted-on', 'date' => '.posted-on',
@ -40,7 +45,8 @@ function _s_jetpack_setup() {
'post' => true, 'post' => true,
'page' => true, 'page' => true,
), ),
) ); )
);
} }
add_action( 'after_setup_theme', '_s_jetpack_setup' ); add_action( 'after_setup_theme', '_s_jetpack_setup' );

View File

@ -17,7 +17,8 @@ if ( ! function_exists( '_s_posted_on' ) ) :
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
} }
$time_string = sprintf( $time_string, $time_string = sprintf(
$time_string,
esc_attr( get_the_date( DATE_W3C ) ), esc_attr( get_the_date( DATE_W3C ) ),
esc_html( get_the_date() ), esc_html( get_the_date() ),
esc_attr( get_the_modified_date( DATE_W3C ) ), esc_attr( get_the_modified_date( DATE_W3C ) ),
@ -30,7 +31,7 @@ if ( ! function_exists( '_s_posted_on' ) ) :
'<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>' '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
); );
echo '<span class="posted-on">' . $posted_on . '</span>'; // WPCS: XSS OK. echo '<span class="posted-on">' . $posted_on . '</span>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
} }
endif; endif;
@ -46,7 +47,7 @@ if ( ! function_exists( '_s_posted_by' ) ) :
'<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span>' '<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span>'
); );
echo '<span class="byline"> ' . $byline . '</span>'; // WPCS: XSS OK. echo '<span class="byline"> ' . $byline . '</span>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
} }
endif; endif;
@ -62,14 +63,14 @@ if ( ! function_exists( '_s_entry_footer' ) ) :
$categories_list = get_the_category_list( esc_html__( ', ', '_s' ) ); $categories_list = get_the_category_list( esc_html__( ', ', '_s' ) );
if ( $categories_list ) { if ( $categories_list ) {
/* translators: 1: list of categories. */ /* translators: 1: list of categories. */
printf( '<span class="cat-links">' . esc_html__( 'Posted in %1$s', '_s' ) . '</span>', $categories_list ); // WPCS: XSS OK. printf( '<span class="cat-links">' . esc_html__( 'Posted in %1$s', '_s' ) . '</span>', $categories_list ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
} }
/* translators: used between list items, there is a space after the comma */ /* 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' ) ); $tags_list = get_the_tag_list( '', esc_html_x( ', ', 'list item separator', '_s' ) );
if ( $tags_list ) { if ( $tags_list ) {
/* translators: 1: list of tags. */ /* translators: 1: list of tags. */
printf( '<span class="tags-links">' . esc_html__( 'Tagged %1$s', '_s' ) . '</span>', $tags_list ); // WPCS: XSS OK. printf( '<span class="tags-links">' . esc_html__( 'Tagged %1$s', '_s' ) . '</span>', $tags_list ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
} }
} }
@ -134,11 +135,16 @@ if ( ! function_exists( '_s_post_thumbnail' ) ) :
<a class="post-thumbnail" href="<?php the_permalink(); ?>" aria-hidden="true" tabindex="-1"> <a class="post-thumbnail" href="<?php the_permalink(); ?>" aria-hidden="true" tabindex="-1">
<?php <?php
the_post_thumbnail( 'post-thumbnail', array( the_post_thumbnail(
'alt' => the_title_attribute( array( 'post-thumbnail',
array(
'alt' => the_title_attribute(
array(
'echo' => false, 'echo' => false,
) ), )
) ); ),
)
);
?> ?>
</a> </a>

View File

@ -29,7 +29,7 @@ add_action( 'after_setup_theme', '_s_woocommerce_setup' );
* @return void * @return void
*/ */
function _s_woocommerce_scripts() { function _s_woocommerce_scripts() {
wp_enqueue_style( '_s-woocommerce-style', get_template_directory_uri() . '/woocommerce.css' ); wp_enqueue_style( '_s-woocommerce-style', get_template_directory_uri() . '/woocommerce.css', array(), _S_VERSION );
$font_path = WC()->plugin_url() . '/assets/fonts/'; $font_path = WC()->plugin_url() . '/assets/fonts/';
$inline_font = '@font-face { $inline_font = '@font-face {

View File

@ -1,3 +1,4 @@
/* global wp, jQuery */
/** /**
* File customizer.js. * File customizer.js.
* *
@ -7,7 +8,6 @@
*/ */
( function( $ ) { ( function( $ ) {
// Site title and description. // Site title and description.
wp.customize( 'blogname', function( value ) { wp.customize( 'blogname', function( value ) {
value.bind( function( to ) { value.bind( function( to ) {
@ -25,18 +25,18 @@
value.bind( function( to ) { value.bind( function( to ) {
if ( 'blank' === to ) { if ( 'blank' === to ) {
$( '.site-title, .site-description' ).css( { $( '.site-title, .site-description' ).css( {
'clip': 'rect(1px, 1px, 1px, 1px)', clip: 'rect(1px, 1px, 1px, 1px)',
'position': 'absolute' position: 'absolute',
} ); } );
} else { } else {
$( '.site-title, .site-description' ).css( { $( '.site-title, .site-description' ).css( {
'clip': 'auto', clip: 'auto',
'position': 'relative' position: 'relative',
} ); } );
$( '.site-title a, .site-description' ).css( { $( '.site-title a, .site-description' ).css( {
'color': to color: to,
} ); } );
} }
} ); } );
} ); } );
} )( jQuery ); }( jQuery ) );

View File

@ -59,7 +59,6 @@
// Move up through the ancestors of the current link until we hit .nav-menu. // Move up through the ancestors of the current link until we hit .nav-menu.
while ( -1 === self.className.indexOf( 'nav-menu' ) ) { while ( -1 === self.className.indexOf( 'nav-menu' ) ) {
// On li elements toggle the class .focus. // On li elements toggle the class .focus.
if ( 'li' === self.tagName.toLowerCase() ) { if ( 'li' === self.tagName.toLowerCase() ) {
if ( -1 !== self.className.indexOf( 'focus' ) ) { if ( -1 !== self.className.indexOf( 'focus' ) ) {
@ -76,13 +75,13 @@
/** /**
* Toggles `focus` class to allow submenu access on tablets. * Toggles `focus` class to allow submenu access on tablets.
*/ */
( function( container ) { ( function() {
var touchStartFn, i, var touchStartFn,
parentLink = container.querySelectorAll( '.menu-item-has-children > a, .page_item_has_children > a' ); parentLink = container.querySelectorAll( '.menu-item-has-children > a, .page_item_has_children > a' );
if ( 'ontouchstart' in window ) { if ( 'ontouchstart' in window ) {
touchStartFn = function( e ) { touchStartFn = function( e ) {
var menuItem = this.parentNode, i; var menuItem = this.parentNode;
if ( ! menuItem.classList.contains( 'focus' ) ) { if ( ! menuItem.classList.contains( 'focus' ) ) {
e.preventDefault(); e.preventDefault();
@ -103,4 +102,4 @@
} }
} }
}( container ) ); }( container ) );
} )(); }() );

View File

@ -28,4 +28,4 @@
} }
}, false ); }, false );
} }
} )(); }() );

View File

@ -1,11 +1,13 @@
html { /* Inherit box-sizing to more easily change it's value on a component level.
box-sizing: border-box; @link http://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ */
*,
*::before,
*::after {
box-sizing: inherit;
} }
*, html {
*:before, box-sizing: border-box;
*: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 { body {

View File

@ -1,4 +1,5 @@
ul, ol { ul,
ol {
margin: 0 0 1.5em 3em; margin: 0 0 1.5em 3em;
} }
@ -17,7 +18,7 @@ li > ol {
} }
dt { dt {
font-weight: bold; font-weight: 700;
} }
dd { dd {

View File

@ -6,10 +6,12 @@ input[type="submit"] {
border-color: $color__border-button; border-color: $color__border-button;
border-radius: 3px; border-radius: 3px;
background: $color__background-button; background: $color__background-button;
color: rgba(0, 0, 0, .8); color: rgba(0, 0, 0, 0.8);
@include font-size(0.75); @include font-size(0.75);
line-height: 1; line-height: 1;
padding: .6em 1em .4em; padding: 0.6em 1em 0.4em;
&:hover { &:hover {
border-color: $color__border-button-hover; border-color: $color__border-button-hover;

View File

@ -1,3 +1,2 @@
@import "buttons"; @import "buttons";
@import "fields"; @import "fields";

View File

@ -1,4 +1,5 @@
.no-sidebar { .no-sidebar {
.content-area { .content-area {
float: none; float: none;
margin-left: auto; margin-left: auto;

View File

@ -3,6 +3,7 @@
max-width: 100%; max-width: 100%;
img[class*="wp-image-"] { img[class*="wp-image-"] {
@include center-block; @include center-block;
} }

View File

@ -10,8 +10,9 @@
// Loops to enumerate the classes for gallery columns. // Loops to enumerate the classes for gallery columns.
@for $i from 2 through 9 { @for $i from 2 through 9 {
.gallery-columns-#{$i} & { .gallery-columns-#{$i} & {
max-width: map-get( $columns, $i ); max-width: map-get($columns, $i);
} }
} }
} }

View File

@ -25,5 +25,5 @@
// Column width with margin // Column width with margin
@mixin column-width($numberColumns: 3) { @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 );
} }

View File

@ -19,8 +19,10 @@
clip-path: none; clip-path: none;
color: $color__text-screen; color: $color__text-screen;
display: block; display: block;
@include font-size(0.875); @include font-size(0.875);
font-weight: bold;
font-weight: 700;
height: auto; height: auto;
left: 5px; left: 5px;
line-height: normal; line-height: normal;

View File

@ -14,6 +14,8 @@
.aligncenter { .aligncenter {
clear: both; clear: both;
@include center-block; @include center-block;
margin-bottom: 1.5em; margin-bottom: 1.5em;
} }

View File

@ -1,23 +1,25 @@
.clear:before, .clear::before,
.clear:after, .clear::after,
.entry-content:before, .entry-content::before,
.entry-content:after, .entry-content::after,
.comment-content:before, .comment-content::before,
.comment-content:after, .comment-content::after,
.site-header:before, .site-header::before,
.site-header:after, .site-header::after,
.site-content:before, .site-content::before,
.site-content:after, .site-content::after,
.site-footer:before, .site-footer::before,
.site-footer:after { .site-footer::after {
@include clearfix; @include clearfix;
} }
.clear:after, .clear::after,
.entry-content:after, .entry-content::after,
.comment-content:after, .comment-content::after,
.site-header:after, .site-header::after,
.site-content:after, .site-content::after,
.site-footer:after { .site-footer::after {
@include clearfix-after; @include clearfix-after;
} }

View File

@ -1,10 +1,11 @@
/* Globally hidden elements when Infinite Scroll is supported and in use. */ /* Hide the Older / Newer Posts Navigation when Infinite Scroll is in use. */
.infinite-scroll .posts-navigation, /* Older / Newer Posts Navigation (always hidden) */ .infinite-scroll .posts-navigation,
.infinite-scroll.neverending .site-footer { /* Theme Footer (when set to scrolling) */ /* Hide the Theme Footer (when set to scrolling) */
.infinite-scroll.neverending .site-footer {
display: none; 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 { .infinity-end.neverending .site-footer {
display: block; display: block;
} }

View File

@ -4,14 +4,17 @@ a {
&:visited { &:visited {
color: $color__link-visited; color: $color__link-visited;
} }
&:hover, &:hover,
&:focus, &:focus,
&:active { &:active {
color: $color__link-hover; color: $color__link-hover;
} }
&:focus { &:focus {
outline: thin dotted; outline: thin dotted;
} }
&:hover, &:hover,
&:active { &:active {
outline: 0; outline: 0;

View File

@ -24,6 +24,7 @@
} }
li { li {
&:hover > ul, &:hover > ul,
&.focus > ul { &.focus > ul {
left: 100%; left: 100%;
@ -77,9 +78,11 @@
} }
@media screen and (min-width: 37.5em) { @media screen and (min-width: 37.5em) {
.menu-toggle { .menu-toggle {
display: none; display: none;
} }
.main-navigation ul { .main-navigation ul {
display: block; display: block;
} }

View File

@ -2,7 +2,9 @@
* Checkout * Checkout
*/ */
@media screen and (min-width: 768px) { @media screen and (min-width: 768px) {
.col2-set { .col2-set {
.form-row-first { .form-row-first {
float: left; float: left;
margin-right: $columns__margin; margin-right: $columns__margin;
@ -15,6 +17,7 @@
.form-row-first, .form-row-first,
.form-row-last { .form-row-last {
@include column-width(2); @include column-width(2);
} }
} }

View File

@ -5,6 +5,7 @@
position: relative; position: relative;
margin: 0; margin: 0;
padding: 0; padding: 0;
@include clearfix; @include clearfix;
.cart-contents { .cart-contents {
@ -31,12 +32,12 @@
line-height: 1.618; line-height: 1.618;
font-size: 1em; font-size: 1em;
width: 5.3em; width: 5.3em;
font-family: 'star'; font-family: star;
font-weight: 400; font-weight: 400;
&:before { &::before {
content: "\53\53\53\53\53"; content: "\53\53\53\53\53";
opacity: .25; opacity: 0.25;
float: left; float: left;
top: 0; top: 0;
left: 0; left: 0;
@ -52,7 +53,7 @@
padding-top: 1.5em; padding-top: 1.5em;
} }
span:before { span::before {
content: "\53\53\53\53\53"; content: "\53\53\53\53\53";
top: 0; top: 0;
position: absolute; position: absolute;
@ -62,6 +63,7 @@
} }
p.stars { p.stars {
a { a {
position: relative; position: relative;
height: 1em; height: 1em;
@ -72,7 +74,8 @@ p.stars {
margin-right: 1px; margin-right: 1px;
font-weight: 400; font-weight: 400;
&:before { &::before {
display: block; display: block;
position: absolute; position: absolute;
top: 0; top: 0;
@ -80,25 +83,28 @@ p.stars {
width: 1em; width: 1em;
height: 1em; height: 1em;
line-height: 1; line-height: 1;
font-family: "star"; font-family: star;
content: "\53"; content: "\53";
color: $color__text-main; color: $color__text-main;
text-indent: 0; text-indent: 0;
opacity: .25; opacity: 0.25;
} }
&:hover { &:hover {
~ a:before {
~ a::before {
content: "\53"; content: "\53";
color: $color__text-main; color: $color__text-main;
opacity: .25; opacity: 0.25;
} }
} }
} }
&:hover { &:hover {
a { a {
&:before {
&::before {
content: "\53"; content: "\53";
color: $color__link; color: $color__link;
opacity: 1; opacity: 1;
@ -107,22 +113,25 @@ p.stars {
} }
&.selected { &.selected {
a.active { a.active {
&:before {
&::before {
content: "\53"; content: "\53";
color: $color__link; color: $color__link;
opacity: 1; opacity: 1;
} }
~ a:before { ~ a::before {
content: "\53"; content: "\53";
color: $color__text-main; color: $color__text-main;
opacity: .25; opacity: 0.25;
} }
} }
a:not(.active) { a:not(.active) {
&:before {
&::before {
content: "\53"; content: "\53";
color: $color__link; color: $color__link;
opacity: 1; opacity: 1;
@ -135,6 +144,7 @@ p.stars {
* Tabs * Tabs
*/ */
.woocommerce-tabs { .woocommerce-tabs {
ul.tabs { ul.tabs {
list-style: none; list-style: none;
margin: 0; margin: 0;
@ -154,6 +164,7 @@ p.stars {
} }
.panel { .panel {
h2:first-of-type { h2:first-of-type {
margin-bottom: 1em; margin-bottom: 1em;
} }
@ -187,13 +198,16 @@ p.stars {
* Forms * Forms
*/ */
.form-row { .form-row {
&.woocommerce-validated { &.woocommerce-validated {
input.input-text { input.input-text {
box-shadow: inset 2px 0 0 $woocommerce__color-success; box-shadow: inset 2px 0 0 $woocommerce__color-success;
} }
} }
&.woocommerce-invalid { &.woocommerce-invalid {
input.input-text { input.input-text {
box-shadow: inset 2px 0 0 $woocommerce__color-error; box-shadow: inset 2px 0 0 $woocommerce__color-error;
} }
@ -201,7 +215,7 @@ p.stars {
} }
.required { .required {
color: red; color: #f00;
} }
/** /**
@ -212,6 +226,7 @@ p.stars {
.woocommerce-error, .woocommerce-error,
.woocommerce-noreviews, .woocommerce-noreviews,
p.no-comments { p.no-comments {
@include clearfix; @include clearfix;
background-color: $woocommerce__color-success; background-color: $woocommerce__color-success;
clear: both; clear: both;
@ -239,10 +254,12 @@ p.no-comments {
} }
@media screen and (min-width: 48em) { @media screen and (min-width: 48em) {
/** /**
* Header cart * Header cart
*/ */
.site-header-cart { .site-header-cart {
.widget_shopping_cart { .widget_shopping_cart {
position: absolute; position: absolute;
top: 100%; top: 100%;
@ -255,6 +272,7 @@ p.no-comments {
&:hover, &:hover,
&.focus { &.focus {
.widget_shopping_cart { .widget_shopping_cart {
left: 0; left: 0;
display: block; display: block;

View File

@ -2,6 +2,7 @@
* Products * Products
*/ */
ul.products { ul.products {
@include clearfix; @include clearfix;
margin: 0; margin: 0;
padding: 0; padding: 0;
@ -26,8 +27,11 @@ ul.products {
} }
@media screen and (min-width: 48em) { @media screen and (min-width: 48em) {
ul.products { ul.products {
li.product { li.product {
@include column-width(3); @include column-width(3);
float: left; float: left;
margin-right: $columns__margin; margin-right: $columns__margin;
@ -43,7 +47,9 @@ ul.products {
} }
.columns-1 { .columns-1 {
ul.products { ul.products {
li.product { li.product {
float: none; float: none;
width: 100%; width: 100%;
@ -52,9 +58,13 @@ ul.products {
} }
@for $i from 2 through 6 { @for $i from 2 through 6 {
.columns-#{$i} { .columns-#{$i} {
ul.products { ul.products {
li.product { li.product {
@include column-width( $i ); @include column-width( $i );
} }
} }

View File

@ -2,7 +2,9 @@
* Single Product * Single Product
*/ */
.single-product { .single-product {
div.product { div.product {
@include clearfix; @include clearfix;
position: relative; position: relative;
@ -22,6 +24,7 @@
} }
.flex-control-thumbs { .flex-control-thumbs {
@include clearfix; @include clearfix;
margin: 0; margin: 0;
padding: 0; padding: 0;
@ -32,7 +35,7 @@
float: left; float: left;
img { img {
opacity: .5; opacity: 0.5;
&.flex-active { &.flex-active {
opacity: 1; opacity: 1;
@ -40,6 +43,7 @@
} }
&:hover { &:hover {
img { img {
opacity: 1; opacity: 1;
} }
@ -48,9 +52,13 @@
} }
@for $i from 2 through 5 { @for $i from 2 through 5 {
&.woocommerce-product-gallery--columns-#{$i} { &.woocommerce-product-gallery--columns-#{$i} {
.flex-control-thumbs { .flex-control-thumbs {
li { li {
@include column-width($i); @include column-width($i);
&:nth-child(#{$i}n) { &:nth-child(#{$i}n) {
@ -69,7 +77,8 @@
} }
.stock { .stock {
&:empty:before {
&:empty::before {
display: none; display: none;
} }

View File

@ -2,45 +2,51 @@
* Shop tables * Shop tables
*/ */
table.shop_table_responsive { table.shop_table_responsive {
thead { thead {
display: none; display: none;
} }
tbody { tbody {
th { th {
display: none; display: none;
} }
} }
tr { tr {
td { td {
display: block; display: block;
text-align: right; text-align: right;
clear: both; clear: both;
&:before { &::before {
content: attr(data-title) ': '; content: attr(data-title) ": ";
float: left; float: left;
} }
&.product-remove { &.product-remove {
a { a {
text-align: left; text-align: left;
} }
&:before { &::before {
display: none; display: none;
} }
} }
&.actions, &.actions,
&.download-actions { &.download-actions {
&:before {
&::before {
display: none; display: none;
} }
} }
&.download-actions { &.download-actions {
.button { .button {
display: block; display: block;
text-align: center; text-align: center;
@ -51,26 +57,31 @@ table.shop_table_responsive {
} }
@media screen and (min-width: 48em) { @media screen and (min-width: 48em) {
table.shop_table_responsive { table.shop_table_responsive {
thead { thead {
display: table-header-group; display: table-header-group;
} }
tbody { tbody {
th { th {
display: table-cell; display: table-cell;
} }
} }
tr { tr {
th, td {
th,
td {
text-align: left; text-align: left;
} }
td { td {
display: table-cell; display: table-cell;
&:before { &::before {
display: none; display: none;
} }
} }

View File

@ -2,13 +2,14 @@
* WooCommerce Price Filter * WooCommerce Price Filter
*/ */
.widget_price_filter { .widget_price_filter {
.price_slider { .price_slider {
margin-bottom: 1.5em; margin-bottom: 1.5em;
} }
.price_slider_amount { .price_slider_amount {
text-align: right; text-align: right;
line-height: 2.4em; line-height: 2.4;
.button { .button {
float: left; float: left;
@ -29,7 +30,7 @@
outline: none; outline: none;
background: $color__link; background: $color__link;
box-sizing: border-box; box-sizing: border-box;
margin-top: -.25em; margin-top: -0.25em;
opacity: 1; opacity: 1;
&:last-child { &:last-child {
@ -38,7 +39,7 @@
&:hover, &:hover,
&.ui-state-active { &.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 { .price_slider_wrapper .ui-widget-content {
background: rgba(0,0,0,0.1); background: rgba(0, 0, 0, 0.1);
} }
.ui-slider-horizontal { .ui-slider-horizontal {
height: .5em; height: 0.5em;
} }
.ui-slider-horizontal .ui-slider-range { .ui-slider-horizontal .ui-slider-range {

View File

@ -1,6 +1,7 @@
.comment-content a { .comment-content a {
word-wrap: break-word; word-wrap: break-word;
} }
.bypostauthor { .bypostauthor {
display: block; display: block;
} }

View File

@ -11,7 +11,7 @@ Text Domain: _s
Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
This theme, like WordPress, is licensed under the GPL. 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. _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. Underscores is distributed under the terms of the GNU GPL v2 or later.

View File

@ -2,7 +2,10 @@ p {
margin-bottom: 1.5em; margin-bottom: 1.5em;
} }
dfn, cite, em, i { dfn,
cite,
em,
i {
font-style: italic; font-style: italic;
} }
@ -17,6 +20,7 @@ address {
pre { pre {
background: $color__background-pre; background: $color__background-pre;
font-family: $font__pre; font-family: $font__pre;
@include font-size(0.9375); @include font-size(0.9375);
line-height: $font__line-height-pre; line-height: $font__line-height-pre;
margin-bottom: 1.6em; margin-bottom: 1.6em;
@ -25,17 +29,23 @@ pre {
padding: 1.6em; padding: 1.6em;
} }
code, kbd, tt, var { code,
kbd,
tt,
var {
font-family: $font__code; font-family: $font__code;
@include font-size(0.9375); @include font-size(0.9375);
} }
abbr, acronym { abbr,
acronym {
border-bottom: 1px dotted $color__border-abbr; border-bottom: 1px dotted $color__border-abbr;
cursor: help; cursor: help;
} }
mark, ins { mark,
ins {
background: $color__background-ins; background: $color__background-ins;
text-decoration: none; text-decoration: none;
} }

View File

@ -1,3 +1,8 @@
h1, h2, h3, h4, h5, h6 { h1,
h2,
h3,
h4,
h5,
h6 {
clear: both; clear: both;
} }

View File

@ -6,10 +6,10 @@ optgroup,
textarea { textarea {
color: $color__text-main; color: $color__text-main;
font-family: $font__main; font-family: $font__main;
@include font-size(1); @include font-size(1);
line-height: $font__line-height-body; line-height: $font__line-height-body;
} }
@import "headings"; @import "headings";
@import "copy"; @import "copy";

View File

@ -8,9 +8,9 @@ $color__background-ins: #fff9c0;
$color__text-screen: #21759b; $color__text-screen: #21759b;
$color__text-input: #666; $color__text-input: #666;
$color__text-input-focus: #111; $color__text-input-focus: #111;
$color__link: royalblue; $color__link: #4169e1; //royalblue
$color__link-visited: purple; $color__link-visited: #800080; //purple
$color__link-hover: midnightblue; $color__link-hover: #191970; //midnightblue
$color__text-main: #404040; $color__text-main: #404040;
$color__border-button: #ccc #ccc #bbb; $color__border-button: #ccc #ccc #bbb;

View File

@ -1,5 +1,5 @@
$font__main: sans-serif; $font__main: sans-serif;
$font__code: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; $font__code: monaco, consolas, "Andale Mono", "DejaVu Sans Mono", monospace;
$font__pre: "Courier 10 Pitch", Courier, monospace; $font__pre: "Courier 10 Pitch", courier, monospace;
$font__line-height-body: 1.5; $font__line-height-body: 1.5;
$font__line-height-pre: 1.6; $font__line-height-pre: 1.6;

View File

@ -9,7 +9,7 @@ WooCommerce styles override
*/ */
$woocommerce__color-error: #e2401c; $woocommerce__color-error: #e2401c;
$woocommerce__color-success: #0f834d; $woocommerce__color-success: #0f834d;
$woocommerce__color-info: #3D9CD2; $woocommerce__color-info: #3d9cd2;
/** /**
* Imports * Imports

View File

@ -20,10 +20,12 @@
<?php <?php
the_content(); the_content();
wp_link_pages( array( wp_link_pages(
array(
'before' => '<div class="page-links">' . esc_html__( 'Pages:', '_s' ), 'before' => '<div class="page-links">' . esc_html__( 'Pages:', '_s' ),
'after' => '</div>', 'after' => '</div>',
) ); )
);
?> ?>
</div><!-- .entry-content --> </div><!-- .entry-content -->

View File

@ -33,7 +33,8 @@
<div class="entry-content"> <div class="entry-content">
<?php <?php
the_content( sprintf( the_content(
sprintf(
wp_kses( wp_kses(
/* translators: %s: Name of current post. Only visible to screen readers */ /* translators: %s: Name of current post. Only visible to screen readers */
__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', '_s' ), __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', '_s' ),
@ -44,12 +45,15 @@
) )
), ),
wp_kses_post( get_the_title() ) wp_kses_post( get_the_title() )
) ); )
);
wp_link_pages( array( wp_link_pages(
array(
'before' => '<div class="page-links">' . esc_html__( 'Pages:', '_s' ), 'before' => '<div class="page-links">' . esc_html__( 'Pages:', '_s' ),
'after' => '</div>', 'after' => '</div>',
) ); )
);
?> ?>
</div><!-- .entry-content --> </div><!-- .entry-content -->