Skip to content

My customizations to the _s theme to make it better for a hybrid theme that embraces the block editor.

Notifications You must be signed in to change notification settings

mrwweb/hybrid-starter-theme

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

{Site Name} Theme

A theme supporting the block editor based on _s but with a tremendous number of changes 😃.

See Also

There are other README.md files in this theme in specific folders where explanations of rationale and structure are useful. e.g. src/scss/blocks/ describes when to make a partial for a block and when to compile it into the main stylesheet.

Quick Start

Clone or download this repository and it's submodules:

$ git clone --recursive https://github.com/mrwweb/hybrid-starter-theme.git <THEME_FOLDER_NAME>

Update theme details in style.css and set new 1200x900 screenshot.png.

Finally, do a six-step find and replace on the name in all the templates.

  1. Search for '_MRW\ (uppercase) to capture namespaces replace with: THEME_PREFIX_.
  2. Search for '_mrw' (inside single quotations) to capture the text domain and replace with: 'theme-prefix'.
  3. Search for "_mrw" (double quotes) to capture phpcs ruleset and replace with "theme-prefix"
  4. Search for _mrw_ (lowercase) to capture all the functions names and replace with: theme_prefix_.
  5. Search for _mrw (with a space before it) to capture DocBlocks and replace with: Theme_Prefix. {{< // >}}
  6. Search for _mrw- to capture prefixed handles and replace with: theme-prefix-.

Build Process

This site uses a SASS build process in order to support SASS with autoprefixer.

Edit CSS files in /src/scss/

See package.json for details.

To install build from /wp-content/themes/{themename}/

$ npm install
$ npm audit fix

To run build for development:

$ npm run sass:watch

To build prefixed and minified CSS for release:

$ npm run sass:build

To compile scripts that run in the Block Editor with entry point of /src/js/editor/index.js:

$ npm run wp-scripts

To concatenate and uglify JS files in /src/js/*.js:

$ npm run js:build

Expected Icons in assets/images/svg

  • logo.svg for logo
  • Right-pointing arrow.svg for dropdown menu item indicator
  • search.svg for search button icon
  • Right-pointing chevron.svg for paging links
  • close.svg for menu toggle button
  • menu.svg for menu toggle button

Notable Changes from _s Theme

Dev Environment

Autoformatting/linting:

  • .editorconfig
  • .stylelintrc.json
  • .eslintrc
  • .phpcs.xml.dist
  • prettier configured in package.json

Make sure your editor supports .editorconfig for some very basic coding standards autoformatting.

Other Notes

See /wp-content/mu-plugins/ non-theme related site changes. (not included in the Github repository)

Credit & Contact

Mark Root-Wiley, MRW Web Design https://MRWweb.com/contact

About

My customizations to the _s theme to make it better for a hybrid theme that embraces the block editor.

Topics

Resources

Stars

Watchers

Forks

Sponsor this project

 

Languages

  • PHP 50.2%
  • SCSS 44.5%
  • JavaScript 3.9%
  • Other 1.4%