documentation/components/source/inspection.css

1/* Inspection follows real composition boxes. It contributes no layout size. */
2.rendered {
3  position: relative;
4  /* Probe copies elsewhere cannot capture these path-derived anchor names. */
5  anchor-scope: all;
6}
7.rendered[data-structure="true"] :is(.node, .leaf) {
8  background-color: var(--inspection-fill);
9}
10.rendered :is(.node, .leaf)[data-inspected="true"] {
11  outline: 1.5px solid var(--ink);
12  outline-offset: -1.5px;
13}
14/* Each band is attached to the selected parent's real children. Both axes
15   are expressed; overlapping anchors on the other axis produce an empty band.
16   No measured rectangles or copied gap lengths participate in this decoration. */
17.rendered .node:focus-visible {
18  outline: 2px solid var(--ink);
19  outline-offset: 3px;
20}
21.rendered .node[data-inspected="true"] {
22  position: relative;
23}
24.inspection-gap {
25  position: absolute;
26  pointer-events: none;
27  background: repeating-linear-gradient(
28    135deg,
29    transparent 0 3px,
30    color-mix(in srgb, var(--ink) 35%, transparent) 3px 3.5px,
31    transparent 3.5px 4px
32  );
33}
34.inspection-gap[data-axis="block"] {
35  inset-inline: 0;
36  inset-block-start: anchor(var(--before) end);
37  inset-block-end: anchor(var(--after) start);
38}
39.inspection-gap[data-axis="inline"] {
40  inset-block: 0;
41  inset-inline-start: anchor(var(--before) end);
42  inset-inline-end: anchor(var(--after) start);
43}
44.rendered .run-preview {
45  position: absolute;
46  inset-block-start: anchor(var(--run-first) start);
47  inset-inline-start: anchor(var(--run-first) start);
48  inset-inline-end: anchor(var(--run-last) end);
49  inset-block-end: anchor(var(--run-last) end);
50  outline: 1px dashed var(--ink);
51  outline-offset: 2px;
52  pointer-events: none;
53}
54.rendered .run-preview[hidden] {
55  display: none;
56}
57@media (forced-colors: active) {
58  .rendered[data-structure="true"] :is(.node, .leaf) {
59    outline: 1px solid Highlight;
60    outline-offset: -1px;
61  }
62  .rendered :is(.node, .leaf)[data-inspected="true"] {
63    outline-width: 2px;
64  }
65  .rendered .node:focus-visible {
66    outline: 2px solid Highlight;
67    outline-offset: 3px;
68  }
69  .rendered :is(.node, .leaf)[data-inspected="true"],
70  .rendered .run-preview {
71    outline-color: Highlight;
72  }
73  .inspection-gap[data-axis="block"],
74  .inspection-gap[data-axis="inline"] {
75    forced-color-adjust: none;
76    background: repeating-linear-gradient(
77      135deg,
78      transparent 0 3px,
79      Highlight 3px 4px
80    );
81    opacity: 0.5;
82  }
83}
84
85/* Numeric captions observe the gap's axis, not the members' changing heights.
86   The inner target is deeper than this primitive's slot and requirement.
87   See inline-observation.ts for the shared observation contract. */
88.inspection-gap > span {
89  position: absolute;
90  inset: 0;
91}
92.inspection-gap [data-observation="gap"] {
93  display: block;
94}
95.inspection-gap[data-axis="inline"] [data-observation="gap"] {
96  inline-size: 100%;
97  block-size: 0;
98}
99.inspection-gap[data-axis="block"] [data-observation="gap"] {
100  inline-size: 0;
101  block-size: 100%;
102}