Dark Mode Detection in Profile Readme

The new GitHub dark mode is Great.

I have one question how can I detect the dark mode in the readme?

Thanks,
Pratik

Hey,
I think this Gist could help you :

LProgead.