Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect the prefers-color-scheme setting #1275

Merged
merged 3 commits into from
May 18, 2023

Conversation

ramonrietdijk
Copy link
Contributor

I've changed the layout file to include media attributes on the CSS files in order to respect the prefers-color-scheme-setting. The style of Horizon will therefore be determined by the preference of the user. Developers who prefer Horizon in light mode are not affected by the Horizon::night() method anymore.

Note that the night method has not been removed to prevent a breaking change.

@driesvints
Copy link
Member

I think this is a good step but maybe we should take it further and add a toggle like on the Laravel docs so people can choose either light, dark or system preferences?

@ramonrietdijk
Copy link
Contributor Author

Agreed, it would offer a lot more flexibility

@driesvints
Copy link
Member

Can you add a screenshot how this looks?

@ramonrietdijk
Copy link
Contributor Author

This is how it currently looks:
image

@driesvints
Copy link
Member

I'd personally remove the background but other than that lgtm. Thanks!

@taylorotwell taylorotwell merged commit 4f762b1 into laravel:5.x May 18, 2023
@taylorotwell
Copy link
Member

LGTM - thanks 👍

@ramonrietdijk ramonrietdijk deleted the feature/prefers-color-scheme branch May 18, 2023 14:40
@lloricode
Copy link
Contributor

lloricode commented May 27, 2023

Maybe adding @deprecated to a night() and $useDarkTheme will stop using this in future?

lloricode added a commit to lloricode/horizon that referenced this pull request May 27, 2023
taylorotwell pushed a commit that referenced this pull request May 29, 2023
* Mask as deprecated using `night()` and `$useDarkTheme`

This PR is for #1275

* Try to fix style
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants