offsetwp / starter-theme
The starter theme of an OffsetWP project: Twig templates rendered by the kernel of the project, and assets built by Vite and Tailwind CSS
Requires
- php: ^8.5
- ext-tokenizer: *
- offsetwp/framework: ^1.1
- offsetwp/hook-bundle: ^1.0
- offsetwp/twig-bundle: ^1.1
- offsetwp/twig-wordpress-extension: ^1.1
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-12-01 07:48:51 UTC
README
OffsetWP Starter Theme
The theme to start an OffsetWP project from.
- 🌿 Twig templates
- 🎨 Tailwind CSS
- ⚡️ Vite and TypeScript
Requirements
- Node 24
- Composer
Installation on offsetwp/project-skeleton
composer create-project offsetwp/starter-theme public/app/themes/<my-theme> # Change "<my-theme>" folder name and setup the theme with interaction nvm use && npm install npm run dev # builds on every change; npm run build to deploy
Installation standalone (theme only)
# In a classic WordPress, from its root: the theme installs on its own, and builds from its folder. composer create-project offsetwp/starter-theme wp-content/themes/<my-theme> # Change "<my-theme>" folder name and setup the theme with interaction cd wp-content/themes/<my-theme> nvm use && npm install npm run dev # activate from the dashboard, Appearance > Themes
Installation without interaction
The installer takes its answers as parameters: --root, --name, --author and --description.
Given all four, it asks nothing. On offsetwp/project-skeleton, from the root of the project:
composer create-project offsetwp/starter-theme public/app/themes/acme --no-scripts composer -d public/app/themes/acme run-script post-create-project-cmd -- \ --root="$PWD" --name='Acme' --author='Acme Agency' --description='The theme of Acme.' nvm use && npm install npm run build
--no-scripts fetches the theme without running its installer; run-script runs it, from the
folder of the theme (-d). --author= leaves the theme without an author.
Assets
npm run dev # builds on every change, for development npm run build # builds once, minified, for production
Add an asset
A stylesheet for every page: @import it in assets/src/css/app.css, nothing else.
A script or a stylesheet of its own, for some pages only — front-page.ts here:
-
Create it in
assets/src/:assets/src/ts/front-page.ts, which mayimport '../css/front-page.css'. A stylesheet alone works the same way. -
Declare it in
vite.config.js— at the root of the project, once installed on the skeleton:input: { app: resolve(theme, 'assets/src/ts/app.ts'), 'front-page': resolve(theme, 'assets/src/ts/front-page.ts'), },
-
Enqueue it in
app/Theme/Assets.php, inenqueue(), by its source:$this->entry( 'theme', 'assets/src/ts/app.ts' ); if ( is_front_page() ) { $this->entry( 'theme-front-page', 'assets/src/ts/front-page.ts' ); }
entry()enqueues its stylesheets, then its script, as a module.
Licence
MIT. See LICENSE. Inter is under the SIL Open Font License: see OFL.txt.

