Installation
composer global require joshcirre/tweakflux
composer require joshcirre/tweakflux --dev
node_modules and resources/css/app.css exist (or create them).Apply a Theme
tweakflux apply
bubblegum):
tweakflux apply bubblegum
resources/css/tweakflux-theme.css + auto-import to app.css.Verify
npm run dev). Changes apply instantly.bubblegum) without modifying vendor files.tweakflux apply bubblegum
Design → Code:
tweakflux list to browse presets.tweakflux apply {theme}).resources/css/tweakflux-theme.css (or override via --no-effects flag).Team Collaboration:
tweakflux-theme.css to version control.tweakflux create {name} to scaffold a custom theme JSON file (e.g., resources/themes/custom.json).Asset Pipeline:
app.css imports tweakflux-theme.css (auto-handled by the command).Dynamic Theming:
config() or a database.// app/Http/Middleware/ApplyTheme.php
public function handle(Request $request, Closure $next) {
$theme = config('app.theme');
if ($theme) {
Artisan::call('tweakflux:apply', ['theme' => $theme]);
}
return $next($request);
}
Scaffold a Theme:
tweakflux create my-brand
resources/themes/my-brand.json with a template.--flux-primary-500).Example Customization:
// resources/themes/my-brand.json
{
"extends": "default",
"colors": {
"primary": "#2563eb", // Override Flux blue
"neutral": "#f3f4f6" // Light gray background
}
}
Apply with:
tweakflux apply my-brand
tweakflux boost
resources/css/boost.css.app.css:
@import 'boost.css';
Missing app.css:
resources/css/app.css doesn’t exist, the command outputs the import statement manually.app.css and add:
@import 'tweakflux-theme.css';
Vite/HMR Not Reflecting Changes:
npm run dev).Theme Conflicts:
--flux-* variables may clash with TweakFlux.!important sparingly or scope custom styles (e.g., .my-class { --flux-primary-500: #ff0000 !important; }).Global vs. Per-Project:
Inspect Generated CSS:
resources/css/tweakflux-theme.css to verify variables.--flux-* properties are applied.Check Tailwind Config:
tailwind.config.js isn’t overriding Flux’s default variables:
// tailwind.config.js
module.exports = {
theme: {
extend: {
colors: {
// Avoid redefining Flux's --flux-* variables here
}
}
}
}
Custom Theme Variables:
--flux-* variables in tweakflux-theme.css:
:root {
--flux-custom-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
Post-Apply Hooks:
post-update-cmd in composer.json to run additional tasks after tweakflux apply:
{
"scripts": {
"post-update-cmd": [
"@php artisan tweakflux:apply bubblegum",
"@php artisan optimize:clear"
]
}
}
Dark Mode:
dark() variant.tweakflux apply bubblegum --no-effects to disable animations, then manually add dark-mode variables:
@media (prefers-color-scheme: dark) {
:root {
--flux-neutral-100: #1f2937;
}
}
A/B Testing:
// config/app.php
'theme' => env('APP_THEME', 'default'),
Performance:
tweakflux-theme.css for above-the-fold components.purge config.Flux Pro Features:
tweakflux boost with custom themes to align guidelines with your brand.How can I help you explore Laravel packages today?