The Lyquix theme uses a hybrid build pipeline combining Bun, Gulp, Sass, Tailwind CSS, and PostCSS.
From the child theme directory:
# Install dependencies and bootstrap child theme
nvm use 18
bun install
# Start development watchers
bun run watchDefined in the child theme's package.json:
| Script | Command | Purpose |
|---|---|---|
postinstall |
./postinstall.sh |
Runs automatically after bun install to copy dist files |
watch |
run-p watch:** |
Starts all watchers in parallel |
watch:lyquix |
bun build js/lyquix.ts ... |
Watches and compiles the Lyquix TypeScript library |
watch:scripts |
bun build js/scripts.ts ... |
Watches and compiles the Scripts TypeScript |
watch:gulp |
gulp |
Runs the Gulp default task (CSS compilation + JS minification + LiveReload) |
run-p is from the npm-run-all package and runs all matching scripts in parallel.
The CSS pipeline has several stages:
css/custom/custom.scss → css/custom.css
The entry point custom.scss imports all SCSS partials from the SMACSS-organized directories. Compiled using Dart Sass.
css/custom.css → css/styles.css
Tailwind scans all PHP, JS, and template files for utility classes, then processes the CSS through the frontend configuration (css/tailwind/config.js).
css/tailwind/editor.css → css/editor.css
A separate Tailwind pass generates editor-specific styles with Preflight disabled to avoid conflicts with the WordPress admin.
The build runs up to 5 additional Tailwind passes to resolve any theme() function calls that reference other theme values. This handles cases like:
.my-class {
color: theme('colors.primary');
}css/styles.css → css/styles.min.css (+ source map)
Uses cssnano for minification and autoprefixer for vendor prefixes. Source maps are generated for debugging.
Bun compiles TypeScript to browser-ready JavaScript:
js/lyquix.ts → js/lyquix.js (Lyquix library from parent theme)
js/scripts.ts → js/scripts.js (Custom scripts)
Both are compiled as IIFE (Immediately Invoked Function Expression) format targeting browsers.
js/lyquix.js → js/lyquix.min.js (+ source map)
js/scripts.js → js/scripts.min.js (+ source map)
js/vue.js → js/vue.min.js (+ source map, optional)
Terser strips comments and minifies. Source maps are generated.
The gulpfile.js defines these tasks:
| Task | Purpose |
|---|---|
compile-css |
Full SCSS + Tailwind + PostCSS pipeline |
lyquixjs |
Minify the Lyquix library |
scriptsjs |
Minify the Scripts library |
vuejs |
Minify Vue.js bundle (disabled by default) |
livereload |
Start LiveReload server and file watchers |
default |
Run all tasks in parallel |
The LiveReload task watches these paths for changes:
css/custom/**/*.scss- SCSS filesjs/lyquix.js- Compiled Lyquix libraryjs/scripts.js- Compiled Scriptspage-templates/*.php- Page templatesphp/**/*.php- All PHP filescustom.php- Main HTML templatetribe/**/*.php- Tribe Events templatestribe-events/**/*.php- Tribe Events templatescss/tailwind/whitelist.html- Tailwind class whitelist
When any of these files change, the compile-css task runs and triggers a browser refresh via LiveReload on port 35729.
The theme includes a standalone utility for generating critical path CSS:
bun critical.jsThis interactive script:
- Prompts for the website URL and optional HTTP credentials
- Saves the configuration to
critical.jsonfor reuse - Fetches the critical CSS configuration from
/wp-json/lyquix/v3/critical - Generates optimized above-the-fold CSS for each template type
- Outputs files to
css/critical/[template-type].css
Critical CSS is generated per post type, with optional per-page overrides for pages. See the Styling Guide for more on critical path CSS.
Key build dependencies (from package.json):
| Package | Version | Purpose |
|---|---|---|
tailwindcss |
^3.4.1 | CSS utility framework |
sass |
^1.72.0 | SCSS compilation |
typescript |
^5.4.2 | TypeScript support |
gulp |
^4.0.2 | Task runner |
gulp-livereload |
^4.0.2 | Browser auto-refresh |
gulp-postcss |
^10.0.0 | PostCSS integration |
cssnano |
^6.1.0 | CSS minification |
autoprefixer |
^10.4.18 | Vendor prefixes |
gulp-terser |
^2.1.0 | JS minification |
gulp-sourcemaps |
^3.0.0 | Source map generation |
rollup |
^4.13.0 | Module bundling |
vue |
^3.4.21 | Vue.js framework (optional) |
tailwind-layouts |
^0.3.0 | CSS layout primitives plugin |
@tailwindcss/container-queries |
^0.1.1 | Container query support |
@tailwindcss/aspect-ratio |
^0.4.2 | Aspect ratio utilities |
eslint |
^8.57.0 | JavaScript linting |
stylelint |
^16.2.1 | CSS/SCSS linting |
prettier |
^3.1.1 | Code formatting |
The build system and theme automatically detect local development environments:
- If
WPCONFIG_ENVNAMEis set tolocal, or - If the hostname ends in
.test
Then non-minified CSS and JS files are served automatically, regardless of the customizer setting.
The theme includes configurations for code quality:
- ESLint (
.eslintrc.json) - JavaScript/TypeScript linting - StyleLint (
.stylelintrc.json) - SCSS/CSS linting - Prettier with Tailwind plugin - Code formatting
- EditorConfig (
.editorconfig) - Editor consistency