Skip to content

About

Pelican Panel plugins by makepeaceJ

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

pelican-plugins

A collection of Pelican Panel plugins by makepeaceJ. Assisted by Claude CLI. Tested in both docker and bare metal installs.

Plugin Description
theme-switcher Per-user theme selection with an admin-configurable global default.

theme-switcher

Theme Picker(Scrollable over a certain number of themes):

image

Global Default Theme (Default theme for users including the login screen):

image

Lets every panel user pick their own theme from a dropdown injected next to Filament's built-in light/dark switcher, and lets an admin set the global default theme that applies to users who haven't chosen one (including the login page). Currently confirmed working themes (If a theme doesn't work, submit an issue and I'll take a look): -StarryNight -Nord Theme -Neobrutalism -Fluffy

How it works

  • Theme discovery is automatic. ThemeDiscoveryService scans the panel's plugins/ directory and treats any enabled plugin whose plugin.json has "category": "theme" as a selectable theme. Install another theme plugin and it shows up in the picker — no config changes required. The switcher works on its own even with no other themes installed (you can still toggle "Default (Pelican)").
  • Colors, fonts and Vite themes are captured at runtime from each theme plugin's register() method via PanelColorCapture, so the switcher applies the exact styling a theme defines without duplicating it.
  • Inactive themes are suppressed in the browser (clearing their injected <link> CSS and hiding theme-specific DOM) so multiple installed themes don't bleed into each other.
  • Per-user preference is stored in a theme_preferences table; the global default is stored in the panel .env as PANEL_DEFAULT_THEME (written from the plugin's Settings form).

Static deactivation rules — for themes that inject CSS or DOM through their own render hooks — live in config/theme-manifests.php. Most themes so far need no entry there.

Configure

  • Global default theme: Admin → plugin Settings → Global Default Theme. Choose "None (Pelican default)" or any installed theme. This sets PANEL_DEFAULT_THEME in .env.
  • Per-user theme: any logged-in user clicks the theme icon next to the light/dark toggle and picks a theme; their choice is saved immediately.

Panel compatibility

Panel beta36 made getSettingsFormData() a required method on HasPluginSettings — it fills the settings modal in place of each field's ->default(). Version 1.0.1 implements it and keeps the ->default() call, so the same release works on beta35 and beta36+ alike.

If you are running a panel older than beta36, note that 1.0.1 is still safe to install: the extra method is simply never called.

Updating

plugin.json points update_url at update.json in this repo, so the panel's Update button picks up new releases on its own. Upgrading from 1.0.0 (which shipped with "update_url": null) needs that one line added to your installed plugins/theme-switcher/plugin.json once before the button appears.

License

MIT

About

Pelican Panel plugins by makepeaceJ

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages