A starter theme that facilitates a quick head start for developing new block-based themes along with a bunch of developer-friendly features.
.
βββ assets (Holds theme's assets)
β βββ src
β βββ js
β βββ css
βββ bin (Holds scripts)
βββ functions.php (PHP entry point)
βββ inc
β βββ classes (Holds all classes)
β β βββ class-elementary-theme.php (Instantiates all of the classes)
β βββ helpers (PHP Helpers)
β β βββ custom-functions.php
β βββ traits (PHP Traits)
β βββ trait-singleton.php
βββ index.php
βββ parts (Block Template Parts)
βββ patterns (Block Patterns)
β βββ *.html
βββ style.css
βββ templates (Block Templates)
β βββ *.html
βββ tests (Holds JS & PHP tests)
β βββ bootstrap.php
β βββ js
β βββ php
βββ theme.json
composer create-project rtcamp/elementary [folder_name]
This command is equivalent to cloning the repository and running composer install && npm install
Manually clone this repository using
git clone [URL to Git repo]
Having cloned this repository, install node packages and PHP dependencies using
composer install
In both the methods, you will be prompted with a theme setup wizard which will help you with the search-replace. That was all! You're good to go with building your block theme. β¨
Note: Refer to the .nvmrc
file to check the supported Node.js version for running this project. If your current Node.js version does not run the project successfully on localhost, please use Node Version Manager on your terminal to configure the right Node.js version.
Production
npm run build:prod
Watch changes
npm start
Linting & Formatting
Lint JS, CSS & PHP.
npm run lint:js
npm run lint:css
npm run lint:php #phpcs
Auto fix fixable linting errors for JS, CSS & PHP.
npm run lint:js:fix
npm run lint:css:fix
npm run lint:php:fix #phpcbf
Testing
Run all tests.
npm run test
Run JS tests.
npm run test:js
Watch JS tests.
npm run test:js:watch
Run PHP tests.
npm run test:php