For those who like to implement both light and dark themes and want to do that in the most optimized way I have good news for you Google Recently implemented in Chrome > 93 the ability to get the user preference using server-side technologies.

Why is that important? Because just in case you didn’t hear the term FART by now it stands for “Flash of inAccurate coloR Theme”, the main issue is that if you don’t know the user preference before sending a response to a request, you can optimally set the user preferred theme.

Why not optimally? Because you either use javaScript and block the main thread to not display an inaccurate color or you determine the theme in an async way and the inaccurate color might show if the user preference is different from the default theme. View full article