Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dark mode support for html #464

Merged
merged 1 commit into from
Apr 8, 2024
Merged

Conversation

jaredsburrows
Copy link
Owner

@jaredsburrows jaredsburrows commented Apr 8, 2024

Closes #457

Validated by: https://validator.w3.org/nu/#textarea

Sample HTML
<!DOCTYPE html>
<html lang="en">
  <head><meta http-equiv="content-type" content="text/html; charset=utf-8">
    <!-- <style>body { font-family: sans-serif } pre { background-color: #eeeeee; padding: 1em; white-space: pre-wrap; word-break: break-word; display: inline-block }</style> -->
    <style>
      body {
        font-family: sans-serif;
        background-color: #ffffff; /* Light background */
        color: #000000; /* Dark text */
      }
      a {
        color: #0000EE; /* Default blue for links */
      }
      pre {
        background-color: #eeeeee; /* Lighter background for preformatted text */
        color: #000000; /* Dark text for readability */
      }
      

      @media (prefers-color-scheme: dark) {
        body {
          background-color: #121212; /* Dark background */
          color: #E0E0E0; /* Light text */
        }
        a {
          color: #BB86FC; /* Light purple for links */
        }
        pre {
          background-color: #333333; /* Darker background for preformatted text */
          color: #E0E0E0; /* Light text for readability */
        }
      }
    </style>
    <title>Open source licenses</title>
  </head>
  <body>
    <h3>Notice for packages:</h3>
    <ul>
      <li><a href="#1934118923">Accompanist Drawable Painter library (0.34.0)</a>
        <dl>
          <dt>Copyright &copy; 20xx Google</dt>
          <dd></dd>
        </dl>
      </li>
      <li><a href="#1934118923">Accompanist SwipeRefresh library (0.34.0)</a>
        <dl>
          <dt>Copyright &copy; 20xx Google</dt>
          <dd></dd>
        </dl>
      </li>
      <li><a href="#1934118923">Activity (1.8.2)</a>
        <dl>
          <dt>Copyright &copy; 2018 The Android Open Source Project</dt>
          <dd></dd>
        </dl>
      </li>
      <li><a href="#1934118923">Activity Compose (1.8.2)</a>
        <dl>
          <dt>Copyright &copy; 2020 The Android Open Source Project</dt>
          <dd></dd>
        </dl>
      </li>
      <li><a href="#1934118923">Activity Kotlin Extensions (1.8.2)</a>
        <dl>
          <dt>Copyright &copy; 2018 The Android Open Source Project</dt>
          <dd></dd>
        </dl>
      </li>
      <li><a href="#1934118923">Android App Startup Runtime (1.1.1)</a>
        <dl>
          <dt>Copyright &copy; 2020 The Android Open Source Project</dt>
          <dd></dd>
        </dl>
      </li>
      <li><a href="#1934118923">Android AppCompat Library (1.6.1)</a>
        <dl>
          <dt>Copyright &copy; 2011 The Android Open Source Project</dt>
          <dd></dd>
        </dl>
      </li>
      <li><a href="#1934118923">Android Arch-Common (2.2.0)</a>
        <dl>
          <dt>Copyright &copy; 2017 The Android Open Source Project</dt>
          <dd></dd>
        </dl>
      </li>
      <li><a href="#1934118923">Android Arch-Runtime (2.2.0)</a>
        <dl>
          <dt>Copyright &copy; 2017 The Android Open Source Project</dt>
          <dd></dd>
        </dl>
      </li>
      <li><a href="#1934118923">Android ConstraintLayout (2.0.1)</a>
        <dl>
          <dt>Copyright &copy; 2007 The Android Open Source Project</dt>
          <dd></dd>
        </dl>
      </li>
      <li><a href="#1934118923">Android ConstraintLayout Solver (2.0.1)</a>
        <dl>
          <dt>Copyright &copy; 2007 The Android Open Source Project</dt>
          <dd></dd>
        </dl>
      </li>
  </body>
</html>
Light Dark
Screenshot 2024-04-08 at 2 03 07 PM Screenshot 2024-04-08 at 2 03 18 PM

@jaredsburrows jaredsburrows merged commit d0893d1 into master Apr 8, 2024
5 checks passed
@jaredsburrows jaredsburrows deleted the pr/jaredsburrows/dark-mode branch April 8, 2024 19:48
@jaredsburrows jaredsburrows mentioned this pull request Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for dark mode
1 participant