Dev Helpers
← Back

Choose colours from the system theme

Choose colours from the system theme with native CSS. The preview includes a small shared demo stylesheet.

Open this example in the interactive library

Source code

<style>
  .demo {
    background: #e0f2fe;
    color: #0c4a6e;
  }
  @media (prefers-color-scheme: dark) {
    .demo {
      background: #0c4a6e;
      color: #e0f2fe;
    }
  }
</style>
<div class="demo">Choose colours from the system theme</div>