creode-mosaic / theme
A theme installation and development framework.
Installs: 17
Dependents: 0
Suggesters: 1
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Type:wordpress-muplugin
pkg:composer/creode-mosaic/theme
Requires
Replaces
- dev-main
- 1.9.4
- 1.9.3
- 1.9.2
- 1.9.1
- 1.9.0
- 1.8.0
- 1.7.1
- 1.7.0
- 1.6.0
- 1.5.4
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.0
- 1.3.0
- 1.2.0
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.1
- 1.0.0
- dev-bug/15276345-performance_optimisations
- dev-feature/add-block-library-path-sass-alias
- dev-feature/pattern-registration
- dev-feature/correct_wordpress_core_font_size_bug
- dev-feature/stylesheet-dependencies
- dev-feature/add-block-style-modifier-library
- dev-feature/add-force-option-to-install-command
- dev-add_documentation
This package is auto-updated.
Last update: 2025-12-17 16:57:03 UTC
README
A WordPress theme installation and development framework by Creode.
Overview
Mosaic Theme is a WordPress MU plugin that provides a standardised framework for theme development. It handles asset compilation, provides reusable PHP and JavaScript libraries, and offers WP-CLI commands for theme scaffolding and building.
Installation
Composer (Recommended)
composer require creode-mosaic/theme
This will automatically install the plugin into your mu-plugins directory.
Features
WP-CLI Commands
The plugin provides two WP-CLI commands for theme management:
| Command | Description |
|---|---|
wp creode-theme:install |
Installs framework files into your active theme (or a specified theme) |
wp creode-theme:build |
Compiles assets (SCSS/JS) for all active themes |
Asset Compilation
The framework uses Vite for modern asset bundling with the following features:
- Automatic SCSS compilation
- JavaScript bundling and minification
- Manifest-based asset versioning
- Support for parent/child theme structures
- Automatic stylesheet enqueueing for frontend, admin, and editor
PHP Libraries
Custom Post Types
Extend the Base_Post_Type abstract class to register custom post types with a clean, consistent API:
class My_Post_Type extends \Creode_Theme\Base_Post_Type { protected function name(): string { return 'my-post-type'; } protected function label(): string { return 'My Posts'; } protected function singular_label(): string { return 'My Post'; } protected function public(): bool { return true; } } My_Post_Type::init();
Post Fields (ACF Integration)
Extend the Base_Post_Fields abstract class to register ACF field groups that attach to post types based on custom supports:
class Logo_Post_Fields extends \Creode_Theme\Base_Post_Fields { protected function group_name(): string { return 'logo'; } protected function group_title(): string { return 'Logo'; } protected function support(): string { return 'logo'; } protected function fields(): array { return array( array( 'key' => 'field_logo', 'name' => 'logo', 'label' => 'Logo', 'type' => 'image', ), ); } } Logo_Post_Fields::init();
JavaScript Libraries
Block Style Modifier
A utility class for managing WordPress block styles without dependency or timing issues:
const blockStyleModifier = new Block_Style_Modifier(); // Add a custom style to a block blockStyleModifier.addStyle('core/button', 'arrow', 'Arrow'); // Remove an existing style from a block blockStyleModifier.removeStyle('core/button', 'outline');
Theme Template
When running wp creode-theme:install, a basic theme structure is scaffolded within the active theme.
Requirements
- WordPress 6.0+
- PHP 8.0+
- Composer
- Node.js & npm (for asset compilation)
- ACF Pro
Documentation
Full documentation is available at theme-framework.creode.dev
License
Proprietary - Creode Limited