Skip to content

The design language that makes your AI harness better at design.

JavaScript
4.8 KB
Raw Blame
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <title>Low contrast: verdicts the pixels could not read (browser-only)</title>
  <!--
    The element pass scores white copy against the grey fill under a dark
    photo it cannot read, and hands the verdict to the pixel pass. Where the
    pixels read the box they replace it: the copy passes on the photo. Where
    they refuse to read it (a backdrop filter over the photo), the element
    pass's ratio was taken against the fill the photo covers and measured
    nothing, so it is dropped (round 13 decision 2: only a measured failing
    ratio reports). Those two cases differ only in the filter. Outlined copy
    under the same filter keeps its own verdict: the element pass hands it
    over for its outline, not for the photo, and where the pixels give none
    it stands as advisory with its ratio (corpus decision
    r6-t5-unread-pixel-verdicts). Copy under a black wash its section's
    ::before paints is read through the wash: white on #eee under 0.42 black
    (about #8a8a8a) fails on both and stands as advisory; white on #ccc under
    0.5 black (about #666, where white passes) measured nothing and drops.
    The static engine reads no layers and scores every copy on its fill.
  -->
  <style>
    body { font-family: system-ui, sans-serif; margin: 0; color: #1a1a1a; background: #ffffff; }
    main { width: 1200px; margin: 0 auto; display: flex; gap: 48px; padding: 32px 0; }
    .col { width: 560px; }
    h1 { font-size: 28px; line-height: 36px; margin: 0 0 16px; }
    h2 { font-size: 20px; line-height: 28px; margin: 0 0 16px; }
    .case { margin: 0 0 32px; }
    .photo-band { position: relative; width: 560px; height: 160px; background-color: #979797; overflow: hidden; }
    /* A decorative photo the hit test sees through, as a hero image behind a
       product tour wash is. */
    .photo-band img { pointer-events: none; position: absolute; left: 0; top: 0; width: 560px; height: 160px; }
    .photo-band .copy { position: relative; padding: 56px 24px; }
    .photo-band .frosted { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
    .photo-band p { margin: 0; font: 600 20px/28px system-ui; color: #ffffff; }
    .photo-band .outlined { -webkit-text-stroke: 1px #000000; }
    /* A section under a black wash its ::before paints, read through: the
       copy is measured only where it fails on the ground and on every
       colour the wash makes there. */
    .washed { position: relative; width: 560px; height: 120px; }
    .washed::before { content: ""; position: absolute; left: 0; top: 0; width: 560px; height: 120px; }
    .washed .copy { position: relative; padding: 44px 24px; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
    .washed p { margin: 0; font: 600 18px/24px system-ui; color: #ffffff; }
    .washed.light { background: #eeeeee; }
    .washed.light::before { background-image: linear-gradient(rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.42)); }
    .washed.half { background: #cccccc; }
    .washed.half::before { background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)); }
  </style>
</head>
<body>
  <main>
    <div class="col">
      <h1>Should flag (advisory): the pixels could not read outlined copy</h1>
      <div class="case">
        <div class="photo-band">
          <img alt="" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAAD0lEQVR42mNQwAEYhpYEAGFPGAHY2OnFAAAAAElFTkSuQmCC">
          <div class="copy frosted"><p id="flag-outlined-copy-under-backdrop-filter" class="outlined">Reserve a seat at the bar</p></div>
        </div>
      </div>
      <div class="case">
        <div class="washed light"><div class="copy"><p id="flag-white-under-light-wash">White on grey under a light wash</p></div></div>
      </div>
    </div>
    <div class="col">
      <h1>Should pass: the pixels could not read it, and nothing measured it</h1>
      <div class="case">
        <div class="photo-band">
          <img alt="" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAAD0lEQVR42mNQwAEYhpYEAGFPGAHY2OnFAAAAAElFTkSuQmCC">
          <div class="copy frosted"><p id="pass-copy-under-backdrop-filter">Book a table for tonight</p></div>
        </div>
      </div>
      <div class="case">
        <div class="washed half"><div class="copy"><p id="pass-white-under-half-wash">White on grey under a half wash</p></div></div>
      </div>
      <h1>Should pass: the pixels read it</h1>
      <div class="case">
        <div class="photo-band">
          <img alt="" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAAD0lEQVR42mNQwAEYhpYEAGFPGAHY2OnFAAAAAElFTkSuQmCC">
          <div class="copy"><p id="pass-copy-on-read-photo">Order a delivery for later</p></div>
        </div>
      </div>
    </div>
  </main>
</body>
</html>