Skip to content

Commit

Permalink
Update/wp 5.4 (#339)
Browse files Browse the repository at this point in the history
* Reset social links block margin

* Update editor class for links

* Show theme primary and secondary inline text color in editor

See WordPress/gutenberg#21293

* Remove unused `light` heading class

* Update OCTS content

* Add link to button

* Update version, .pot

* Reset border radius and match other theme content

Resetting the border radius allows the buttons to take on the default border radius for the theme on theme switch.

* Update changelog

* Add requirement to changelog
  • Loading branch information
dreamwhisper authored Apr 3, 2020
1 parent 46f2469 commit 38bb767
Show file tree
Hide file tree
Showing 11 changed files with 88 additions and 53 deletions.
20 changes: 17 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Genesis Sample Theme Changelog

## [3.3.0] - 2020-04-07
Requires WordPress 5.4 or higher.

### Added
* CSS to adjust left padding for WordPress 5.4 Social Icons.
* Editor styles to ensure theme colors work for inline text colors.
* Editor styles for WordPress 5.4 compatibility, including link color, buttons, headings, and lists.

### Changed
* Updated one-click theme setup content to include WordPress 5.4 button markup.

### Removed
* Unused `light` heading class.

## [3.2.0] - 2019-11-13

### Added
Expand All @@ -17,7 +31,7 @@
* CSS for tables for better consistency between editor and front end and to allow for new WordPress 5.3 settings.
* Allow footer widgets to be displayed on the landing page template.
* Set imported landing page meta to hide footer widgets. Requires Genesis 3.2 or higher.
* Update homepage content import to use Atomic Blocks Adanced Columns block.
* Update homepage content import to use Atomic Blocks Advanced Columns block.
* Update the phpcs config to exclude a PHP short array rule intended only for WordPress core.

### Fixed
Expand Down Expand Up @@ -87,7 +101,7 @@ Requires Genesis 2.10.0+.
* Changed: improve editor button block styling.
* Changed: clarify wording of Customizer color labels.
* Changed: remove matchHeight script and use CSS flex instead to match heights of WooCommerce product lists.
* Fixed: WooCommmerce shop pages now use the selected page layout instead of the default site layout on sites using object caching.
* Fixed: WooCommerce shop pages now use the selected page layout instead of the default site layout on sites using object caching.
* Fixed: update the `npm run zip` script to prevent an issue with zip decompression for apps such as Path Finder. (npm scripts are available in the version of Genesis Sample on GitHub: https://github.com/studiopress/genesis-sample/).

## [2.9.1] - 2019-03-19
Expand Down Expand Up @@ -179,7 +193,7 @@ Requires Genesis 2.8.0+.
* Update to normalize.css 4.1.1.

## [2.2.3] - 2016-05-18
* Add accessibile mobile menu.
* Add accessible mobile menu.
* Add accessibility support for the 404 Page.
* Add the custom header option to upload your own logo.
* Add customizer option for primary color.
Expand Down
18 changes: 11 additions & 7 deletions config/import/content/block-examples.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,17 @@
<h2 style="text-align:left">Buttons</h2>
<!-- /wp:heading -->
<!-- wp:button {"align":"center"} -->
<div class="wp-block-button aligncenter"><a class="wp-block-button__link" href="#">Button<br></a></div>
<!-- /wp:button -->
<!-- wp:button {"align":"center","className":"is-style-outline"} -->
<div class="wp-block-button aligncenter is-style-outline"><a class="wp-block-button__link" href="#">Outlined Button<br></a></div>
<!-- /wp:button -->
<!-- wp:buttons {"align":"center"} -->
<div class="wp-block-buttons aligncenter"><!-- wp:button -->
<div class="wp-block-button"><a class="wp-block-button__link" href="#">Button</a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons -->
<!-- wp:buttons {"align":"center"} -->
<div class="wp-block-buttons aligncenter"><!-- wp:button {"className":"is-style-outline"} -->
<div class="wp-block-button is-style-outline"><a class="wp-block-button__link" href="#">Outlined Button</a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons -->
<!-- wp:separator {"className":"is-style-wide"} -->
<hr class="wp-block-separator is-style-wide"/>
Expand Down
16 changes: 10 additions & 6 deletions config/import/content/home-black-white.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@
<p>All the resources, training, and support you need to run your dream online business! </p>
<!-- /wp:paragraph -->
<!-- wp:button {"textColor":"light-gray","className":"is-style-default"} -->
<div class="wp-block-button is-style-default"><a class="wp-block-button__link has-text-color has-light-gray-color" href="#">Learn More</a></div>
<!-- /wp:button --></div></div>
<!-- wp:buttons {"align":"left"} -->
<div class="wp-block-buttons alignleft"><!-- wp:button -->
<div class="wp-block-button"><a class="wp-block-button__link" href="#">Learn More</a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons --></div></div>
<!-- /wp:media-text -->
<!-- wp:atomic-blocks/ab-container {"containerPaddingTop":4.5,"containerPaddingRight":0,"containerPaddingBottom":0,"containerPaddingLeft":0,"containerMarginTop":0,"containerMarginBottom":0,"containerWidth":"full","containerBackgroundColor":"#333"} -->
Expand Down Expand Up @@ -81,9 +83,11 @@
<!-- /wp:atomic-blocks/ab-column -->
<!-- wp:atomic-blocks/ab-column -->
<div class="wp-block-atomic-blocks-ab-column ab-block-layout-column"><div class="ab-block-layout-column-inner"><!-- wp:button {"customTextColor":"#ffffff","borderRadius":0,"align":"right","className":"is-style-outline home-contact"} -->
<div class="wp-block-button alignright is-style-outline home-contact"><a class="wp-block-button__link has-text-color no-border-radius" href="/contact" style="color:#ffffff">Get in touch</a></div>
<!-- /wp:button --></div></div>
<div class="wp-block-atomic-blocks-ab-column ab-block-layout-column"><div class="ab-block-layout-column-inner"><!-- wp:buttons {"align":"right"} -->
<div class="wp-block-buttons alignright"><!-- wp:button {"customTextColor":"#ffffff","borderRadius":0,"className":"is-style-outline"} -->
<div class="wp-block-button is-style-outline"><a class="wp-block-button__link has-text-color no-border-radius" href="#" style="color:#ffffff">Get in touch</a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons --></div></div>
<!-- /wp:atomic-blocks/ab-column --></div></div>
<!-- /wp:atomic-blocks/ab-columns -->
Expand Down
16 changes: 10 additions & 6 deletions config/import/content/home-color.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@
<p>All the resources, training, and support you need to run your dream online business! </p>
<!-- /wp:paragraph -->
<!-- wp:button {"textColor":"light-gray","className":"is-style-default"} -->
<div class="wp-block-button is-style-default"><a class="wp-block-button__link has-text-color has-light-gray-color" href="#">Learn More</a></div>
<!-- /wp:button --></div></div>
<!-- wp:buttons {"align":"left"} -->
<div class="wp-block-buttons alignleft"><!-- wp:button -->
<div class="wp-block-button"><a class="wp-block-button__link" href="#">Learn More</a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons --></div></div>
<!-- /wp:media-text -->
<!-- wp:atomic-blocks/ab-container {"containerPaddingTop":4.5,"containerPaddingRight":0,"containerPaddingBottom":0,"containerPaddingLeft":0,"containerMarginTop":0,"containerMarginBottom":0,"containerWidth":"full","containerBackgroundColor":"#111111"} -->
Expand Down Expand Up @@ -81,9 +83,11 @@
<!-- /wp:atomic-blocks/ab-column -->
<!-- wp:atomic-blocks/ab-column -->
<div class="wp-block-atomic-blocks-ab-column ab-block-layout-column"><div class="ab-block-layout-column-inner"><!-- wp:button {"customTextColor":"#ffffff","borderRadius":0,"align":"right","className":"is-style-outline home-contact"} -->
<div class="wp-block-button alignright is-style-outline home-contact"><a class="wp-block-button__link has-text-color no-border-radius" href="/contact" style="color:#ffffff">Get in touch</a></div>
<!-- /wp:button --></div></div>
<div class="wp-block-atomic-blocks-ab-column ab-block-layout-column"><div class="ab-block-layout-column-inner"><!-- wp:buttons {"align":"right"} -->
<div class="wp-block-buttons alignright"><!-- wp:button {"customTextColor":"#ffffff","borderRadius":0,"className":"is-style-outline"} -->
<div class="wp-block-button is-style-outline"><a class="wp-block-button__link has-text-color no-border-radius" href="#" style="color:#ffffff">Get in touch</a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons --></div></div>
<!-- /wp:atomic-blocks/ab-column --></div></div>
<!-- /wp:atomic-blocks/ab-columns -->
Expand Down
8 changes: 4 additions & 4 deletions languages/genesis-sample.pot
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# <!=Copyright (C) 2019 StudioPress
# <!=Copyright (C) 2020 StudioPress
# This file is distributed under the GPL-2.0-or-later.=!>
msgid ""
msgstr ""
"Project-Id-Version: Genesis Sample 3.2.0\n"
"Project-Id-Version: Genesis Sample 3.3.0\n"
"Report-Msgid-Bugs-To: StudioPress <[email protected]>\n"
"POT-Creation-Date: 2019-11-12 16:53:34+00:00\n"
"POT-Creation-Date: 2020-04-01 20:59:05+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2019-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: 2020-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: en\n"
Expand Down
17 changes: 4 additions & 13 deletions lib/gutenberg/front-end.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,6 @@
padding-right: 30px;
}

/* Headings
---------------------------------------------------------------------------- */

h1.light,
h2.light,
h3.light,
h4.light,
h5.light,
h6.light {
color: #f5f5f5;
}

/* Background Color
---------------------------------------------------------------------------- */

Expand Down Expand Up @@ -80,12 +68,14 @@ h6.light {
}

.wp-block-button.alignleft,
.wp-block-buttons.alignleft,
.wp-block-cover.alignleft,
.wp-block-image .alignleft {
margin-right: 2em;
}

.wp-block-button.alignright,
.wp-block-buttons.alignright,
.wp-block-cover.alignright,
.wp-block-image .alignright {
margin-left: 2em;
Expand Down Expand Up @@ -357,7 +347,8 @@ hr.wp-block-separator {
}

.site-container .blocks-gallery-grid,
.site-container .wp-block-gallery {
.site-container .wp-block-gallery,
.site-container .wp-block-social-links {
padding-left: 0;
}

Expand Down
28 changes: 27 additions & 1 deletion lib/gutenberg/inline-styles.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function genesis_sample_custom_gutenberg_admin_css() {

$css = <<<CSS
.ab-block-post-grid .ab-post-grid-items h2 a:hover,
.block-editor__container .editor-block-list__block a {
.block-editor__container .editor-styles-wrapper a {
color: {$appearance['link-color']};
}
Expand All @@ -85,6 +85,8 @@ function genesis_sample_custom_gutenberg_admin_css() {
}
CSS;

$css .= genesis_sample_editor_inline_color_palette();

wp_add_inline_style( genesis_get_theme_handle() . '-gutenberg-fonts', $css );

}
Expand Down Expand Up @@ -146,6 +148,30 @@ function genesis_sample_inline_color_palette() {
CSS;
}

return $css;
}

/**
* Generate CSS for editor colors based on theme color palette support.
*
* @since 3.3.0
*
* @return string The editor colors CSS if `editor-color-palette` theme support was declared.
*/
function genesis_sample_editor_inline_color_palette() {

$css = '';
$appearance = genesis_get_config( 'appearance' );
$editor_color_palette = $appearance['editor-color-palette'];

foreach ( $editor_color_palette as $color_info ) {
$css .= <<<CSS
.has-{$color_info['slug']}-color {
color: {$color_info['color']};
}
CSS;
}

return $css;

}
9 changes: 0 additions & 9 deletions lib/gutenberg/style-editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,6 @@ h6 {
font-size: 16px;
}

.wp-block-heading h1.light,
.wp-block-heading h2.light,
.wp-block-heading h3.light,
.wp-block-heading h4.light,
.wp-block-heading h5.light,
.wp-block-heading h6.light {
color: #f5f5f5;
}

.editor-post-title__block .editor-post-title__input {
font-family: "Source Sans Pro", sans-serif;
font-size: 30px;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"description": "The sample child theme for the Genesis Framework.",
"author": "StudioPress",
"authoruri": "https://www.studiopress.com/",
"version": "3.2.0",
"version": "3.3.0",
"tags": "one-column, two-columns, left-sidebar, right-sidebar, accessibility-ready, custom-colors, custom-logo, custom-menu, featured-images, footer-widgets, full-width-template, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready",
"license": "GPL-2.0-or-later",
"licenseuri": "https://www.gnu.org/licenses/gpl-2.0.html",
Expand Down
2 changes: 1 addition & 1 deletion phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

<!-- Rules: WordPress Coding Standards - see
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards -->
<config name="minimum_supported_wp_version" value="5.0"/>
<config name="minimum_supported_wp_version" value="5.4"/>
<!-- For help in understanding these custom sniff properties:
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties -->
<rule ref="WordPress-Extra"/><!-- Includes WordPress-Core -->
Expand Down
5 changes: 3 additions & 2 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Description: This is the sample theme created for the Genesis Framework.
Author: StudioPress
Author URI: https://www.studiopress.com/
Version: 3.2.0
Version: 3.3.0
Tags: accessibility-ready, block-styles, custom-colors, custom-logo, custom-menu, editor-style, featured-images, footer-widgets, full-width-template, left-sidebar, one-column, right-sidebar, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready, two-columns, wide-blocks
Expand All @@ -15,9 +15,10 @@ License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: genesis-sample
Requires at least: 5.4
Requires PHP: 5.6
*/


/* Table of Contents
- HTML5 Reset
- Baseline Normalize
Expand Down

0 comments on commit 38bb767

Please sign in to comment.