├── .gitignore ├── LICENSE ├── README.md ├── brads-boilerplate-block-plugin-tailwind ├── .gitignore ├── build │ ├── block.json │ ├── frontend.asset.php │ ├── frontend.js │ ├── frontend.js.map │ ├── index.asset.php │ ├── index.js │ ├── index.js.map │ ├── render.php │ ├── style-index-rtl.css │ ├── style-index.css │ ├── style-index.css.map │ └── style.css ├── index.php ├── package.json └── src │ ├── block.json │ ├── frontend.js │ ├── index.js │ ├── render.php │ └── style.css ├── brads-boilerplate-block-plugin ├── .gitignore ├── build │ ├── block.json │ ├── frontend-rtl.css │ ├── frontend.asset.php │ ├── frontend.css │ ├── frontend.js │ ├── index-rtl.css │ ├── index.asset.php │ ├── index.css │ ├── index.js │ └── render.php ├── index.php ├── package.json └── src │ ├── block.json │ ├── frontend.js │ ├── frontend.scss │ ├── index.js │ ├── index.scss │ └── render.php ├── brads-boilerplate-theme-tailwind ├── .gitignore ├── build │ ├── index.asset.php │ ├── index.css │ ├── index.js │ └── index.js.map ├── footer.php ├── functions.php ├── header.php ├── index.php ├── package.json ├── single.php ├── src │ ├── index.css │ ├── index.js │ └── scripts │ │ ├── ExampleReactComponent.js │ │ └── Person.js └── style.css ├── brads-boilerplate-theme ├── .gitignore ├── build │ ├── index-rtl.css │ ├── index.asset.php │ ├── index.css │ └── index.js ├── footer.php ├── functions.php ├── header.php ├── index.php ├── package.json ├── src │ ├── index.js │ ├── scripts │ │ ├── ExampleReactComponent.js │ │ └── Person.js │ └── styles │ │ ├── example-react-component.scss │ │ ├── main.scss │ │ ├── mixins.scss │ │ └── variables.scss └── style.css ├── brads-fse-hybrid-theme ├── .gitignore ├── build │ ├── archive │ │ ├── block.json │ │ ├── index.asset.php │ │ ├── index.js │ │ ├── index.js.map │ │ └── render.php │ ├── banner │ │ ├── block.json │ │ ├── index.asset.php │ │ ├── index.js │ │ ├── index.js.map │ │ └── render.php │ ├── blogindex │ │ ├── block.json │ │ ├── index.asset.php │ │ ├── index.js │ │ ├── index.js.map │ │ └── render.php │ ├── container │ │ ├── block.json │ │ ├── index.asset.php │ │ ├── index.js │ │ ├── index.js.map │ │ └── render.php │ ├── eventsandblogs │ │ ├── block.json │ │ ├── index.asset.php │ │ ├── index.js │ │ ├── index.js.map │ │ └── render.php │ ├── footer │ │ ├── block.json │ │ ├── index.asset.php │ │ ├── index.js │ │ ├── index.js.map │ │ └── render.php │ ├── genericbutton │ │ ├── block.json │ │ ├── index.asset.php │ │ ├── index.js │ │ └── index.js.map │ ├── genericheading │ │ ├── block.json │ │ ├── index.asset.php │ │ ├── index.js │ │ └── index.js.map │ ├── header │ │ ├── block.json │ │ ├── index.asset.php │ │ ├── index.js │ │ ├── index.js.map │ │ └── render.php │ ├── index-rtl.css │ ├── index.asset.php │ ├── index.css │ ├── index.css.map │ ├── index.js │ ├── index.js.map │ ├── interactivity-quiz │ │ ├── block.json │ │ ├── index-rtl.css │ │ ├── index.asset.php │ │ ├── index.css │ │ ├── index.css.map │ │ ├── index.js │ │ ├── index.js.map │ │ ├── render.php │ │ ├── style-index-rtl.css │ │ ├── style-index.css │ │ ├── style-index.css.map │ │ ├── view.asset.php │ │ ├── view.js │ │ └── view.js.map │ ├── page │ │ ├── block.json │ │ ├── index.asset.php │ │ ├── index.js │ │ ├── index.js.map │ │ └── render.php │ ├── search │ │ ├── block.json │ │ ├── index.asset.php │ │ ├── index.js │ │ ├── index.js.map │ │ └── render.php │ ├── searchresults │ │ ├── block.json │ │ ├── index.asset.php │ │ ├── index.js │ │ ├── index.js.map │ │ └── render.php │ ├── singlepost │ │ ├── block.json │ │ ├── index.asset.php │ │ ├── index.js │ │ ├── index.js.map │ │ └── render.php │ ├── slide │ │ ├── block.json │ │ ├── index.asset.php │ │ ├── index.js │ │ ├── index.js.map │ │ └── render.php │ ├── slideshow │ │ ├── block.json │ │ ├── index.asset.php │ │ ├── index.js │ │ ├── index.js.map │ │ └── render.php │ ├── solved-counter │ │ ├── block.json │ │ ├── index-rtl.css │ │ ├── index.asset.php │ │ ├── index.css │ │ ├── index.css.map │ │ ├── index.js │ │ ├── index.js.map │ │ ├── render.php │ │ ├── style-index-rtl.css │ │ ├── style-index.css │ │ ├── style-index.css.map │ │ ├── view.asset.php │ │ ├── view.js │ │ └── view.js.map │ ├── style-index-rtl.css │ ├── style-index.css │ └── style-index.css.map ├── css │ ├── base │ │ ├── baseline.scss │ │ ├── utility-classes.scss │ │ └── variables.scss │ ├── modules │ │ ├── btn.scss │ │ ├── event-summary.scss │ │ ├── full-width-split.scss │ │ ├── generic-content.scss │ │ ├── headline.scss │ │ ├── hero-slider.scss │ │ ├── link-list.scss │ │ ├── login.scss │ │ ├── main-navigation.scss │ │ ├── metabox.scss │ │ ├── my-notes.scss │ │ ├── page-banner.scss │ │ ├── page-links.scss │ │ ├── post-item.scss │ │ ├── professor-card.scss │ │ ├── search-overlay.scss │ │ ├── shame.scss │ │ ├── site-footer.scss │ │ └── site-header.scss │ └── style.scss ├── functions.php ├── images │ ├── apples.jpg │ ├── barksalot.jpg │ ├── bread.jpg │ ├── bus.jpg │ ├── library-hero.jpg │ ├── meowsalot.jpg │ └── ocean.jpg ├── inc │ ├── ourColors.js │ └── search-route.php ├── index.php ├── package.json ├── screenshot.png ├── searchform.php ├── src │ ├── archive │ │ ├── block.json │ │ ├── edit.js │ │ ├── index.js │ │ └── render.php │ ├── banner │ │ ├── block.json │ │ ├── edit.js │ │ ├── index.js │ │ └── render.php │ ├── blogindex │ │ ├── block.json │ │ ├── edit.js │ │ ├── index.js │ │ └── render.php │ ├── container │ │ ├── block.json │ │ ├── edit.js │ │ ├── index.js │ │ └── render.php │ ├── eventsandblogs │ │ ├── block.json │ │ ├── edit.js │ │ ├── index.js │ │ └── render.php │ ├── footer │ │ ├── block.json │ │ ├── edit.js │ │ ├── index.js │ │ └── render.php │ ├── genericbutton │ │ ├── block.json │ │ ├── edit.js │ │ └── index.js │ ├── genericheading │ │ ├── block.json │ │ ├── edit.js │ │ └── index.js │ ├── header │ │ ├── block.json │ │ ├── edit.js │ │ ├── index.js │ │ └── render.php │ ├── index.js │ ├── interactivity-quiz │ │ ├── README.md │ │ ├── block.json │ │ ├── edit.js │ │ ├── editor.scss │ │ ├── index.js │ │ ├── render.php │ │ ├── style.scss │ │ └── view.js │ ├── modules │ │ ├── HeroSlider.js │ │ ├── MobileMenu.js │ │ └── Search.js │ ├── page │ │ ├── block.json │ │ ├── edit.js │ │ ├── index.js │ │ └── render.php │ ├── search │ │ ├── block.json │ │ ├── edit.js │ │ ├── index.js │ │ └── render.php │ ├── searchresults │ │ ├── block.json │ │ ├── edit.js │ │ ├── index.js │ │ └── render.php │ ├── singlepost │ │ ├── block.json │ │ ├── edit.js │ │ ├── index.js │ │ └── render.php │ ├── slide │ │ ├── block.json │ │ ├── edit.js │ │ ├── index.js │ │ └── render.php │ ├── slideshow │ │ ├── block.json │ │ ├── edit.js │ │ ├── index.js │ │ └── render.php │ └── solved-counter │ │ ├── README.md │ │ ├── block.json │ │ ├── edit.js │ │ ├── editor.scss │ │ ├── index.js │ │ ├── render.php │ │ ├── style.scss │ │ └── view.js ├── style.css ├── template-parts │ ├── content-campus.php │ ├── content-event.php │ ├── content-page.php │ ├── content-post.php │ ├── content-professor.php │ └── content-program.php ├── templates │ ├── archive.html │ ├── emptycanvas.html │ ├── front-page.html │ ├── index.html │ ├── page-search.html │ ├── page.html │ ├── search.html │ └── single.html └── theme.json ├── classic-plugin-custom-menu ├── custom.svg ├── index.php └── styles.css ├── classic-plugin-settings-menu ├── languages │ ├── wcpdomain-es_MX.mo │ ├── wcpdomain-es_MX.po │ └── wcpdomain.pot └── our-first-unique-plugin.php ├── interactivity-block-tailwind ├── .gitignore ├── build │ ├── block.json │ ├── index.asset.php │ ├── index.js │ ├── index.js.map │ ├── render.php │ ├── style-index-rtl.css │ ├── style-index.css │ ├── style-index.css.map │ ├── style.css │ ├── view.asset.php │ ├── view.js │ └── view.js.map ├── interactivity-block.php ├── package.json └── src │ ├── block.json │ ├── edit.js │ ├── index.js │ ├── render.php │ ├── style.css │ └── view.js └── interactivity-block ├── .gitignore ├── build ├── block.json ├── index-rtl.css ├── index.asset.php ├── index.css ├── index.css.map ├── index.js ├── index.js.map ├── render.php ├── style-index-rtl.css ├── style-index.css ├── style-index.css.map ├── view.asset.php ├── view.js └── view.js.map ├── interactivity-block.php ├── package.json └── src ├── block.json ├── edit.js ├── editor.scss ├── index.js ├── render.php ├── style.scss └── view.js /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Brad Schiff 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Brad’s Boilerplate 2 | 3 | This repo contains different theme and plugin boilerplate folders. Here's a quick summary of what makes each one unique. 4 | 5 | ## Themes 6 | 7 | **brads-boilerplate-theme:** This is a traditional / classic (not block theme) that uses SCSS and WordPress's copy of React for public-front end JS instead of the modern Interactivity API. 8 | 9 | **brads-boilerplate-theme-tailwind:** The same as above; only it uses Tailwind CSS instead of SCSS. 10 | 11 | **brads-fse-hybrid-theme:** This is a block or Full Site Editing (FSE) theme. However, instead of using default/core WP blocks; it uses blocks that we've created as a developer. It uses PHP for (most of) the output so the blocks are dynamic. Instead of having a separate plugin for each block you need to create this theme let's you create as many of your own blocks all within one single convenient theme. 12 | 13 | ## Block Plugins 14 | 15 | **interactivity-block:** This uses the new Interactivity API in WordPress. However, the official WP example doesn't show how to work with attributes or anything useful that you'd actually spend the next hour or two trying to figure out how to do. This block showcases the basics that I feel most devs will be looking to learn about. 16 | 17 | **interactivity-block-tailwind:** The same as above; only it uses Tailwind CSS instead of SCSS. 18 | 19 | **brads-boilerplate-block-plugin:** A block but it does **not** use the Interactivity API: it uses WordPress's copy of React for public visitor JS behavior. 20 | 21 | **brads-boilerplate-block-plugin-tailwind:** The same above; only it uses Tailwind CSS instead of SCSS. 22 | 23 | # Instructions 24 | 25 | After placing one of the folders in your WordPress **themes** or **plugins** folders, you then: 26 | 27 | 1. Point your terminal towards the new example folder. 28 | 1. Run `npm install` 29 | 1. Run `npm run start` and the package will now be watching for any saved changes to your JS or SCSS files. 30 | 1. Please note; for the **brads-fse-hybrid-theme** folder in particular; you'll need to run `npm run start` in one terminal and then open a 2nd terminal and run `npm run blocks` - go ahead and leave both running. The "start" task processes your global CSS and JS while the "blocks" task processes all of your block sub-folders. The two run in perfect harmony. I've tried to use NPM packages to automatically run both tasks at the same time, but I've found that short of having two phsyically separate terminal tabs they don't play together nicely. 31 | 32 | Alternatively, you can run `npm run preview` and that will **both** start the watch task **and** start a proxy server running on `localhost:3000` that will automatically refresh the browser anytime you save a change. In order for this feature to work you will need to change the domain in `package.json` on **line #8**. In my file it mentions `myexample.local` but obviously you will have a different local dev domain that you want to proxy. 33 | 34 | Enjoy! 35 | -------------------------------------------------------------------------------- /brads-boilerplate-block-plugin-tailwind/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ -------------------------------------------------------------------------------- /brads-boilerplate-block-plugin-tailwind/build/block.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schemas.wp.org/trunk/block.json", 3 | "apiVersion": 3, 4 | "name": "makeupnamespace/bradsblockreacttailwind", 5 | "version": "0.1.0", 6 | "title": "Brads Boilerplate Block Tailwind React", 7 | "category": "common", 8 | "icon": "welcome-learn-more", 9 | "attributes": { 10 | "skyColor": { 11 | "type": "string" 12 | }, 13 | "grassColor": { 14 | "type": "string" 15 | } 16 | }, 17 | "editorScript": "file:./index.js", 18 | "style": "file:./style-index.css", 19 | "render": "file:./render.php", 20 | "viewScript": "file:./frontend.js" 21 | } -------------------------------------------------------------------------------- /brads-boilerplate-block-plugin-tailwind/build/frontend.asset.php: -------------------------------------------------------------------------------- 1 | array('react', 'react-dom'), 'version' => '6dbab7cb80c8f4a3f2e7'); 2 | -------------------------------------------------------------------------------- /brads-boilerplate-block-plugin-tailwind/build/index.asset.php: -------------------------------------------------------------------------------- 1 | array('react', 'wp-block-editor', 'wp-blocks'), 'version' => 'c69f2abde0de5f26c65b'); 2 | -------------------------------------------------------------------------------- /brads-boilerplate-block-plugin-tailwind/build/render.php: -------------------------------------------------------------------------------- 1 |
21 | 27 | {showSkyColor && {props.skyColor}} 28 |
29 |30 | 36 | {showGrassColor && {props.grassColor}} 37 |
38 |21 | 22 | {showSkyColor && {props.skyColor}} 23 |
24 |25 | 26 | {showGrassColor && {props.grassColor}} 27 |
28 |