spatie / laravel-web-tinker

Tinker in your browser
https://spatie.be/open-source
MIT License
1.05k stars 68 forks source link

Idea: add a new option "auto" for dark theme #3

Closed filipac closed 5 years ago

filipac commented 5 years ago

I was tinkering (no pun intended) with the idea of a new option for dark theme called "auto" (so it will accept true/false and "auto").

    /*
     * If light hurts you eyes, set this to true.
     */
    'dark_theme' => 'auto',

All that it does is adding a new class to html element and then using media queries the interface of the package will changed based on user's OS preference. The media query is not yet supported by many browsers, but Safari already tested it in Safari Technology Preview and it will become standard.

image

Quick demo: image

What do you say, it is worth doing it? When the media query becomes a standard on all browser, this package would already support it.

freekmurze commented 5 years ago

@willemvb What do you think about this?

willemvb commented 5 years ago

Good idea, we do the same in our dashboard: https://github.com/spatie/dashboard.spatie.be/blob/master/resources/css/bootstrap.css#L41-L53

PR on it's way…