{% extends "grid_base.html" %} {% block title %}Trending Report{% endblock %} {% block heading %}Trending report{% endblock %} {% block style %} @layer tokens { :root { /* layout */ /* fixed track sizes (none from content), so every row's own grid gets the same columns */ --num-w: 5ch; --name-w: clamp(36ch, 30vw, 60ch); --req-w: 8ch; --run-w: 9ch; --notes-w: clamp(24ch, 22vw, 44ch); --head-h: 3.2em; } } /* ---- the grid: one column template, every row a grid of it ---- Rows are not a subgrid of one big grid: sizing one grid of every cell takes seconds on thousands of tests, and content-visibility (layout containment) turns subgrid off. With fixed track sizes, separate row grids line up and offscreen classes are skipped. */ @layer layout { .scroller { overflow: auto; max-block-size: calc(100vh - 110px); border: 1px solid var(--line); } .report { inline-size: max-content; --cols: [num] var(--num-w) [name] var(--name-w) [req] var(--req-w) repeat(var(--runs), [run] var(--run-w)); &.detailed { --cols: [num] var(--num-w) [name] var(--name-w) [req] var(--req-w) repeat(var(--runs), [run] var(--run-w) [notes] var(--notes-w)); } } :where(.summary, .header, .class-head, .row) { display: grid; grid-template-columns: var(--cols); } /* a class = its header row + its tests; offscreen classes skip layout and paint */ .class { content-visibility: auto; contain-intrinsic-size: auto 30em; } /* summary: 7 label rows shared by the label column and every run's totals */ .summary { grid-template-rows: repeat(7, auto); & > * { grid-row: 1 / -1; } & > .totals { display: grid; grid-template-rows: subgrid; } } .header { position: sticky; inset-block-start: 0; z-index: 3; min-block-size: var(--head-h); } .class-head { position: sticky; inset-block-start: var(--head-h); z-index: 2; } /* the # and name columns stay while scrolling sideways */ :is(.header, .row) > :nth-child(-n + 2), .class-head > .name { position: sticky; inset-inline-start: 0; z-index: 1; } :is(.header, .row) > :nth-child(2) { inset-inline-start: var(--num-w); } /* the class name also takes the Required column */ .class-head > .name { grid-column: num / run; overflow-wrap: anywhere; } } @layer cells { [role="cell"], [role="columnheader"] { border-inline-end: 1px solid var(--line); border-block-end: 1px solid var(--line); padding: 2px 4px; background: var(--cell-bg, var(--bg)); min-inline-size: 0; } .header > * { --cell-bg: var(--head); color: #fff; display: grid; place-items: center; text-align: center; font-size: 0.85em; } .summary > .title { display: grid; place-items: center; } .summary > .lead { grid-column: num / req; } .totals > div { font-size: 0.8em; text-align: center; padding: 1px 0; background: var(--cell-bg, var(--bg)); } .class-head > * { --cell-bg: color-mix(in oklab, var(--head) 12%, var(--bg)); font-weight: bold; } .class-head > .classtime { font-weight: normal; font-size: 0.8em; text-align: center; color: var(--muted); } .num { text-align: end; color: var(--muted); } .testname { display: grid; grid-template-areas: "test" "params"; overflow-wrap: anywhere; & .params { font-size: 0.8em; color: var(--muted); padding-inline-start: 1ch; } } .status { display: grid; place-content: center; text-align: center; font-size: 0.8em; color: #000; } .time { display: block; font-size: 0.9em; opacity: 0.8; } .time.slowest { font-weight: bold; opacity: 1; } :is(.ok, .pass) { --cell-bg: var(--pass); } .fail { --cell-bg: var(--fail); color: #fff; } .skip { --cell-bg: var(--skip); } .error { --cell-bg: var(--error); } .na { --cell-bg: var(--na); color: #fff; } .required { --cell-bg: var(--required); } .added { --cell-bg: var(--added); } .total { --cell-bg: var(--bg); } .tracemessage { font-size: 0.75em; color: light-dark(#550000, #f0a0a0); & summary { cursor: pointer; } & pre { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; } } /* hover: darken every cell of the row, whatever its status colour */ .row:hover > * { background: color-mix(in oklab, var(--cell-bg, var(--bg)) 82%, var(--fg)); } } @layer filters { form.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 8px; & input[type="search"] { inline-size: min(320px, 100%); } & .count { color: var(--muted); } } .row[hidden] { display: none; } /* no script needed to hide a class whose tests are all filtered out */ .class:not(:has(.row:not([hidden]))) { display: none; } /* nor to hide the times */ body:has(#filter-times:not(:checked)) .time { display: none; } } @layer print { @media print { .scroller { overflow: visible; max-block-size: none; border: 0; } .class { content-visibility: visible; } :is(.header, .class-head, .row > *) { position: static; } form.filters { display: none; } } } {% endblock %} {% block body %}