Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Sharim's avatar

Make Light and dark mode of website

I have two css stylesheets. One is for light mode and other one is for dark mode. How can I use it to apply on the website when the button is clicked. Moreover this setting for the same user should apply next time. I think this setting will store in session so different users will access different modes in the same time.

0 likes
3 replies
Sharim's avatar

@MichalOravec I did it, its working but session is storing multiple times according to the number of pages. And its not working on some pages.

redroseamit's avatar

you can use toggle switch type user interface ..you have to pass flag = 'x' or boolean in table for particular reference user . match it with session or reference user relationship and compare. if field value have flag it will appear accordingly else .

Please or to participate in this conversation.