|
| 1 | +<html> |
| 2 | +<head> |
| 3 | +<style> |
| 4 | + body { font: 10pt Tahoma; margin: 10px; } |
| 5 | + |
| 6 | + .card { |
| 7 | + border: 1px solid #767676; |
| 8 | + padding: 10px; |
| 9 | + margin-bottom: 12px; |
| 10 | + } |
| 11 | + |
| 12 | + h3 { margin: 0 0 6px 0; font-size: 12pt; } |
| 13 | + .note { color: #555555; font-size: 8pt; } |
| 14 | + |
| 15 | + /* --- prefers-color-scheme ------------------------------------------------- |
| 16 | + The light styling below is the baseline. On GDI+ and WPF the adapter reports |
| 17 | + the Windows app theme, so switching Windows to Dark and reloading should |
| 18 | + flip this card to the dark palette. PdfSharp always reports light. */ |
| 19 | + .scheme { |
| 20 | + background-color: #ffffff; |
| 21 | + color: #111111; |
| 22 | + border-color: #cccccc; |
| 23 | + } |
| 24 | + .scheme .verdict:after { content: "light"; } |
| 25 | + |
| 26 | + @media (prefers-color-scheme: dark) { |
| 27 | + .scheme { |
| 28 | + background-color: #1e1e1e; |
| 29 | + color: #f0f0f0; |
| 30 | + border-color: #555555; |
| 31 | + } |
| 32 | + .scheme .verdict:after { content: "dark"; } |
| 33 | + } |
| 34 | + |
| 35 | + /* --- media type ---------------------------------------------------------- |
| 36 | + The adapter also supplies the media type: "screen" for GDI+/WPF, "print" |
| 37 | + for PdfSharp. Exactly one of these two cards should be visible. */ |
| 38 | + .screen-only { display: none; } |
| 39 | + .print-only { display: none; } |
| 40 | + |
| 41 | + @media screen { |
| 42 | + .screen-only { display: block; background-color: #e8f4ff; } |
| 43 | + } |
| 44 | + |
| 45 | + @media print { |
| 46 | + .print-only { display: block; background-color: #f4f4f4; } |
| 47 | + } |
| 48 | + |
| 49 | + /* --- feature evaluation -------------------------------------------------- |
| 50 | + A feature the matcher cannot evaluate drops its whole block, so this card |
| 51 | + must never turn red. */ |
| 52 | + @media all and (scan: interlace) { |
| 53 | + .unsupported-feature { background-color: #ff0000; color: #ffffff; } |
| 54 | + } |
| 55 | + |
| 56 | + /* --- viewport width ------------------------------------------------------ |
| 57 | + Evaluated against the container's available width. */ |
| 58 | + .width-probe { background-color: #f0f0f0; } |
| 59 | + @media (min-width: 400px) { |
| 60 | + .width-probe { background-color: #e6ffe6; } |
| 61 | + .width-probe .verdict:after { content: "viewport is at least 400px wide"; } |
| 62 | + } |
| 63 | + @media (max-width: 399px) { |
| 64 | + .width-probe .verdict:after { content: "viewport is under 400px wide"; } |
| 65 | + } |
| 66 | +</style> |
| 67 | +</head> |
| 68 | +<body> |
| 69 | + |
| 70 | +<div class="card scheme"> |
| 71 | + <h3>prefers-color-scheme</h3> |
| 72 | + This card follows the platform colour scheme. Reported scheme: <b class="verdict"></b>. |
| 73 | + <div class="note">GDI+ and WPF read the Windows app theme; PdfSharp always reports light.</div> |
| 74 | +</div> |
| 75 | + |
| 76 | +<div class="card screen-only"> |
| 77 | + <h3>@media screen</h3> |
| 78 | + Visible because the adapter's media type is <b>screen</b>. |
| 79 | +</div> |
| 80 | + |
| 81 | +<div class="card print-only"> |
| 82 | + <h3>@media print</h3> |
| 83 | + Visible because the adapter's media type is <b>print</b>. |
| 84 | +</div> |
| 85 | + |
| 86 | +<div class="card unsupported-feature"> |
| 87 | + <h3>Unsupported media feature</h3> |
| 88 | + This card stays neutral. A media feature the matcher cannot evaluate drops its whole block |
| 89 | + rather than applying the rules inside it, so the red styling in |
| 90 | + <code>@media all and (scan: interlace)</code> must not win. |
| 91 | +</div> |
| 92 | + |
| 93 | +<div class="card width-probe"> |
| 94 | + <h3>Viewport width</h3> |
| 95 | + <span class="verdict"></span> |
| 96 | +</div> |
| 97 | + |
| 98 | +</body> |
| 99 | +</html> |
0 commit comments