Dev Helpers
← Back

Keep native rendering in forced colours

Keep native rendering in forced colours with native CSS. The preview includes a small shared demo stylesheet.

Open this example in the interactive library

Source code

<style>
  @media (forced-colors: active) {
    .demo {
      forced-color-adjust: auto;
      border: 2px solid ButtonText;
    }
  }
</style>
<button class="demo" type="button">Try this button</button>