Theme directory structure
All Blade templates live underresources/views/themes/adventra/:
resources/views/admin/.
Dynamic color generation
When you save colors in Admin → Settings → Basic Control, theBasicControlController writes a file called public/assets/themes/adventra/css/dynamic-colors.css. This file contains only CSS custom properties — no component styles — so a single save instantly re-themes every page.
The generated file looks like this:
If Alternatively, visit Admin → Settings → Basic Control and click Save — this triggers the same method automatically.
dynamic-colors.css is missing after first deployment, run this once from tinker to generate it:The tripfy.css file
public/assets/themes/adventra/css/tripfy.css is the main stylesheet for the Adventra theme. It provides the full light and dark theme system, component styles, and layout rules. It is loaded by app.blade.php alongside dynamic-colors.css.
Two other stylesheets complement it:
| File | Purpose |
|---|---|
dynamic-colors.css | CSS custom properties generated from admin colors |
tripfy.css | Full component and layout styles using those properties |
admin/css/tripfy-admin.css | Admin panel branding overrides |
Main layout (app.blade.php)
The public layout loads styles, sets the data-theme attribute, and prevents a flash of unstyled content:
Light/dark mode toggle
Thedata-theme attribute on <html> controls the active color scheme. It is set server-side from auth()->user()->theme_mode for logged-in users and from localStorage for guests.
The tripfy.js script runs before the DOM is ready and immediately calls applyMode() so the correct theme is in place before the first paint:
tf-theme-toggle or the attribute data-tf-theme-toggle is automatically wired to call toggleTheme() after the DOM loads.
For authenticated users, the current theme is also persisted server-side. See JavaScript for the route and fetch call that handles this.
Home page variations
The Adventra theme ships with three home page layouts you can choose from in Admin → Appearance:Quest
Card grid layout with a hero search bar. Focuses on adventure discovery.
Elite
Full-width slider hero with a popular destinations grid.
Voyage
Alternative layout optimized for showcasing long-haul packages.
app.blade.php layout, so they all inherit dynamic colors and the theme toggle automatically.
PWA configuration
Thepartials/pwa.blade.php partial renders an install prompt popup. The service worker at serviceworker.js (in the project root) handles caching and offline support. A separate firebase-messaging-sw.js handles background push notifications.
See JavaScript for service worker details.
Admin-controlled theming
Everything visual that the admin controls flows through theBasicControl model:
| Setting | Effect |
|---|---|
primary_color | Brand color — buttons, links, badges, sidebar active state |
secondary_color | Accent color — used in dark mode and secondary elements |
site_title | Sets <title> via the basicControl('site_title') helper |
dynamic-colors.css and calls php artisan optimize:clear automatically. The frontend reflects the new colors on the next page load with no deployment required.