• Login
    • Search
    • Categories
    • Recent
    • Tags
    • Users
    • Groups
    • Rules
    • Help

    Do more on the web, with a fast and secure browser!

    Download Opera browser with:

    • built-in ad blocker
    • battery saver
    • free VPN
    Download Opera

    Suggested Dark Mode <Code>

    Lounge
    2
    2
    1237
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • tennysongardi
      tennysongardi last edited by leocg

      So I think Opera GX needs better dark mode. Here's the code in HTML, CSS, JS!

      <!DOCTYPE html>
      <html>
      <head>
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <style>
      body {
        padding: 25px;
        background-color: #f2f2f2;
        color: #616161;
        font-size: 25px;
      }
      
      .dark-mode {
        background-color: #616161;
        color: #f2f2f2;
      }
      </style>
      </head>
      <body>
      
      <p>Dark Mode</p>
      <button onclick="myFunction()">Toggle dark mode</button>
      
      <script>
      function myFunction() {
         var element = document.body;
         element.classList.toggle("dark-mode");
      }
      </script>
      
      </body>
      </html>
      

      Hope u like it! Test the code at something like repl.it or w3schools.com

      Reply Quote 0
        areba21 1 Reply Last reply
      • areba21
        areba21 @tennysongardi last edited by

        @tennysongardi said in Suggested Dark Mode <Code>:

        So I think Opera GX needs better dark mode. Here's the code in HTML, CSS, JS!

        <!DOCTYPE html>
        <html>
        <head>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <style>
        body {
          padding: 25px;
          background-color: #f2f2f2;
          color: #616161;
          font-size: 25px;
        }
        
        .dark-mode {
          background-color: #616161;
          color: #f2f2f2;
        }
        </style>
        </head>
        <body>
        
        <p>Dark Mode</p>
        <button onclick="myFunction()">Toggle dark mode</button>
        
        <script>
        function myFunction() {
           var element = document.body;
           element.classList.toggle("dark-mode");
        }
        </script>
        
        </body>
        </html>
        

        Hope u like it! Test the code at something like repl.it or w3schools.com

        After uploading an image, my browser closed and updated itself(wtf?)

        I figured the update was rolled back (because I can't use the clipboard to upload a picture anymore), so please restore it.

        But the dark mode is still there; I'm not sure if that bug has been patched, but it seems to be working fine so far.

        Reply Quote 0
          1 Reply Last reply
        • Locked by  leocg leocg 
        • First post
          Last post

        Computer browsers

        • Opera for Windows
        • Opera for Mac
        • Opera for Linux
        • Opera beta version
        • Opera USB

        Mobile browsers

        • Opera for Android
        • Opera Mini
        • Opera Touch
        • Opera for basic phones

        • Add-ons
        • Opera account
        • Wallpapers
        • Opera Ads

        • Help & support
        • Opera blogs
        • Opera forums
        • Dev.Opera

        • Security
        • Privacy
        • Cookies Policy
        • EULA
        • Terms of Service

        • About Opera
        • Press info
        • Jobs
        • Investors
        • Become a partner
        • Contact us

        Follow Opera

        • Opera - Facebook
        • Opera - Twitter
        • Opera - YouTube
        • Opera - LinkedIn
        • Opera - Instagram

        © Opera Software 1995-