Last active
January 4, 2026 13:01
-
-
Save tausiq2003/a98b369b084d87d4786426ac84009038 to your computer and use it in GitHub Desktop.
How to enable night mode in website if you don't have dark mode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Night light website</title> | |
| <style> | |
| body{ | |
| padding:0; | |
| margin:0; | |
| box-sizing:border-box; | |
| background-color: #1a1a1a; | |
| } | |
| iframe{ | |
| width: 100%; | |
| height: 100vh; | |
| border:none; | |
| filter: brightness(0.8) saturate(0.85) contrast(0.88); | |
| } | |
| body::after { | |
| content: ''; | |
| position: fixed; | |
| top: 0; | |
| left: 0; | |
| width: 100%; | |
| height: 100%; | |
| background-color: rgba(255, 147, 41, 0.15); | |
| pointer-events: none; | |
| z-index: 9999; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <!-- copy this gist and add your website below alter the filter above for good warmth, thanks--> | |
| <iframe src="https://www.learncpp.com/" id="sw" title="somewebsite" width="300" height="300"></iframe> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment