A theme supporting the block editor based on _s but with a tremendous number of changes 😃.
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 sheet
Clone or download this repository, change its name to something else, and then you'll need to do a six-step find and replace on the name in all the templates.
- Search for
'_mrw'
(inside single quotations) to capture the text domain and replace with:'theme-prefix'
. - Search for
"_mrw"
(double quotes) to capture phpcs ruleset and replace with"theme-previx"
- Search for
_mrw_
to capture all the functions names and replace with:theme_prefix_
. - Search for
_mrw
(with a space before it) to capture DocBlocks and replace with:Theme_Prefix
. {{< // >}} - Search for
_mrw-
to capture prefixed handles and replace with:theme-prefix-
. - Search for
_MRW_
(in uppercase) to capture constants and replace with:THEME_PREFIX_
.
This site uses a SASS build process in order to support SASS with autoprefixer.
Edit CSS files in /src/
See package.json
for details.
To install build from /wp-content/themes/{themename}/
$ npm install
To run build for development:
$ npm run watch
To build prefixed and minified CSS for release:
$ npm run build
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 buttonmenu.svg
for menu toggle button
- Lots of block-first development things including:
theme.json
- Maps SASS variables to
theme.json
custom properties sotheme.json
is the "source of truth" (Notable downside of this technique: cannot perform SASS calculations on custom properties.) - Block-specific SCSS partials
- Stylesheets for less-used blocks are enqueued per-block
- Uses Block Template Parts instead of widgets for the footer and sidebar
- PHP used to set a few default block variations
- Example of block style ready to go in
/inc/block-editor-config.php
- Uses template parts instead of most template tags
- Uses
clicky-menus
script for click-triggered dropdown navigation submenus - Custom toggle script for mobile menu and any other toggles you need
- Fixes search forms not having unique IDs if more than one is on the page
- Custom template tag to get SVGs (props @aurooba Inline SVG Helper function)
- Expects usage of MRW Simplified Editor, The Events Calendar, Gravity Forms (affiliate link), and PublishPress Authors
- Uses The Events Calendar Reset for better theme style inheritance
Autoformatting/linting:
.editorconfig
.stylelintrc.json
.eslintrc
.phpcs.xml.dist
prettier
configured inpackage.json
Make sure your editor supports .editorconfig
for some very basic coding standards autoformatting.
See /wp-content/mu-plugins/
non-theme related site changes. (not included in the Github repository)
Mark Root-Wiley https://MRWweb.com/contact