Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# Theme Dev Container

A **theme-only** dev container so you can work on WDS BT without installing PHP or Node locally—whether you’re at WDS (using the project template) or anywhere else. The stack matches [WebDevStudios/wds-devcontainer](https://github.com/WebDevStudios/wds-devcontainer): **PHP 8.2** and **Node 24**.
This is the **supported development environment** for WDS BT: a theme-only container so you do not need PHP or Node installed on the host. The stack matches [WebDevStudios/wds-devcontainer](https://github.com/WebDevStudios/wds-devcontainer): **PHP 8.2** and **Node 24**.

PHP linting uses Composer scripts that call **`vendor/bin/phpcs`** and **`vendor/bin/phpcbf`** (`composer run-script phpcs` / `phpcs-fix`)—no extra wrapper scripts. Run those inside the container (or any Linux/macOS shell with Composer deps installed) for consistent results.

## Usage

1. Open this theme repo in Cursor or VS Code.
2. Choose **Reopen in Container** (or run **Dev Containers: Reopen in Container** from the command palette).
3. After the container builds, run `npm run setup` if needed (postCreate runs `npm ci && composer install`).
2. Choose **Reopen in Container** (or **Dev Containers: Reopen in Container** from the command palette).
3. After the container builds, `postCreateCommand` runs `npm ci && composer install`. Use `npm run setup` from the theme root when you need a full clean install and build.

## What’s included

- PHP 8.2 with Composer and extensions: tokenizer, xmlwriter, simplexml, dom, mbstring
- Node 24
- **jq** (installed on container create) so `composer install` and Cursor-rules sync from `composer.json` succeed
- VS Code extensions: Intelephense, ESLint, Prettier, Stylelint

When you use a full WordPress project (e.g. WDS project template), that project’s devcontainer is used for the site; this one is for standalone theme development only.
When you use a full WordPress project (e.g. WDS project template), that project’s devcontainer runs the site; this one is for standalone theme development only.
1 change: 1 addition & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
]
}
},
"onCreateCommand": "sudo apt-get update -qq && sudo DEBIAN_FRONTEND=noninteractive apt-get install -y -qq jq",
"postCreateCommand": "npm ci && composer install --no-interaction",
"remoteUser": "vscode"
}
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# The version of your theme, manually updated by you.
# This version will be reflected in style.css, package.json, and composer.json.
VERSION=1.4.5
VERSION=1.4.6
6 changes: 4 additions & 2 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Allow legacy peer deps for WordPress ecosystem compatibility
legacy-peer-deps=true

# Ensure scripts run with proper shell
script-shell=/bin/bash
# Do not set script-shell to /bin/bash here: that path does not exist on Windows and
# causes `spawn /bin/bash ENOENT` during dependency install scripts. Use the platform
# default (cmd.exe on Windows, sh on Unix). Unix/macOS developers can set
# `script-shell` in ~/.npmrc if they need bash for all npm scripts.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# WDS BT

## Version: 1.4.5
## Version: 1.4.6

[![WebDevStudios. Your Success is Our Mission.](https://webdevstudios.com/wp-content/uploads/2024/02/wds-banner.png)](https://webdevstudios.com/contact/)

### What's New in 1.4.0
### What's New in 1.4.6

- **Block Showcase**: Powerful development tool (admin-only) to discover, preview, and inspect all registered blocks with their attributes in an organized, interactive format.
- **Template-specific style loading**: Template and CPT CSS are built separately and enqueued only when the current request matches (404, search, archive, page templates, custom post types). Styles in `build/css/templates/` are discovered automatically—no PHP config needed. Reduces unused CSS for better Lighthouse scores.
Expand Down Expand Up @@ -53,7 +53,7 @@ WDS BT is a foundational WordPress block theme designed for maximum flexibility
| Responsive Design | Ensures optimal display and functionality across devices. |
| Foundation Theme | Flexible base theme optimized for extensive customization. |
| Automated Code Quality | Modern linting configurations with PHP 8.3 compatibility, ESLint 9 flat config, WordPress coding standards, and automated quality checks. |
| DevContainer | [.devcontainer](.devcontainer) for **theme-only** workflow: PHP 8.2, Node 24, Composer. Usable by anyone (not just WDS); matches [wds-devcontainer](https://github.com/WebDevStudios/wds-devcontainer) when using the project template. |
| DevContainer | **Recommended:** [.devcontainer](.devcontainer) for theme development (PHP 8.2, Node 24, Composer). This is the standard environment for active development on this repo. Matches [wds-devcontainer](https://github.com/WebDevStudios/wds-devcontainer) when using the project template. |
| Third-party Block Style Overrides | Conditionally enqueue and override third-party block styles for efficient asset delivery. |
| Accessibility Compliance | Built-in WCAG 2.2 compliance with automated Pa11y checks. |
| Enhanced Webpack Configuration | Refined Webpack setup for improved dependency resolution and optimized asset management. |
Expand All @@ -70,19 +70,19 @@ WDS BT is a foundational WordPress block theme designed for maximum flexibility
## Requirements

- WordPress 6.4+ (tested upto 6.9.1)
- PHP 8.2+ (fully tested with PHP 8.4)
- [NPM](https://npmjs.com) (v11+)
- [Node](https://nodejs.org) (v25+)
- [Composer 2+](https://getcomposer.org/)
- **Development:** use the **[dev container](.devcontainer)** (supported path for PHP, Node, Composer, and linting). It ships PHP 8.2 and Node 24 aligned with this theme.
- PHP 8.2+ and [Composer 2+](https://getcomposer.org/) when running outside the container (CI, deployment, or contributor preference)
- [NPM](https://npmjs.com) (v11+) and [Node](https://nodejs.org) (v24+ per `package.json` engines) for build scripts
- License: [GPLv3](https://www.gnu.org/licenses/gpl-3.0.html)

## Getting Started

1. Clone this repository to your WordPress theme directory (`wp-content/themes/`).
2. Activate WDS BT from your WordPress admin panel under Appearance > Themes.
3. Run `npm run setup` to install dependencies and perform an initial build.
1. Clone this repository into your WordPress theme directory (`wp-content/themes/`), or symlink it there.
2. **Open in the dev container:** In Cursor or VS Code, choose **Reopen in Container** so PHP, Node, and Composer match the project (see [.devcontainer/README.md](.devcontainer/README.md)).
3. From the theme root, run `npm run build` (after `postCreateCommand`’s `npm ci && composer install`). Use `npm run setup` when you need a full reset and install from scratch.
4. Activate WDS BT from your WordPress admin under **Appearance → Themes**.

**Theme-only dev (no local PHP/Node):** Open this repo in Cursor or VS Code and choose **Reopen in Container**. The [.devcontainer](.devcontainer) provides PHP 8.2 and Node 24 so you can run `npm run setup` and build without installing tooling locally—works for everyone, not only WDS projects.
Contributors should use the dev container for day-to-day work so PHPCS, ESLint, and builds share one environment. PHP coding standards run through Composer (`composer run-script phpcs`) and invoke **`vendor/bin/phpcs`** directly.

## Documentation

Expand Down Expand Up @@ -129,15 +129,15 @@ Register block styles in `inc/hooks/register-block-styles.php`. Override core bl

## Linting & Lefthook

PHP (PHPCS), JavaScript (ESLint), and CSS/SCSS (Stylelint) use the latest WordPress standards; warnings are treated as failures. On commit, Lefthook runs auto-fix, re-stages changed files, then runs strict lint. Do not use `--no-verify`; CI runs the same checks. Full config and policy: **[docs/linting-and-hooks.md](docs/linting-and-hooks.md)**.
PHP (PHPCS), JavaScript (ESLint), and CSS/SCSS (Stylelint) use the latest WordPress standards; warnings are treated as failures. Composer scripts invoke **`vendor/bin/phpcs`** and **`vendor/bin/phpcbf`** (see `composer.json`). On commit, Lefthook runs auto-fix, re-stages changed files, then runs strict lint. Do not use `--no-verify`; CI runs the same checks. Full config and policy: **[docs/linting-and-hooks.md](docs/linting-and-hooks.md)**.

## Dynamic Block Pattern Categories

Block pattern categories are registered from subfolders of `patterns/`. Add a folder (e.g. `patterns/cards/`), put pattern PHP files in it, and set each file’s `Categories` header to the folder name (e.g. `Categories: cards`). No extra code is required.

## Accessibility & Quality

Run `npm run a11y` for Pa11y-based accessibility checks and `npm run lighthouse` for performance and SEO scores. CI runs security and code-quality checks. Cross-platform notes (rimraf, PHP detection) are in **[docs/accessibility-and-quality.md](docs/accessibility-and-quality.md)**.
Run `npm run a11y` for Pa11y-based accessibility checks and `npm run lighthouse` for performance and SEO scores. CI runs security and code-quality checks. Additional tooling notes are in **[docs/accessibility-and-quality.md](docs/accessibility-and-quality.md)**.

## Contributing and Support

Expand Down
2 changes: 2 additions & 0 deletions assets/scss/base/forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ textarea {
}

select {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
outline: 0;
background: url(../images/icons/icon-arrow-down.svg) no-repeat right 0.8em
Expand Down
Loading
Loading