ismail bouaichi
ismail bouaichi

Reputation: 1

laravel filament implementing dark mode does not work

I turned it to true but it doesn't work also when i change another thing also doesn't work like:

'sidebar' => [
            'is_collapsible_on_desktop' => true,
            'groups' => [
                'are_collapsible' => true,
            ],
            'width' => null,
            'collapsed_width' => null,
        ],
    ],
header 1 header 2
cell 1 cell 2
cell 3 cell 4

Upvotes: 0

Views: 1206

Answers (2)

Ravi Misra
Ravi Misra

Reputation: 191

Very similar issue with Laravel 10x and Filament v3.

In Firefox, go to Inspector > Storage > Local Storage, then select URL of your site from the left panel. It will reveal the theme key.

Delete the "theme" key.

Reload the page in the browser, now the key will have "system" as the new value (in my case previously it was set to "dark").

Now you can switch between "dark" and "light" modes by clicking the respective button in Firefox Inspector.

Upvotes: 0

Bernhard Kraemer
Bernhard Kraemer

Reputation: 49

For anybody who is coming across this post when searching for a solution, why dark mode does not work in Filament v2:

In my case, the issue was that in the "localStorage" the value for "theme" was already set to "system". You can check by running the following in your browser's console:

localStorage.getItem('theme');

If that returns "system", you can resolve the issue by clearing the local storage:

  1. Open the Google Chrome Console by pressing F12 key.
  2. Select "Application" in the console's top menu.
  3. Select "Local Storage" in the console's left menu.
  4. Right-click your site and click "clear" to delete the local storage.

Upvotes: 0

Related Questions