Skip to content

Commit

Permalink
update themer utility
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdelrhmanSaid committed Aug 21, 2024
1 parent d3eb573 commit 3cad67f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions docs/utilities/themer.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,16 @@ Themer is a utility that allows users to switch between light and dark themes. I

## Usage

By default, themer is included in the `resources/layouts/scaffold.blade.php` file. You can include it in your layout file by adding the following line:
You can include themer in your layout file by adding the following line:

```blade
<script src="{{ hashed_asset('assets/js/themer.js') }}"></script>
@themer()
```

By default, themer script will look for the `themerKey` key in the window object to store the theme in local storage. You can change the key by setting the `themerKey` variable before including the script.
By default, themer script will look for the `themerKey` key in the window object to store the theme in local storage. You can change the key by passing the `themerKey` to the `@themer` directive.

```blade
<script>
window.themerKey = 'new-key';
</script>
@themer('key')
```

Currently, dashboard layout uses the `dashboard-theme` key to store the theme in local storage, while the website layout uses the `website-theme` key.

0 comments on commit 3cad67f

Please sign in to comment.