Dev Helpers
← Back

Make the thicker text visible on dark and light backgrounds

Make the thicker text visible on dark and light backgrounds with native CSS. The preview includes a small shared demo stylesheet.

Open this example in the interactive library

Source code

<style>
  .demo {
    color: #0f172a;
    background: #f1f5f9;
    font-weight: 700;
  }
  @media (prefers-color-scheme: dark) {
    .demo {
      color: #f8fafc;
      background: #0f172a;
    }
  }
</style>
<p class="demo">High-contrast status label</p>