agenticmorf/fluxui-theme
FluxUI theme and appearance settings for Laravel apps using Livewire Flux. Offers light/dark/system mode, accent and base color swatch pickers, and stores user preferences in an appearance_preferences JSON field on the User model.
Pros:
users table) while supporting app-wide defaults, aligning with modern SaaS/enterprise needs.<x-fluxui-theme::appearance />, <flux:accent>) integrate cleanly with Flux’s Volt/Blade hybrid architecture.--color-zinc-*) for dynamic theming, reducing custom CSS maintenance.fluxui-theme.php (routes, defaults, resolvers) and supports app-level overrides (e.g., appearance_resolver).Cons:
users table exists and is writable; may conflict with custom user models or multi-tenant setups.| Risk Area | Severity | Mitigation |
|---|---|---|
| CSS Variable Conflicts | High | Test with a staging environment; validate Flux CSS variables are correctly scoped. |
| Migration Conflicts | Medium | Review users table schema pre-integration; use --pretend flag for migrations. |
| Flux Version Lock | High | Pin livewire/flux to ^2.0 in composer.json to avoid breaking changes. |
| Performance Overhead | Low | JSON storage in users table is lightweight; inline CSS injection is minimal. |
| User Preference Sync | Medium | Implement a syncAppearance() method if preferences need real-time updates (e.g., WebSocket). |
| Dark Mode Quirks | Medium | Test @custom-variant dark in CSS across browsers; may need polyfills. |
Flux Adoption:
Customization Needs:
config('fluxui-theme.defaults.accent')) be tenant-aware (multi-tenant SaaS)?Performance:
appearance_preferences JSON could bloat the users table.Deployment:
appearance_preferences column need a separate migration if the package’s migration isn’t auto-loaded?--color-slate-* variables exist)?Supportability:
appearance_preferences in Redis)?Pre-Integration:
appearance_preferences column in users table if not using the package’s migration.Installation:
composer require agenticmorf/fluxui-theme
php artisan vendor:publish --tag=fluxui-theme-config
php artisan migrate
CSS Setup:
resources/css/app.css to import Flux CSS and define base colors:
@import '../../vendor/livewire/flux/dist/flux.css';
/* Ensure base colors (slate, gray, etc.) are defined */
:root {
--color-slate-50: #f8fafc;
/* ... other base colors ... */
}
@custom-variant dark for dark mode support.Blade Integration:
<x-fluxui-theme::appearance /> before @fluxAppearance.<flux:accent id="flux-accent"> and pass the user’s effective accent color.appearance.edit in the settings nav.User Model:
appearance_preferences cast:
protected $casts = ['appearance_preferences' => 'array'];
Configuration:
config/fluxui-theme.php for routes, defaults, or app-level resolvers.@import 'tailwindcss'). Pure CSS apps may need adjustments.| Phase | Tasks | Dependencies |
|---|---|---|
| Discovery | Evaluate Flux adoption, audit existing theming. | None |
| Setup | Install package, publish config, run migrations. | Laravel 11/12 + Flux 2+ |
| CSS Integration | Update app.css, define base colors, test dark mode. |
Flux CSS imported |
| Blade Integration | Modify layouts (head, body), add settings nav. |
CSS setup complete |
| User Model | Add appearance_preferences cast. |
Migration complete |
| Testing | Validate theme switching, dark mode, accent colors across browsers. | All prior phases |
| Deployment | Roll out to staging/production, monitor for CSS conflicts. | QA sign-off |
Pros:
Cons:
AppearanceService encapsulates theme resolution logic.How can I help you explore Laravel packages today?