From 524df3b748c3cb37ca8671b54b63d2ccf7144e17 Mon Sep 17 00:00:00 2001 From: Andrew Misplon Date: Sat, 2 Dec 2017 19:03:34 +0200 Subject: [PATCH 1/4] Foundation for a header widget area. --- functions.php | 4 +- header.php | 112 ++++++++++++++++++++---------------- sass/navigation/_menus.scss | 4 ++ sass/site/_header.scss | 66 +++++++++++++++++++++ style.css | 60 +++++++++++++++++++ 5 files changed, 193 insertions(+), 53 deletions(-) diff --git a/functions.php b/functions.php index 81ee2c3..dfa0fa2 100644 --- a/functions.php +++ b/functions.php @@ -54,7 +54,7 @@ function polestar_setup() { /* * Enable support for the custom logo. */ - add_theme_support( 'custom-logo' ); + add_theme_support( 'custom-logo' ); // This theme uses wp_nav_menu() in two locations. register_nav_menus( array( @@ -106,7 +106,7 @@ function polestar_content_width() { add_action( 'after_setup_theme', 'polestar_content_width', 0 ); /** - * Register widget area. + * Register widget areas. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ diff --git a/header.php b/header.php index ac062d1..76fdcfb 100644 --- a/header.php +++ b/header.php @@ -29,70 +29,80 @@ +
>
- -
- -
- -
- - - - - - -
+
+ + diff --git a/sass/navigation/_menus.scss b/sass/navigation/_menus.scss index f4807df..b6b1979 100644 --- a/sass/navigation/_menus.scss +++ b/sass/navigation/_menus.scss @@ -1,5 +1,9 @@ .main-navigation { text-align: right; + + &.widget_nav_menu { + text-align: initial; + } > div { display: inline-block; diff --git a/sass/site/_header.scss b/sass/site/_header.scss index d5d7462..1768d8d 100644 --- a/sass/site/_header.scss +++ b/sass/site/_header.scss @@ -203,6 +203,72 @@ } } } + + .widgets { + -ms-flex-align: center; + -webkit-align-items: center; + -webkit-box-align: center; + align-items: center; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-justify-content: space-between; + justify-content: space-between; + width: 100%; + + @media (max-width: 768px) { + flex-direction: column; + } + + @for $i from 1 through 10 { + $margin: ($i - 1) * 2.75; + &.widgets-#{$i} .widget { + width: (100% - $margin) / $i; + } + } + + .widget { + box-sizing: content-box; + margin: 0 2.75% 0 0; + + &:last-of-type { + margin-right: 0; + } + + @media (max-width: 768px) { + margin-bottom: 5%; + text-align: center; + width: 100% !important; + + &:last-of-type { + margin-bottom: 0; + } + } + + .widget-title { + font-size: 16px; + margin: 0 0 5px; + + // Set the font size of elements below the widget title to 14px. + ~ * { + font-size: 14px; + } + } + + .textwidget { + font-size: 14px; + } + + p:only-of-type, + p:last-of-type { + margin-bottom: 0; + } + + ul { + margin-bottom: 0; + } + } + } } // Sticky header sentinel. diff --git a/style.css b/style.css index d9fe5b0..6e68be6 100644 --- a/style.css +++ b/style.css @@ -583,6 +583,8 @@ a { --------------------------------------------------------------*/ .main-navigation { text-align: right; } + .main-navigation.widget_nav_menu { + text-align: initial; } .main-navigation > div { display: inline-block; } .main-navigation ul { @@ -1730,6 +1732,64 @@ a { text-align: center; } .site-header:not(.mobile-menu) .main-navigation { text-align: center; } } + .site-header .widgets { + -ms-flex-align: center; + -webkit-align-items: center; + -webkit-box-align: center; + align-items: center; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-justify-content: space-between; + justify-content: space-between; + width: 100%; } + @media (max-width: 768px) { + .site-header .widgets { + flex-direction: column; } } + .site-header .widgets.widgets-1 .widget { + width: 100%; } + .site-header .widgets.widgets-2 .widget { + width: 48.625%; } + .site-header .widgets.widgets-3 .widget { + width: 31.5%; } + .site-header .widgets.widgets-4 .widget { + width: 22.9375%; } + .site-header .widgets.widgets-5 .widget { + width: 17.8%; } + .site-header .widgets.widgets-6 .widget { + width: 14.375%; } + .site-header .widgets.widgets-7 .widget { + width: 11.92857%; } + .site-header .widgets.widgets-8 .widget { + width: 10.09375%; } + .site-header .widgets.widgets-9 .widget { + width: 8.66667%; } + .site-header .widgets.widgets-10 .widget { + width: 7.525%; } + .site-header .widgets .widget { + box-sizing: content-box; + margin: 0 2.75% 0 0; } + .site-header .widgets .widget:last-of-type { + margin-right: 0; } + @media (max-width: 768px) { + .site-header .widgets .widget { + margin-bottom: 5%; + text-align: center; + width: 100% !important; } + .site-header .widgets .widget:last-of-type { + margin-bottom: 0; } } + .site-header .widgets .widget .widget-title { + font-size: 16px; + margin: 0 0 5px; } + .site-header .widgets .widget .widget-title ~ * { + font-size: 14px; } + .site-header .widgets .widget .textwidget { + font-size: 14px; } + .site-header .widgets .widget p:only-of-type, + .site-header .widgets .widget p:last-of-type { + margin-bottom: 0; } + .site-header .widgets .widget ul { + margin-bottom: 0; } .masthead-sentinel { margin-bottom: 60px; } From c62335ce85225616e4c1af5145124ca5ff6e2171 Mon Sep 17 00:00:00 2001 From: Andrew Misplon Date: Thu, 14 Dec 2017 10:00:36 -0800 Subject: [PATCH 2/4] Header widget form field styling --- sass/site/_header.scss | 4 ++++ style.css | 2 ++ 2 files changed, 6 insertions(+) diff --git a/sass/site/_header.scss b/sass/site/_header.scss index 1768d8d..d64adbc 100644 --- a/sass/site/_header.scss +++ b/sass/site/_header.scss @@ -267,6 +267,10 @@ ul { margin-bottom: 0; } + + input[type="search"] { + font-size: 14px; + } } } } diff --git a/style.css b/style.css index 6e68be6..84c0f98 100644 --- a/style.css +++ b/style.css @@ -1790,6 +1790,8 @@ a { margin-bottom: 0; } .site-header .widgets .widget ul { margin-bottom: 0; } + .site-header .widgets .widget input[type="search"] { + font-size: 14px; } .masthead-sentinel { margin-bottom: 60px; } From bccf189afd4ca8ebe29deacd1747691aa17eaa5d Mon Sep 17 00:00:00 2001 From: Andrew Misplon Date: Thu, 14 Dec 2017 10:04:13 -0800 Subject: [PATCH 3/4] Fix WC PayPal logo issue --- woocommerce/template-tags.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/woocommerce/template-tags.php b/woocommerce/template-tags.php index b751213..4a57610 100644 --- a/woocommerce/template-tags.php +++ b/woocommerce/template-tags.php @@ -102,7 +102,7 @@ function polestar_woocommerce_description_title() { * Add a consistent PayPal icon. */ function polestar_woocommerce_paypal_icon( $url ) { - return get_stylesheet_directory_uri() . '/woocommerce/images/paypal-icon.png'; + return get_template_directory_uri() . '/woocommerce/images/paypal-icon.png'; } endif; add_filter( 'woocommerce_paypal_icon', 'polestar_woocommerce_paypal_icon' ); From 137d0cf10b789d04338f50e6b343a11c36514c8b Mon Sep 17 00:00:00 2001 From: Andrew Misplon Date: Thu, 14 Dec 2017 10:17:10 -0800 Subject: [PATCH 4/4] Update changelog --- changelog.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/changelog.txt b/changelog.txt index 48e4e97..1856ed0 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ == Changelog == += 1.0.18 - 14 December 2017 = +* Resolved WooCommerce PayPal logo issue impacting child themes. + = 1.0.17 - 26 November 2017 = * Fixed featured image setting on single post page. * Minor style fixes for menu mini-cart.