Laravel-Backpack / theme-tabler

UI for Backpack v6 that uses Tabler and Bootstrap v5.
MIT License
26 stars 14 forks source link

Feature - System Color Mode #61

Closed promatik closed 1 year ago

promatik commented 1 year ago

This PR adds the ability to load the color theme automatically from the system preferences. It also allows to toggle between color modes.

Color modes and the default color mode can now be set on theme configs;

'colorModes' => [
    'system' => 'la-desktop',
    'light' => 'la-sun',
    'dark' => 'la-moon',
],

'defaultColorMode' => 'system',

Preview; (barryvdh debugbar is there for reference of the system color scheme mode)

https://github.com/Laravel-Backpack/theme-tabler/assets/1838187/d127f60d-e1ca-45f8-b098-c9633ae8674c

Also, switch_theme.blade is now used everywhere, fixing the inconsistency between using <a> and <button>, the blade is more dynamic now, allowing it to be used everywhere.