Skip to content

Commit 7359cbe

Browse files
Merge pull request #98 from bigboxwc/release/2.2.0
release/2.2.0
2 parents 0026807 + 4cfd78e commit 7359cbe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+2035
-2021
lines changed

.browserslistrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
extends @wordpress/browserslist-config

.eslintrc.js

Lines changed: 0 additions & 147 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
## [2.2.0] - 2018-12-27
2+
3+
### New
4+
5+
- Accessibility improvements:
6+
- Better tabbing order for shop filters and results.
7+
- "Skip to content" and "Skip to result" skip links.
8+
- Ensure all focus outlines are visible.
9+
- Upgrade developer experience:
10+
- Use more `@wordpress` `npm` packages (`eslint`, `browserslist`)
11+
- Update JS coding standards.
12+
- Update PHP coding standards.
13+
- Update CSS coding standards.
14+
- Request a Google Fonts API key when generating font list.
15+
- Allow integrations to define helper files to be autoloaded.
16+
17+
### Fix
18+
19+
- Avoid error if offcanvas drawer source or target does not exist.
20+
121
## [2.1.0] - 2018-12-18
222

323
### New
@@ -9,7 +29,7 @@
929
### Fix
1030

1131
- Ensure button color is accurately reflected.
12-
- Coding standad updates.
32+
- Coding standard updates.
1333

1434
## [2.0.0] - 2018-11-06
1535

CONTRIBUTING.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
## Getting Started
44

5-
If you prefer to set things up manually, be sure to have <a href="https://nodejs.org/en/">Node.js installed first</a>. You should be running a Node version matching the [current active LTS release](https://github.com/nodejs/Release#release-schedule) or newer for this plugin to work correctly. You can check your Node.js version by typing `node -v` in the Terminal prompt.
5+
Be sure to have <a href="https://nodejs.org/en/">Node.js installed first</a>. You should be running a Node version matching the [current active LTS release](https://github.com/nodejs/Release#release-schedule) or newer for this plugin to work correctly. You can check your Node.js version by typing `node -v` in the Terminal prompt.
66

77
You should also have the latest release of <a href="https://npmjs.org">npm installed</a>, npm is a separate project from Node.js and is updated frequently. If you've just installed Node.js which includes a version of npm within the installation you most likely will need to also update your npm install. To update npm, type this into your terminal: `npm install npm@latest -g`
88

99
To test the plugin, or to contribute to it, you can clone this repository and build the plugin files using Node. How you do that depends on whether you're developing locally or uploading the plugin to a remote host.
1010

1111
### Local Environment
1212

13-
Next, open a terminal (or if on Windows, a command prompt) and navigate to the repository you cloned. Now type `npm run setup-theme` to get the dependencies all set up. Then you can type `npm run dev` in your terminal or command prompt to keep the theme building in the background as you work on it.
13+
Next, open a terminal (or if on Windows, a command prompt) and navigate to the repository you cloned. Now type `npm run setup-theme-dev` to get the dependencies all set up. Then you can type `npm run dev` in your terminal or command prompt to keep the theme building in the background as you work on it.
1414

1515
## Workflow
1616

@@ -21,10 +21,11 @@ A good workflow for new contributors to follow is listed below:
2121
- Make code changes
2222
- Commit code changes within newly created branch
2323
- Push branch to forked repository
24-
- Submit Pull Request to `bigbox-theme` repository
24+
- Submit Pull Request to `bigbox` repository
2525

2626
Ideally name your branches with prefixes and descriptions, like this: `[type]/[change]`. A good prefix would be:
2727

2828
- `add/` = add a new feature
2929
- `try/` = experimental feature, "tentatively add"
30-
- `update/` = update an existing feature
30+
- `update/` = update an existing feature
31+
- `issue/` = solve an open issue

app/class-integration.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ abstract class Integration {
5656
*/
5757
protected $dependencies;
5858

59+
/**
60+
* Additional functional files.
61+
*
62+
* @var array $helper_files
63+
* @since 2.2.0
64+
*/
65+
protected $helper_files = [];
66+
5967
/**
6068
* Additional inline CSS configuration items.
6169
*
@@ -79,6 +87,17 @@ public function __construct( $slug, $dependencies ) {
7987
$this->dir = get_template_directory() . $this->get_local_path();
8088
}
8189

90+
/**
91+
* Load defined helper files.
92+
*
93+
* @since 2.2.0
94+
*/
95+
function load_helper_files() {
96+
foreach ( $this->helper_files as $name ) {
97+
include_once trailingslashit( $this->get_dir() ) . $name . '.php';
98+
}
99+
}
100+
82101
/**
83102
* Get the integrations local working path.
84103
*
@@ -125,6 +144,9 @@ public function is_active() {
125144
* Load inline CSS if any output controls are defined.
126145
*
127146
* @since 1.16.0
147+
*
148+
* @param array $configs Output configurations.
149+
* @return array $configs Output configurations with additional integration configurations.
128150
*/
129151
public function inline_css_configs( $configs ) {
130152
if ( empty( $this->inline_css_configs ) ) {

app/customize/controls/type.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,14 @@
2222
* @return array
2323
*/
2424
function bigbox_customize_controls_js_fonts( $settings ) {
25+
$file = get_template_directory() . '/resources/data/google-fonts.json';
26+
27+
if ( ! file_exists( $file ) ) {
28+
return $settings;
29+
}
30+
2531
$settings['typography'] = [
26-
'fontList' => json_decode( file_get_contents( get_template_directory() . '/resources/data/google-fonts.json' ) ), // @codingStandardsIgnoreLine
32+
'fontList' => json_decode( file_get_contents( $file ) ), // @codingStandardsIgnoreLine
2733
];
2834

2935
return $settings;
@@ -57,10 +63,12 @@ function bigbox_customize_register_type_sections( $wp_customize ) {
5763
* @param WP_Customize_Manager $wp_customize The Customizer object.
5864
*/
5965
function bigbox_customize_register_type_controls( $wp_customize ) {
66+
$google = bigbox_has_google_fonts();
67+
6068
$wp_customize->add_setting(
6169
'type-font-family',
6270
[
63-
'default' => 'Lato',
71+
'default' => $google ? 'Lato' : 'default',
6472
'transport' => 'postMessage',
6573
'sanitize_callback' => 'sanitize_text_field',
6674
]
@@ -141,7 +149,7 @@ function bigbox_customize_register_type_controls( $wp_customize ) {
141149
/* translators: Customizer control label. */
142150
'label' => __( 'Base Font Weight', 'bigbox' ),
143151
'description' => '',
144-
'weight' => 'regular',
152+
'weight' => $google ? 'regular' : 500,
145153
],
146154
'bold' => [
147155
/* translators: Customizer control label. */

app/customize/output/color-primary.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,9 @@
106106
'outline-color' => [
107107
'selectors' => [
108108
'.is-tabbing *:focus',
109-
'.is-tabbing .navbar--mobile *:focus',
110-
'.is-tabbing .sub-menu *:focus',
109+
'.is-tabbing .navbar .navbar--mobile :focus',
110+
'.is-tabbing .navbar .navbar-search :focus',
111+
'.is-tabbing .navbar .sub-menu :focus',
111112
],
112113
'declarations' => [
113114
'outline-color' => esc_attr( $primary ),

app/customize/output/type.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,15 @@
5454
],
5555
'declarations' => [
5656
'font-weight' => esc_attr( $weight_base ),
57-
'font-family' => sprintf( '"%1$s", %2$s', esc_attr( $family ), esc_attr( $fallback ) ),
5857
'font-size' => esc_attr( "{$size}em" ),
5958
],
6059
];
6160

61+
// Only add family if not using system default.
62+
if ( 'default' !== $family ) {
63+
$base['declarations']['font-family'] = sprintf( '"%1$s", %2$s', esc_attr( $family ), esc_attr( $fallback ) );
64+
}
65+
6266
return [
6367
$base,
6468

app/customize/type-functions.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@
1313
exit; // Exit if accessed directly.
1414
}
1515

16+
/**
17+
* Determine if the Google Font list is available.
18+
*
19+
* @since 2.2.0
20+
*
21+
* @return bool
22+
*/
23+
function bigbox_has_google_fonts() {
24+
return file_exists( get_template_directory() . '/resources/data/google-fonts.json' );
25+
}
26+
1627
/**
1728
* Get the chosen family.
1829
*
@@ -21,7 +32,8 @@
2132
* @return string
2233
*/
2334
function bigbox_get_theme_font_family() {
24-
$family = get_theme_mod( 'type-font-family', 'Lato' );
35+
$default = bigbox_has_google_fonts() ? 'Lato' : 'default';
36+
$family = get_theme_mod( 'type-font-family', $default );
2537

2638
/**
2739
* Filters the name of the font family used to generate custom CSS.
@@ -42,7 +54,7 @@ function bigbox_get_theme_font_family() {
4254
* @return string
4355
*/
4456
function bigbox_get_theme_font_weight( $weight_type = 'base' ) {
45-
$weight = get_theme_mod( "type-font-weight-{$weight_type}", 'base' === $weight_type ? 'normal' : 'bold' );
57+
$weight = get_theme_mod( "type-font-weight-{$weight_type}", 'base' === $weight_type ? 500 : 700 );
4658

4759
/**
4860
* Filters the font weight used to generate custom CSS.

app/integrations/facetwp/class-facetwp.php

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@
2626
*/
2727
class FacetWP extends Integration implements Registerable, Service {
2828

29+
/**
30+
* Additional functional files.
31+
*
32+
* @var array $helper_files
33+
* @since 2.2.0
34+
*/
35+
protected $helper_files = [
36+
'template-hooks',
37+
'template-functions',
38+
'default-facets',
39+
'customize',
40+
];
41+
2942
/**
3043
* Additional inline CSS configuration items.
3144
*
@@ -42,12 +55,9 @@ class FacetWP extends Integration implements Registerable, Service {
4255
* @since 1.0.0
4356
*/
4457
public function register() {
45-
add_filter( 'bigbox_customize_inline_css_configs', [ $this, 'inline_css_configs' ] );
58+
$this->load_helper_files();
4659

47-
include_once $this->get_dir() . '/template-hooks.php';
48-
include_once $this->get_dir() . '/template-functions.php';
49-
include_once $this->get_dir() . '/default-facets.php';
50-
include_once $this->get_dir() . '/customize.php';
60+
add_filter( 'bigbox_customize_inline_css_configs', [ $this, 'inline_css_configs' ] );
5161
}
5262

5363
}

0 commit comments

Comments
 (0)