Notices Page Critera: Page information (For Display image)

frm

Well-known member
Now that 2.3 has style variations, there should be a new Notice Page Critera > Page information setting for setting the notice on light or dark in addition to the style.

Essentially, you would have to create 2 notices, one for dark and one for light. Though, this could increase queries (?).
1730729236773.webp

You can see how this is problematic if you have an icon set designed for dark mode on light mode.
1730729510947.webp

1730729563831.webp

So the alternate method, you could add an option for notice light and notice dark icons.

1730729756331.webp

This way notices with an icon would work seamlessly with default 3rd party styles out of the box without having to restyle the notice or make a custom notice to fit the style.
 
Upvote 2
Now that 2.3 has style variations, there should be a new Notice Page Critera > Page information setting for setting the notice on light or dark in addition to the style.
This would not work:
The criteria is evaluated on server side, if the user has set variation to System it is unknown on server side if the page will be displayed in Light or Dark.

Specifying two images (one for light and one for dark) would be the way to go.
 
This would not work:
The criteria is evaluated on server side, if the user has set variation to System it is unknown on server side if the page will be displayed in Light or Dark.

Specifying two images (one for light and one for dark) would be the way to go.
It might not work on the first toggle, but it should work on the next page view as the preference is saved in xf_user.

Edit: No, you're right. It wouldn't work for guests either unless it was saved in the cookie and if it wasn't saved then it would have to assure system which is unknown (even to xf_user).
 
The criteria is evaluated on server side, if the user has set variation to System it is unknown on server side if the page will be displayed in Light or Dark.
Wouldn't the header be able to determine it and serve the right one?
To request a user's system-wide light or dark mode preference from a server using an HTTP header, you should use the "Sec-CH-Prefers-Color-Scheme" header in your client request; this will send either "light" or "dark" depending on the user's operating system settings.
That is, if it's unset by a user which would override it with a cookie or xf_user preferences.
 
Back
Top Bottom