cornfield 0.46.2 → 0.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/contrast.js +6 -6
- package/explorer/css/account.css +46 -0
- package/explorer/css/base.css +159 -0
- package/explorer/css/changes.css +160 -0
- package/explorer/css/decision.css +68 -0
- package/explorer/css/dialogs.css +50 -0
- package/explorer/css/header.css +75 -0
- package/explorer/css/layers.css +92 -0
- package/explorer/css/live.css +48 -0
- package/explorer/css/map.css +43 -0
- package/explorer/css/node-panel.css +188 -0
- package/explorer/css/page.css +83 -0
- package/explorer/css/proposal.css +151 -0
- package/explorer/css/search.css +84 -0
- package/explorer/css/sheets.css +134 -0
- package/explorer/css/whatif.css +55 -0
- package/explorer/css/work.css +288 -0
- package/explorer/engine/hint.js +1 -0
- package/explorer/engine/keyboard.js +2 -2
- package/explorer/engine/map-style.js +9 -4
- package/explorer/flow-build.js +88 -0
- package/explorer/flows.js +1 -81
- package/explorer/focus-room.js +1 -1
- package/explorer/header-fit.js +3 -3
- package/explorer/house.css +1 -1
- package/explorer/index.html +20 -10
- package/explorer/input.js +8 -1
- package/explorer/page-pieces.js +5 -0
- package/explorer/page.js +11 -20
- package/explorer/pieces/adopt-tokens.js +38 -0
- package/explorer/pieces/map-stage.css +14 -0
- package/explorer/pieces/map.js +332 -0
- package/explorer/renderer.js +1 -0
- package/explorer/review.js +1 -1
- package/explorer/theme-model.js +1 -1
- package/explorer/theme.js +1 -1
- package/explorer/tokens.css +2 -2
- package/package.json +1 -1
- package/server/components.js +144 -0
- package/server/embed.js +3 -1
- package/server/server.js +9 -1
- package/explorer/explorer.css +0 -1512
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* proposal.css: the proposal bar
|
|
3
|
+
* The proposals list, the bar of an open proposal (title, source, counts, Before / Diff / After, Edit, the More menu) and the line of a run
|
|
4
|
+
* that waits on it. Read by corn-proposal (D4).
|
|
5
|
+
* No rule here asks what the document says (`:root`, `html`, `body`, `[data-theme]`), sizes from the window (`vw`, `vh`) or is `position: fixed` unless it says why;
|
|
6
|
+
* a width rule is a container query on `corn-box` (page.css), a height rule on `corn-page`. base.css loads first.
|
|
7
|
+
*/
|
|
8
|
+
.hx-menu--proposals { width: 360px; }
|
|
9
|
+
.hx-proposal-list { display: flex; flex-direction: column; gap: var(--corn-space-1); }
|
|
10
|
+
.hx-proposal-empty { padding: var(--corn-space-3) calc(var(--corn-space-1) / 2); font-size: var(--corn-text-sm); }
|
|
11
|
+
.hx-proposal-item { display: flex; flex-direction: column; align-items: flex-start; gap: var(--corn-space-1); width: 100%; padding: var(--corn-space-3) var(--corn-space-3); border-radius: var(--corn-radius); border: var(--corn-border) solid var(--corn-line); background: var(--corn-surface-2); color: var(--corn-text); text-align: left; font-size: var(--corn-text-xs); }
|
|
12
|
+
button.hx-proposal-item:hover { background: var(--corn-surface-3); }
|
|
13
|
+
button.hx-proposal-item:focus-visible { outline: var(--corn-focus-width) solid var(--corn-focus); outline-offset: var(--corn-focus-offset); }
|
|
14
|
+
.hx-proposal-item.is-current { border-color: var(--corn-added-text); background: color-mix(in srgb, var(--corn-added) 12%, transparent); }
|
|
15
|
+
.hx-proposal-item.is-broken { opacity: 0.8; cursor: default; }
|
|
16
|
+
.hx-proposal-title { font-size: var(--corn-text-sm); font-weight: 600; color: var(--corn-text); overflow-wrap: anywhere; }
|
|
17
|
+
.hx-proposal-sum { color: var(--corn-text-2); line-height: 1.4; }
|
|
18
|
+
.hx-proposal-meta { display: flex; flex-wrap: wrap; gap: calc(var(--corn-space-1) / 2) var(--corn-space-3); color: var(--corn-text-3); font-size: var(--corn-text-2xs); }
|
|
19
|
+
.hx-proposal-where { color: var(--corn-added-text); }
|
|
20
|
+
.hx-proposal-bar { position: absolute; top: 48px; left: 12px; width: min(960px, calc(100% - 24px)); padding: var(--corn-space-3) var(--corn-space-3); border-radius: var(--corn-radius-lg); font-size: var(--corn-text-sm); z-index: 15; user-select: text; }
|
|
21
|
+
.hx-proposal-bar.is-error { border-color: color-mix(in srgb, var(--corn-removed) 50%, transparent); }
|
|
22
|
+
.hx-proposal-message { color: var(--corn-text-2); }
|
|
23
|
+
.hx-proposal-bar.is-error .hx-proposal-message { color: var(--corn-bad); }
|
|
24
|
+
.hx-proposal-count:focus-visible, .hx-proposal-mode:focus-visible, .hx-seg-btn:focus-visible { outline: var(--corn-focus-width) solid var(--corn-focus); outline-offset: var(--corn-focus-offset); }
|
|
25
|
+
.hx-proposal-summary { margin-top: var(--corn-space-2); color: var(--corn-text-2); line-height: 1.5; }
|
|
26
|
+
/* Before / Diff / After */
|
|
27
|
+
.hx-seg { display: inline-flex; padding: calc(var(--corn-space-1) / 2); border-radius: var(--corn-radius-sm); border: var(--corn-border) solid var(--corn-line); background: color-mix(in srgb, var(--corn-ground) 55%, transparent); }
|
|
28
|
+
.hx-seg-btn { height: var(--hx-seg-inner); padding: 0 var(--corn-space-4); border: 0; border-radius: var(--corn-radius-sm); background: none; color: var(--corn-text-3); font-size: var(--corn-text-sm); font-weight: 500; }
|
|
29
|
+
.hx-seg-btn:hover { color: var(--corn-text); }
|
|
30
|
+
.hx-seg-btn.is-on, .hx-seg-btn[aria-pressed="true"] { background: var(--corn-accent); color: var(--corn-text-on-accent); } /* the weight does not change: a heavier word is wider, and Edit and the rest of the bar would move */
|
|
31
|
+
.hx-proposal-errors { margin-top: var(--corn-space-2); padding: var(--corn-space-2) var(--corn-space-3); border-radius: var(--corn-radius-sm); background: color-mix(in srgb, var(--corn-removed) 10%, transparent); border: var(--corn-border) solid color-mix(in srgb, var(--corn-removed) 30%, transparent); color: var(--corn-text-2); }
|
|
32
|
+
.hx-proposal-errors summary { cursor: pointer; color: var(--corn-bad); font-weight: 600; }
|
|
33
|
+
.hx-proposal-errors ul { margin: var(--corn-space-2) 0 var(--corn-space-1); padding-left: var(--corn-space-5); line-height: 1.5; }
|
|
34
|
+
.hx-proposal-errors p { margin-top: var(--corn-space-1); font-size: var(--corn-text-xs); }
|
|
35
|
+
@container corn-box (min-width: 768px) {
|
|
36
|
+
/* The node panel is a 480px slide-over from 768px: the bar makes room for it */
|
|
37
|
+
.hx-stage:has(.drawer-open) .hx-proposal-bar { width: min(960px, calc(100% - 504px)); }
|
|
38
|
+
}
|
|
39
|
+
@container corn-box (max-width: 639px) {
|
|
40
|
+
/* fixed (spec 0011 D8): the proposals list in a phone's account menu spans the window */
|
|
41
|
+
.hx-menu--proposals { position: fixed; top: 60px; left: 12px; right: 12px; width: auto; max-width: none; }
|
|
42
|
+
}
|
|
43
|
+
.hx-proposal-reviewed { color: var(--corn-added-text); }
|
|
44
|
+
/* ---- The proposal toolbar (CF-43): proposal.js, review.js, whatif.js, scenario-ui.js ----------------
|
|
45
|
+
One row from 768px: title, counts (they open the change list), Before / Diff / After, Play, Edit, then Send back,
|
|
46
|
+
Approve (the primary) and a ⋯ menu with Close. The what-if controls sit behind Edit, the scenario list behind Play,
|
|
47
|
+
and the review note opens under the row on Send back. On a phone the row is a sheet: the title, the counts with
|
|
48
|
+
the current mode (a button that opens the switcher), the note when it is open, and Send back and Approve full
|
|
49
|
+
width, each 44px tall. */
|
|
50
|
+
.hx-proposal-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--corn-space-3) var(--corn-space-4); }
|
|
51
|
+
.hx-proposal-name { flex: 0 1 auto; min-width: 0; max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--corn-text); } /* its size and weight are the shared panel title's ("panel head" at the end of this file) */
|
|
52
|
+
.hx-proposal-counts { display: contents; }
|
|
53
|
+
.hx-proposal-chip { display: inline-flex; align-items: center; flex-wrap: wrap; color: var(--corn-text-2); font-size: var(--corn-text-sm); font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
54
|
+
.hx-proposal-count { display: inline-flex; align-items: center; min-height: var(--hx-control-h); padding: var(--corn-space-1) var(--corn-space-2); border: 0; border-radius: var(--corn-radius-sm); background: none; color: inherit; font: inherit; white-space: inherit; cursor: pointer; }
|
|
55
|
+
.hx-proposal-count:hover { color: var(--corn-text); text-decoration: underline; }
|
|
56
|
+
.hx-proposal-peek { display: none; margin: 0; }
|
|
57
|
+
.hx-proposal-chip .hx-mark-dot { margin: 0 var(--corn-space-2) 0 0; }
|
|
58
|
+
h2.hx-proposal-name { margin: 0; }
|
|
59
|
+
.hx-proposal-sep { margin: 0 var(--corn-space-2); color: var(--corn-text-3); }
|
|
60
|
+
.hx-proposal-mode { display: none; }
|
|
61
|
+
.hx-proposal-tools { display: flex; align-items: center; gap: var(--corn-space-3); }
|
|
62
|
+
.hx-proposal-tools .hx-btn { height: var(--hx-control-h); font-size: var(--corn-text-sm); font-weight: 500; }
|
|
63
|
+
#proposal-edit.hx-btn--active { background: var(--corn-edit-text); border-color: var(--corn-edit); color: var(--corn-ground); }
|
|
64
|
+
.hx-proposal-more { position: relative; }
|
|
65
|
+
.hx-proposal-more .hx-btn--icon { width: var(--hx-control-h); height: var(--hx-control-h); border-color: transparent; background: none; color: var(--corn-text-3); }
|
|
66
|
+
.hx-proposal-more .hx-btn--icon:hover, .hx-proposal-more .hx-btn--icon[aria-expanded="true"] { background: var(--corn-surface-3); color: var(--corn-text); }
|
|
67
|
+
.hx-proposal-more-menu { position: absolute; top: 100%; right: 0; z-index: 20; display: flex; flex-direction: column; min-width: 160px; margin-top: var(--corn-space-2); padding: var(--corn-space-2); border-radius: var(--corn-radius); border: var(--corn-border) solid var(--corn-line); box-shadow: var(--corn-shadow); }
|
|
68
|
+
.hx-proposal-more-menu[hidden] { display: none; }
|
|
69
|
+
.hx-proposal-more-menu .hx-btn { width: 100%; height: var(--hx-control-h); border-color: transparent; background: none; color: var(--corn-text-2); font-size: var(--corn-text-sm); }
|
|
70
|
+
.hx-proposal-more-menu .hx-btn:hover { background: var(--corn-surface-3); color: var(--corn-text); }
|
|
71
|
+
@container corn-box (max-width: 767px) {
|
|
72
|
+
.hx-proposal-head { display: grid; grid-template-columns: 1fr auto; gap: var(--corn-space-2) var(--corn-space-3); }
|
|
73
|
+
.hx-proposal-name { grid-column: 1 / -1; order: 1; max-width: none; }
|
|
74
|
+
.hx-proposal-counts { display: flex; grid-column: 1 / -1; order: 2; align-items: center; flex-wrap: wrap; column-gap: var(--corn-space-2); }
|
|
75
|
+
.hx-proposal-count, .hx-proposal-mode { min-height: 44px; }
|
|
76
|
+
.hx-proposal-mode { display: inline-flex; align-items: center; gap: var(--corn-space-2); padding: 0 var(--corn-space-3); border: var(--corn-border) solid var(--corn-line); border-radius: var(--corn-radius-sm); background: var(--corn-surface-2); color: var(--corn-text); font-size: var(--corn-text-sm); font-weight: 600; }
|
|
77
|
+
/* A chevron drawn from an image and the text colour: a thick --corn-border-strong cannot turn it into a heart (the borders it used to be drawn with) */
|
|
78
|
+
.hx-proposal-mode::after { content: ""; width: 10px; height: 10px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 3.5l3 3 3-3'/%3E%3C/svg%3E") no-repeat center / contain; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 3.5l3 3 3-3'/%3E%3C/svg%3E") no-repeat center / contain; }
|
|
79
|
+
.hx-proposal-mode[aria-expanded="true"]::after { transform: rotate(180deg); }
|
|
80
|
+
.hx-seg { grid-column: 1 / -1; order: 3; }
|
|
81
|
+
.hx-proposal-bar:not([data-mode-open="true"]) .hx-seg { display: none; }
|
|
82
|
+
.hx-seg-btn { flex: 1; height: var(--hx-seg-inner); font-size: var(--corn-text-md); }
|
|
83
|
+
.hx-proposal-tools { order: 5; }
|
|
84
|
+
.hx-proposal-tools .hx-btn { height: auto; min-height: 44px; padding: 0 var(--corn-space-5); font-size: var(--corn-text-md); }
|
|
85
|
+
.hx-proposal-more { display: contents; }
|
|
86
|
+
.hx-proposal-more .hx-btn--icon { order: 6; width: var(--hx-control-h); height: var(--hx-control-h); }
|
|
87
|
+
.hx-proposal-more-menu { position: static; grid-column: 1 / -1; order: 7; box-shadow: none; }
|
|
88
|
+
.hx-proposal-more-menu .hx-btn { height: auto; min-height: 44px; font-size: var(--corn-text-md); }
|
|
89
|
+
/* The proposal bar */
|
|
90
|
+
.hx-proposal-bar { max-height: 50cqh; overflow-y: auto; padding: 0 var(--corn-space-4) var(--corn-space-3); }
|
|
91
|
+
}
|
|
92
|
+
@container corn-box (min-width: 768px) {
|
|
93
|
+
/* The proposal bar and the player make room for it: 12px past its edge, and the node panel's 480px (+24) when that is open too */
|
|
94
|
+
.hx-stage:has(.forge-open) .hx-proposal-bar { left: calc(var(--hx-forge-w) + 12px); width: min(960px, calc(100% - var(--hx-forge-w) - 36px)); }
|
|
95
|
+
.hx-stage:has(.forge-open):has(.drawer-open) .hx-proposal-bar { width: min(960px, calc(100% - var(--hx-forge-w) - 540px)); }
|
|
96
|
+
}
|
|
97
|
+
.hx-proposal-bar { scroll-padding-block: calc(var(--corn-focus-width) + var(--corn-focus-offset) + var(--corn-space-1)); }
|
|
98
|
+
@media (forced-colors: active) {
|
|
99
|
+
.hx-proposal-mode::after { background: CanvasText; }
|
|
100
|
+
}
|
|
101
|
+
/* ---- the review flow, 0.34 design review (explorer/proposal.js, review.js, scenario-ui.js) -----------------------------
|
|
102
|
+
F08 the source chip on the bar; F11 the player's controls in a phone peek; F14 the note above the keyboard; F15 the reason
|
|
103
|
+
Approve is off in a peek; F16 the ways on from a bad link; F21 reflow at 400% zoom and with text spacing raised. */
|
|
104
|
+
.hx-proposal-source { display: inline-flex; align-items: center; min-width: 0; max-width: 100%; padding: calc(var(--corn-space-1) / 2) var(--corn-space-3); border: var(--corn-border) solid var(--corn-line); border-radius: var(--corn-radius-pill); background: var(--corn-surface-2); color: var(--corn-text-2); font-size: var(--corn-text-xs); line-height: 1.4; text-decoration: none; overflow-wrap: anywhere; }
|
|
105
|
+
.hx-proposal-source[hidden] { display: none; }
|
|
106
|
+
a.hx-proposal-source { min-height: 24px; } /* a link: at least the WCAG 2.5.8 target (44px on a phone, below) */
|
|
107
|
+
a.hx-proposal-source:hover { color: var(--corn-text); text-decoration: underline; }
|
|
108
|
+
a.hx-proposal-source:focus-visible { outline: var(--corn-focus-width) solid var(--corn-focus); outline-offset: var(--corn-focus-offset); }
|
|
109
|
+
.hx-proposal-source[data-corn-state="draft"] { border-color: color-mix(in srgb, var(--corn-changed) 50%, transparent); }
|
|
110
|
+
.hx-proposal-ways { display: flex; flex-wrap: wrap; gap: var(--corn-space-2) var(--corn-space-3); margin-top: var(--corn-space-3); }
|
|
111
|
+
.hx-proposal-ways[hidden] { display: none; }
|
|
112
|
+
.hx-proposal-ways .hx-btn { height: auto; min-height: 32px; padding: var(--corn-space-1) var(--corn-space-4); white-space: normal; text-align: left; }
|
|
113
|
+
@container corn-box (max-width: 767px) {
|
|
114
|
+
.hx-proposal-source { grid-column: 1 / -1; order: 1; justify-self: start; }
|
|
115
|
+
.hx-proposal-ways .hx-btn, a.hx-proposal-source { min-height: 44px; } /* targets a thumb can hit */
|
|
116
|
+
.hx-proposal-source { padding: 0; border: 0; border-radius: 0; background: none; } /* a line of the sheet, not a pill 44px tall */
|
|
117
|
+
a.hx-proposal-source { text-decoration: underline; text-underline-offset: 3px; }
|
|
118
|
+
/* The note open: the field, Cancel and the send button are all there is, so all of them stay above the keyboard */
|
|
119
|
+
.hx-proposal-bar:has(.hx-review-form:not([hidden])) :is(.hx-proposal-name, .hx-proposal-source, .hx-proposal-counts, .hx-proposal-tools, .hx-proposal-more, .hx-review-status, .hx-review-line, .hx-rc-scroll, .hx-rc-tabs, .hx-proposal-peek) { display: none; } /* the review column's lists too: the sheet holds the note and its buttons */
|
|
120
|
+
/* Reflow: nothing is wider than the sheet, and long words and counts wrap instead of being cut */
|
|
121
|
+
.hx-proposal-bar { overflow-x: hidden; overflow-wrap: anywhere; }
|
|
122
|
+
.hx-proposal-head { grid-template-columns: minmax(0, 1fr) auto; }
|
|
123
|
+
.hx-proposal-chip { flex-wrap: wrap; max-width: 100%; white-space: normal; text-align: left; }
|
|
124
|
+
.hx-proposal-counts { min-width: 0; }
|
|
125
|
+
.hx-proposal-chip { flex-wrap: wrap; white-space: normal; text-align: left; }
|
|
126
|
+
.hx-proposal-count { white-space: normal; text-align: left; } /* the counts say what they count, so they are longer: they wrap rather than clip */
|
|
127
|
+
}
|
|
128
|
+
@media (pointer: coarse) {
|
|
129
|
+
.hx-proposal-chip { flex-wrap: wrap; white-space: normal; text-align: left; }
|
|
130
|
+
.hx-proposal-count { white-space: normal; text-align: left; } /* the counts say what they count, so they are longer: they wrap rather than clip */
|
|
131
|
+
}
|
|
132
|
+
.hx-proposal-summary { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; margin: 0; flex: none; }
|
|
133
|
+
@container corn-box (max-width: 767px) {
|
|
134
|
+
.hx-proposal-summary { display: none; }
|
|
135
|
+
}
|
|
136
|
+
/* The proposal bar's line when a run waits on the open proposal (spec 0010 D2): one line under the buttons, in the waiting colour's own mark (a left edge and its words), then Answer */
|
|
137
|
+
.hx-waiting-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--corn-space-2) var(--corn-space-3); margin: var(--corn-space-2) 0 0; padding: var(--corn-space-1) var(--corn-space-3); border-left: calc(var(--corn-border-strong) * 2) solid var(--corn-run-waiting); border-radius: var(--corn-radius-sm); background: var(--corn-surface-2); color: var(--corn-text); line-height: 1.4; overflow-wrap: anywhere; }
|
|
138
|
+
.hx-waiting-line[hidden] { display: none; }
|
|
139
|
+
@container corn-box (max-width: 767px) {
|
|
140
|
+
.hx-waiting-line .hx-btn { min-height: 44px; min-width: 44px; }
|
|
141
|
+
}
|
|
142
|
+
.hx-proposal-yours { display: inline-flex; align-items: center; gap: var(--corn-space-1); color: var(--corn-text-2); }
|
|
143
|
+
.hx-proposal-tools [aria-pressed="false"]:not([data-corn="whole-map"]) { opacity: 0.8; } /* My edits off; "Whole map" off is the review's own view, not a faded choice */
|
|
144
|
+
.hx-proposal-name { font-size: var(--corn-text-lg); font-weight: 700; line-height: 1.25; letter-spacing: normal; }
|
|
145
|
+
@container corn-box (min-width: 768px) {
|
|
146
|
+
/* On a desk "Whole map" sits on the title's row, beside the source, so the row of counts, Compare, Edit and More keeps the one line it had: at the
|
|
147
|
+
control height, drawn over the row's own 24px (the source's; --corn-space-6) so the bar is no taller. On a phone it stays with Edit, 44px */
|
|
148
|
+
.hx-proposal-tools { display: contents; }
|
|
149
|
+
.hx-proposal-name, .hx-proposal-source { order: -2; }
|
|
150
|
+
:where(.hx-proposal-head) [data-corn="whole-map"] { order: -1; margin-block: calc((var(--corn-space-6) - var(--hx-control-h)) / 2); } /* the row is 24px (--corn-space-6 by default), the source's height */
|
|
151
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* search.css: search
|
|
3
|
+
* The search field (a desk's) and the phone's search bar, the count, the step buttons and the list of what was found. Read by corn-search
|
|
4
|
+
* (D4).
|
|
5
|
+
* No rule here asks what the document says (`:root`, `html`, `body`, `[data-theme]`), sizes from the window (`vw`, `vh`) or is `position: fixed` unless it says why;
|
|
6
|
+
* a width rule is a container query on `corn-box` (page.css), a height rule on `corn-page`. base.css loads first.
|
|
7
|
+
*/
|
|
8
|
+
/* Search: the field with its key hint (a desktop's), an icon on a phone */
|
|
9
|
+
.hx-search { display: none; align-items: center; gap: var(--corn-space-3); width: 260px; min-width: 120px; height: var(--hx-control-h); padding: 0 var(--corn-space-3); border-radius: var(--corn-radius-sm); border: var(--corn-border) solid var(--corn-line); background: var(--corn-surface-2); color: var(--corn-text-3); }
|
|
10
|
+
.hx-search:focus-within { border-color: var(--corn-focus); outline: var(--corn-focus-width) solid var(--corn-focus); outline-offset: var(--corn-focus-offset); }
|
|
11
|
+
.hx-search-icon { flex: none; }
|
|
12
|
+
.hx-search-input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--corn-text); font: inherit; font-size: var(--corn-text-sm); outline: none; user-select: text; }
|
|
13
|
+
.hx-search-input::placeholder { color: var(--corn-text-3); }
|
|
14
|
+
.hx-kbd { flex: none; padding: 0 var(--corn-space-1); border-radius: var(--corn-radius-xs); border: var(--corn-border) solid var(--corn-line); font-family: var(--corn-mono); font-size: var(--corn-text-2xs); color: var(--corn-text-3); }
|
|
15
|
+
.hx-search:focus-within .hx-kbd { display: none; }
|
|
16
|
+
.hx-hdr-icon { align-items: center; justify-content: center; width: var(--hx-control-h); height: var(--hx-control-h); padding: 0; border: 0; border-radius: var(--corn-radius-sm); background: none; color: var(--corn-text-2); }
|
|
17
|
+
.hx-hdr-icon:hover { background: var(--corn-surface-3); color: var(--corn-text); }
|
|
18
|
+
@container corn-box (min-width: 768px) {
|
|
19
|
+
.hx-search { display: flex; flex: 0 1 260px; width: auto; }
|
|
20
|
+
}
|
|
21
|
+
.hx-mobile-search { position: absolute; top: 56px; left: 0; right: 0; display: flex; align-items: center; gap: var(--corn-space-3); padding: var(--corn-space-3); z-index: 30; }
|
|
22
|
+
.hx-mobile-search::before { content: ""; position: absolute; top: 50%; left: calc(var(--corn-space-3) + 8px); width: 14px; height: 14px; transform: translateY(-50%); background: var(--corn-text-3); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E") no-repeat center / contain; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E") no-repeat center / contain; pointer-events: none; z-index: 1; }
|
|
23
|
+
@media (forced-colors: active) {
|
|
24
|
+
/* Windows high contrast (forced colours) repaints backgrounds, which would leave a masked icon the colour of the page: draw it in the text colour */
|
|
25
|
+
.hx-mobile-search::before { background: CanvasText; }
|
|
26
|
+
}
|
|
27
|
+
/* Search status (F24, spec 0008): the polite live region by each search field. The count and the list say it on the screen (below), so
|
|
28
|
+
the region itself is only for a screen reader: it stays in the page, out of sight. */
|
|
29
|
+
.hx-search { position: relative; }
|
|
30
|
+
.hx-search-status { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
|
|
31
|
+
@container corn-box (max-width: 767px) {
|
|
32
|
+
.hx-mobile-search .hx-input { min-height: 44px; }
|
|
33
|
+
}
|
|
34
|
+
@media (pointer: coarse) {
|
|
35
|
+
.hx-mobile-search .hx-input { min-height: 44px; }
|
|
36
|
+
}
|
|
37
|
+
/* ---------------------------------------------------------------------------
|
|
38
|
+
Search: the count, the step buttons and the list of what was found (spec 0008 D4)
|
|
39
|
+
--------------------------------------------------------------------------- */
|
|
40
|
+
.hx-search-steps { display: flex; align-items: center; flex: none; gap: var(--corn-space-1); }
|
|
41
|
+
.hx-search-steps[hidden] { display: none; }
|
|
42
|
+
.hx-search-count { padding: 0 var(--corn-space-2); font-size: var(--corn-text-2xs); color: var(--corn-text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
|
|
43
|
+
.hx-search-count[data-empty="true"] { color: var(--corn-text); font-weight: 600; }
|
|
44
|
+
.hx-search-btn { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: var(--corn-radius-xs); background: none; color: var(--corn-text-3); }
|
|
45
|
+
.hx-search-btn:hover { background: var(--corn-surface-3); color: var(--corn-text); }
|
|
46
|
+
.hx-search-btn:focus-visible, .hx-search-row:focus-visible { outline: var(--corn-focus-width) solid var(--corn-focus); outline-offset: calc(var(--corn-focus-offset) * -1); }
|
|
47
|
+
.hx-search:has(.hx-search-steps:not([hidden])) { flex-basis: 340px; }
|
|
48
|
+
@container corn-box (min-width: 768px) and (max-width: 959px) {
|
|
49
|
+
/* A narrow desktop leaves the field too little room for the count and three buttons: Previous and Next go (Enter and Shift+Enter, N and P
|
|
50
|
+
and the list's rows still step), the count and Clear stay */
|
|
51
|
+
.hx-search [data-action="search-prev"], .hx-search [data-action="search-next"] { display: none; }
|
|
52
|
+
}
|
|
53
|
+
.hx-search-results { position: absolute; top: calc(100% + var(--corn-space-2)); right: 0; z-index: 40; width: min(440px, 92cqw); max-height: min(calc(60 * var(--hx-vh, 1cqh)), 560px); overflow-y: auto; padding: var(--corn-space-1) 0; border-radius: var(--corn-radius-sm); border: var(--corn-border) solid var(--corn-line); background: var(--corn-ground); box-shadow: var(--corn-shadow); color: var(--corn-text); font-size: var(--corn-text-sm); } /* the ground itself, not a surface: a surface is see-through, and the panel under the list would show in it */
|
|
54
|
+
.hx-search-results[hidden] { display: none; }
|
|
55
|
+
/* The list is part of the header, which sits under the node panel (40): while the list is open the header is over it, so a row is never half under the panel */
|
|
56
|
+
.hx-header:has(.hx-search-results:not([hidden])) { z-index: 46; }
|
|
57
|
+
/* On a phone the list is in the search bar, under the sheets (the dock, 45): while it is open the bar is over them, so a proposal's or the
|
|
58
|
+
Work sheet never covers rows of it. Without :has() the list stays under the sheets, as the bar always was */
|
|
59
|
+
.hx-mobile-search:has(.hx-search-results:not([hidden])) { z-index: 46; }
|
|
60
|
+
.hx-search-group-title { position: sticky; top: 0; display: flex; justify-content: space-between; gap: var(--corn-space-3); padding: var(--corn-space-2) var(--corn-space-3) var(--corn-space-1); background: var(--corn-ground); color: var(--corn-text-3); font-size: var(--corn-text-2xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
|
|
61
|
+
.hx-search-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--corn-space-3); width: 100%; min-height: 28px; padding: var(--corn-space-1) var(--corn-space-3); border: 0; border-left: var(--corn-border-strong) solid transparent; background: none; color: var(--corn-text); font: inherit; text-align: left; cursor: pointer; }
|
|
62
|
+
.hx-search-row:hover, .hx-search-row:focus-visible { background: var(--corn-surface-3); }
|
|
63
|
+
.hx-search-row[aria-current="true"] { border-left-color: var(--corn-accent); background: var(--corn-accent-soft); }
|
|
64
|
+
.hx-search-row-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
65
|
+
.hx-search-row-parent { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--corn-text-3); font-size: var(--corn-text-xs); }
|
|
66
|
+
.hx-search-frame { font-weight: 600; color: var(--corn-text); }
|
|
67
|
+
.hx-search-empty, .hx-search-more { margin: 0; padding: var(--corn-space-2) var(--corn-space-3); color: var(--corn-text-2); overflow-wrap: anywhere; }
|
|
68
|
+
.hx-mobile-search { flex-wrap: wrap; }
|
|
69
|
+
.hx-mobile-search .hx-input { flex: 1 1 0; min-width: 0; }
|
|
70
|
+
.hx-mobile-search::before { top: calc(var(--corn-space-3) + 22px); } /* the magnifier stays by the field when the bar wraps to a second row of steps */
|
|
71
|
+
.hx-mobile-search .hx-search-steps { flex: 1 0 100%; justify-content: flex-end; gap: var(--corn-space-1); }
|
|
72
|
+
.hx-mobile-search .hx-search-count { margin-right: auto; font-size: var(--corn-text-xs); }
|
|
73
|
+
.hx-mobile-search .hx-search-results { top: 100%; left: 0; right: 0; width: auto; max-height: calc(50 * var(--hx-vh, 1cqh)); border-radius: 0; border-left: 0; border-right: 0; }
|
|
74
|
+
@container corn-box (max-width: 767px) {
|
|
75
|
+
.hx-search-btn { min-width: 44px; min-height: 44px; }
|
|
76
|
+
.hx-search-row { min-height: 44px; }
|
|
77
|
+
}
|
|
78
|
+
@media (pointer: coarse) {
|
|
79
|
+
.hx-search-btn { min-width: 44px; min-height: 44px; }
|
|
80
|
+
.hx-search-row { min-height: 44px; }
|
|
81
|
+
}
|
|
82
|
+
@media (forced-colors: active) {
|
|
83
|
+
.hx-search-row[aria-current="true"] { border-left-color: Highlight; }
|
|
84
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* sheets.css: phone sheets
|
|
3
|
+
* The phone's bottom sheets (sheets.js, TOPO-18; spec 0010 D7): the proposal bar, the scenario player, the node panel and the Work panel
|
|
4
|
+
* stack in #sheet-dock at the bottom of the map, a peek until a tap or swipe on the handle opens one. Cornfield's page shell only: no piece
|
|
5
|
+
* sheets itself. The dock is a descendant of the stage; its height rules ask the screen's, which is the `corn-page` container (the body).
|
|
6
|
+
* No rule here asks what the document says (`:root`, `html`, `body`, `[data-theme]`), sizes from the window (`vw`, `vh`) or is `position: fixed` unless it says why;
|
|
7
|
+
* a width rule is a container query on `corn-box` (page.css), a height rule on `corn-page`. base.css loads first.
|
|
8
|
+
*/
|
|
9
|
+
/* ---- phone bottom sheets (sheets.js, TOPO-18) ----------------------------------------------------
|
|
10
|
+
Below 768px the proposal bar, the scenario player and the node panel stack in #sheet-dock at the bottom of
|
|
11
|
+
the map. Each is a peek (a handle, a title, a line or two) until a tap or swipe on its handle expands it
|
|
12
|
+
to at most half the screen (the node panel 60%) with its own scroll. From 768px the dock is display: contents and
|
|
13
|
+
none of this applies. */
|
|
14
|
+
.hx-dock { display: contents; }
|
|
15
|
+
.hx-sheet-handle { display: none; }
|
|
16
|
+
@keyframes hx-sheet-in { from { transform: translateY(28px); opacity: 0; } }
|
|
17
|
+
@container corn-box (max-width: 767px) {
|
|
18
|
+
.hx-dock { position: absolute; left: 0; right: 0; bottom: 0; z-index: 45; display: flex; flex-direction: column; justify-content: flex-end; pointer-events: none; }
|
|
19
|
+
.hx-dock > * { pointer-events: auto; }
|
|
20
|
+
.hx-dock > .hx-sheet { position: relative; top: auto; left: auto; right: auto; bottom: auto; width: 100%; max-width: none; margin: 0; transform: none; border-radius: var(--corn-radius-lg) var(--corn-radius-lg) 0 0; border-bottom: 0; box-shadow: var(--corn-shadow-sheet); overscroll-behavior: contain; animation: hx-sheet-in 0.2s ease-out; --sheet-pb: var(--corn-space-3); }
|
|
21
|
+
.hx-dock > .hx-sheet[data-sheet-last]:not(.hx-drawer) { padding-bottom: calc(var(--sheet-pb) + env(safe-area-inset-bottom, 0px)); }
|
|
22
|
+
.hx-sheet-handle { display: flex; flex: none; align-items: center; justify-content: center; width: 100%; height: 22px; padding: 0; border: 0; background: none; cursor: grab; touch-action: none; }
|
|
23
|
+
.hx-sheet-handle span { width: 40px; height: 5px; border-radius: var(--corn-radius-pill); background: var(--corn-surface-3); }
|
|
24
|
+
.hx-sheet-handle:focus-visible { outline: var(--corn-focus-width) solid var(--corn-focus); outline-offset: calc(var(--corn-focus-width) * -1); border-radius: var(--corn-radius); }
|
|
25
|
+
.hx-player > .hx-sheet-handle { flex: 0 0 100%; }
|
|
26
|
+
}
|
|
27
|
+
@media (prefers-reduced-motion: reduce) {
|
|
28
|
+
.hx-dock > .hx-sheet { animation: none; }
|
|
29
|
+
.hx-sheet, .hx-dock > .hx-sheet { transition: none; animation: none; }
|
|
30
|
+
}
|
|
31
|
+
@container corn-box (max-width: 767px) {
|
|
32
|
+
.hx-sheet-handle { height: 44px; } /* the grip is drawn the same; the button itself is 44px (a hit area stretched past it is clipped by the sheet above, and covers its title below) */
|
|
33
|
+
}
|
|
34
|
+
@media (pointer: coarse) {
|
|
35
|
+
.hx-sheet-handle { height: 44px; } /* the grip is drawn the same; the button itself is 44px (a hit area stretched past it is clipped by the sheet above, and covers its title below) */
|
|
36
|
+
}
|
|
37
|
+
/* ==========================================================================
|
|
38
|
+
Sheets on a phone (spec 0010 D7): two at most, one expanded, a stub for the other, and the map keeps 35% of the screen
|
|
39
|
+
========================================================================== */
|
|
40
|
+
.hx-sheet-stub { display: none; }
|
|
41
|
+
@container corn-box (max-width: 767px) {
|
|
42
|
+
/* The node panel and Work take turns: the one displaced is hidden, not closed (its node stays selected) */
|
|
43
|
+
.hx-dock > .hx-sheet[data-sheet-away] { display: none; }
|
|
44
|
+
/* A stub: one 44px row with the sheet's title and its badge; a tap expands it, and the expanded one folds to a stub in its place */
|
|
45
|
+
.hx-dock > .hx-sheet[data-sheet-state="stub"] { min-height: 44px; max-height: 44px; padding-top: 0; padding-bottom: 0; overflow: hidden; }
|
|
46
|
+
.hx-dock > .hx-sheet[data-sheet-state="stub"] > :not(.hx-sheet-stub) { display: none !important; }
|
|
47
|
+
.hx-sheet-stub { display: flex; align-items: center; gap: var(--corn-space-3); width: 100%; min-height: 44px; padding: 0 var(--corn-space-1); border: 0; background: none; color: var(--corn-text); font: inherit; font-weight: 600; text-align: left; }
|
|
48
|
+
.hx-sheet-stub[hidden] { display: none; }
|
|
49
|
+
.hx-sheet-stub:focus-visible { outline: var(--corn-focus-width) solid var(--corn-focus); outline-offset: calc(var(--corn-focus-width) * -1); border-radius: var(--corn-radius); }
|
|
50
|
+
.hx-sheet-stub-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
51
|
+
.hx-proposal-bar[data-sheet-state="peek"] .hx-review > :not([data-review-hint]):not([data-review-msg]):not([data-review-line]):not([data-review-ask]):not([data-review-hold]):not([data-review-hold-live]):not([data-review-landing]) { display: none; } /* the peek keeps the line Approve points at, the question, the hold, a landing that waits, and a refusal */
|
|
52
|
+
/* While a scenario plays the proposal sheet folds to its title and counts: the player needs the room */
|
|
53
|
+
.hx-dock:has(> .hx-player) .hx-proposal-bar[data-sheet-state="peek"] .hx-rc-foot { display: none; }
|
|
54
|
+
.hx-proposal-bar[data-sheet-state="expanded"] .hx-whatif-panel { max-height: none; overflow: visible; }
|
|
55
|
+
.hx-proposal-bar[data-sheet-state="peek"] > :not(.hx-sheet-handle):not(#proposal-message):not(#proposal-ways):not(#proposal-body), .hx-proposal-bar[data-sheet-state="peek"] #proposal-body > :not(.hx-proposal-head), .hx-proposal-bar[data-sheet-state="peek"] .hx-proposal-head > :is(.hx-proposal-tools, .hx-proposal-more, .hx-proposal-more-menu) { display: none; }
|
|
56
|
+
}
|
|
57
|
+
@container corn-box (max-width: 767px) {
|
|
58
|
+
@container corn-page (max-height: 480px) {
|
|
59
|
+
/* A short window (400% zoom is 225px tall): an open sheet may take the window, and the node panel's title wraps */
|
|
60
|
+
.hx-proposal-bar[data-sheet-state="expanded"] { max-height: calc(100cqh - var(--corn-space-3)); }
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
@container corn-box (max-width: 767px) {
|
|
64
|
+
.hx-proposal-bar[data-sheet-state="peek"] .hx-proposal-chip { display: none; }
|
|
65
|
+
/* Opened, the sheet's switch carries the counts, so the head is one short row: Before / Diff / After, Edit and ⋯ */
|
|
66
|
+
.hx-proposal-bar[data-sheet-state="expanded"] { max-height: 62cqh; }
|
|
67
|
+
.hx-proposal-bar[data-sheet-state="expanded"] .hx-proposal-chip, .hx-proposal-bar[data-sheet-state="expanded"] .hx-proposal-summary { display: none; }
|
|
68
|
+
.hx-proposal-bar[data-sheet-state="expanded"] .hx-proposal-counts { grid-column: 1; order: 3; }
|
|
69
|
+
.hx-proposal-bar[data-sheet-state="expanded"] .hx-proposal-tools { grid-column: 2; order: 4; }
|
|
70
|
+
.hx-proposal-bar[data-sheet-state="expanded"] .hx-proposal-head { grid-template-columns: minmax(0, 1fr) auto auto; }
|
|
71
|
+
.hx-proposal-bar[data-sheet-state="expanded"] .hx-proposal-more .hx-btn--icon { grid-column: 3; order: 4; }
|
|
72
|
+
.hx-proposal-bar[data-sheet-state="peek"] .hx-proposal-peek { display: block; color: var(--corn-text-2); }
|
|
73
|
+
}
|
|
74
|
+
@container corn-box (max-width: 767px) {
|
|
75
|
+
@container corn-page (min-height: 481px) {
|
|
76
|
+
/* An expanded sheet is capped so the map keeps 35% of the screen: sheets.js writes `--hx-sheet-cap` (the screen less the map's share, less a stub). Not in a short
|
|
77
|
+
window (400% zoom), where an open sheet may take the window. */
|
|
78
|
+
.hx-dock > .hx-proposal-bar[data-sheet-state="expanded"] { max-height: min(var(--hx-sheet-cap, 50cqh), 50cqh); }
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
@container corn-box (max-width: 767px) {
|
|
82
|
+
.hx-player[data-sheet-state="expanded"] { overflow-y: auto; }
|
|
83
|
+
.hx-player[data-sheet-state="peek"] > :not(.hx-sheet-handle):not(.hx-player-controls):not(.hx-player-text):not(.hx-player-side):not(.hx-player-track):not(.hx-player-says) { display: none; } /* Previous, Pause and Next stay in the peek, with the counter and Close */
|
|
84
|
+
.hx-player[data-sheet-state="peek"] .hx-player-text { flex: 1 1 0; display: flex; align-items: center; gap: var(--corn-space-2); min-height: 44px; overflow: hidden; font-size: var(--corn-text-md); white-space: nowrap; }
|
|
85
|
+
.hx-player[data-sheet-state="peek"] .hx-player-step, .hx-player[data-sheet-state="peek"] .hx-player-who, .hx-player[data-sheet-state="peek"] .hx-player-sep { display: none; }
|
|
86
|
+
.hx-player[data-sheet-state="peek"] .hx-player-side .hx-player-speed { display: none; }
|
|
87
|
+
.hx-player[data-sheet-state="expanded"] .hx-player-text { flex: 1 0 100%; order: 3; }
|
|
88
|
+
.hx-player[data-sheet-state="expanded"] .hx-player-title { position: static; width: auto; height: auto; clip: auto; clip-path: none; overflow: visible; order: 0; flex: 0 0 100%; font-size: var(--corn-text-sm); font-weight: 600; color: var(--corn-text-2); }
|
|
89
|
+
}
|
|
90
|
+
@container corn-box (max-width: 767px) {
|
|
91
|
+
@container corn-page (max-height: 480px) {
|
|
92
|
+
.hx-player[data-sheet-state="expanded"] { max-height: calc(100cqh - var(--corn-space-3)); }
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
@container corn-box (max-width: 767px) {
|
|
96
|
+
/* The peek: the title, the one line of counts, and the decision; the lists wait for the sheet to open */
|
|
97
|
+
.hx-proposal-bar[data-sheet-state="peek"] #proposal-body > .hx-review-column { display: flex; }
|
|
98
|
+
.hx-proposal-bar[data-sheet-state="peek"] .hx-review-column > :not(.hx-rc-foot) { display: none; }
|
|
99
|
+
}
|
|
100
|
+
@container corn-box (max-width: 767px) {
|
|
101
|
+
@container corn-page (min-height: 481px) {
|
|
102
|
+
.hx-dock > .hx-player[data-sheet-state="expanded"] { max-height: min(var(--hx-sheet-cap, 50cqh), 50cqh); }
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
@container corn-box (max-width: 767px) {
|
|
106
|
+
.hx-dock > .hx-drawer[data-sheet-last][data-sheet-state="peek"] { padding-bottom: calc(var(--sheet-pb) + env(safe-area-inset-bottom, 0px)); }
|
|
107
|
+
/* With the node panel expanded the backdrop stays as the tap that closes it, but draws nothing: the map above the sheet is the free band the
|
|
108
|
+
selected node was panned into (camera.js panIntoView), and a scrim or blur over it hides that node (issue #180) */
|
|
109
|
+
.hx-stage[data-sheet-open="drawer"] .hx-backdrop:not([hidden]) { display: block; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
|
|
110
|
+
.hx-drawer[data-sheet-state="peek"] .hx-drawer-body { flex: none; padding: 0 var(--corn-space-5) var(--corn-space-3); gap: 0; overflow: hidden; }
|
|
111
|
+
.hx-drawer[data-sheet-state="peek"] .hx-drawer-body > :not(.hx-drawer-head), .hx-drawer[data-sheet-state="peek"] .hx-drawer-foot { display: none; }
|
|
112
|
+
.hx-drawer[data-sheet-state="peek"] .hx-drawer-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
113
|
+
}
|
|
114
|
+
@container corn-box (max-width: 767px) {
|
|
115
|
+
@container corn-page (max-height: 480px) {
|
|
116
|
+
.hx-drawer[data-sheet-state="peek"] .hx-drawer-title { overflow: visible; text-overflow: clip; white-space: normal; }
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
@container corn-box (max-width: 767px) {
|
|
120
|
+
@container corn-page (min-height: 481px) {
|
|
121
|
+
.hx-dock > .hx-drawer[data-sheet-state="expanded"] { max-height: min(var(--hx-sheet-cap, 60cqh), 60cqh); }
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
@container corn-box (max-width: 767px) {
|
|
125
|
+
.hx-forge[data-sheet-state="peek"] .hx-forge-body { flex: none; padding: 0 var(--corn-space-5) var(--corn-space-3); gap: var(--corn-space-1); overflow: hidden; }
|
|
126
|
+
.hx-forge[data-sheet-state="peek"] .hx-forge-body > :not(.hx-forge-top):not(#forge-bar), .hx-forge[data-sheet-state="peek"] #forge-filter-chip, .hx-forge[data-sheet-state="peek"] .hx-forge-tabs { display: none; }
|
|
127
|
+
.hx-forge[data-sheet-state="peek"] .hx-forge-head { padding-bottom: 0; border-bottom: 0; }
|
|
128
|
+
.hx-forge[data-sheet-state="peek"] .hx-forge-head .hx-btn { display: none; }
|
|
129
|
+
}
|
|
130
|
+
@container corn-box (max-width: 767px) {
|
|
131
|
+
@container corn-page (min-height: 481px) {
|
|
132
|
+
.hx-dock > .hx-forge[data-sheet-state="expanded"] { max-height: min(var(--hx-sheet-cap, 60cqh), 60cqh); }
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* whatif.css: what-if editing
|
|
3
|
+
* What-if editing (whatif.js): the controls under the proposal bar, the panel, the drag that draws an edge.
|
|
4
|
+
* No rule here asks what the document says (`:root`, `html`, `body`, `[data-theme]`), sizes from the window (`vw`, `vh`) or is `position: fixed` unless it says why;
|
|
5
|
+
* a width rule is a container query on `corn-box` (page.css), a height rule on `corn-page`. base.css loads first.
|
|
6
|
+
*/
|
|
7
|
+
/* With a proposal open the list is a row of its bar (scenario-ui.js mounts it there), so it opens in the bar's flow and the bar grows to hold it */
|
|
8
|
+
.hx-whatif { margin-top: var(--corn-space-3); padding-top: var(--corn-space-3); border-top: var(--corn-border) solid color-mix(in srgb, var(--corn-edit) 30%, transparent); }
|
|
9
|
+
.hx-whatif[hidden] { display: none; }
|
|
10
|
+
.hx-whatif-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--corn-space-2); }
|
|
11
|
+
.hx-whatif .hx-btn:disabled { opacity: 0.4; cursor: default; }
|
|
12
|
+
.hx-whatif .hx-btn[aria-pressed="true"], .hx-whatif .hx-btn--active { background: var(--corn-edit-text); border-color: var(--corn-edit); color: var(--corn-ground); }
|
|
13
|
+
.hx-whatif-hint { margin: var(--corn-space-2) 0 0; color: var(--corn-edit-text); }
|
|
14
|
+
.hx-whatif-msg { margin: var(--corn-space-2) 0 0; padding: var(--corn-space-1) var(--corn-space-3); border-radius: var(--corn-radius-sm); background: color-mix(in srgb, var(--corn-removed) 12%, transparent); border: var(--corn-border) solid color-mix(in srgb, var(--corn-removed) 35%, transparent); color: var(--corn-bad); line-height: 1.4; }
|
|
15
|
+
.hx-whatif-msg[hidden], .hx-whatif-hint[hidden], .hx-whatif-notice[hidden], .hx-whatif-panel[hidden] { display: none; }
|
|
16
|
+
.hx-whatif-notice { margin: var(--corn-space-2) 0 0; color: var(--corn-warn); }
|
|
17
|
+
.hx-whatif-panel { margin-top: var(--corn-space-3); padding: var(--corn-space-3) var(--corn-space-3); border-radius: var(--corn-radius-sm); background: color-mix(in srgb, var(--corn-ground) 55%, transparent); border: var(--corn-border) solid color-mix(in srgb, var(--corn-edit) 25%, transparent); max-height: min(calc(40 * var(--hx-vh, 1cqh)), 320px); overflow: auto; }
|
|
18
|
+
.hx-whatif-form { display: flex; flex-direction: column; gap: var(--corn-space-2); }
|
|
19
|
+
.hx-whatif-field { display: flex; align-items: center; gap: var(--corn-space-3); color: var(--corn-text-2); }
|
|
20
|
+
.hx-whatif-field > select, .hx-whatif-field > .hx-whatif-input { flex: 1; min-width: 0; }
|
|
21
|
+
.hx-whatif-input, .hx-whatif-field select, .hx-whatif select { padding: var(--corn-space-1) var(--corn-space-3); border-radius: var(--corn-radius-sm); border: var(--corn-border) solid var(--corn-line); background: color-mix(in srgb, var(--corn-ground) 80%, transparent); color: var(--corn-text); font: inherit; font-size: var(--corn-text-sm); user-select: text; }
|
|
22
|
+
.hx-whatif-input:focus, .hx-whatif-field select:focus { outline: var(--corn-focus-width) solid var(--corn-edit-text); outline-offset: calc(var(--corn-focus-offset) / 2); }
|
|
23
|
+
.hx-whatif-help { margin: 0; font-size: var(--corn-text-xs); }
|
|
24
|
+
.hx-whatif-pair { margin: 0; }
|
|
25
|
+
.hx-whatif-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--corn-space-2); }
|
|
26
|
+
.hx-whatif-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--corn-space-1); }
|
|
27
|
+
.hx-whatif-edit { display: flex; align-items: center; gap: var(--corn-space-3); }
|
|
28
|
+
.hx-whatif-edit-text { flex: 1; min-width: 0; line-height: 1.4; }
|
|
29
|
+
.hx-whatif-step { display: flex; align-items: flex-start; gap: var(--corn-space-2); padding: var(--corn-space-1); border-radius: var(--corn-radius-sm); }
|
|
30
|
+
.hx-whatif-step.is-current { background: color-mix(in srgb, var(--corn-edit) 18%, transparent); }
|
|
31
|
+
.hx-whatif-num { flex: none; width: 22px; height: 22px; border: 0; border-radius: 50%; background: color-mix(in srgb, var(--corn-edit) 30%, transparent); color: var(--corn-text); font-size: var(--corn-text-xs); font-weight: 700; cursor: pointer; }
|
|
32
|
+
.hx-whatif-stepbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: calc(var(--corn-space-1) / 2); }
|
|
33
|
+
.hx-whatif-stepbody .hx-whatif-input { width: 100%; }
|
|
34
|
+
.hx-whatif-target { font-size: var(--corn-text-xs); }
|
|
35
|
+
.hx-whatif-addstep { display: flex; flex-wrap: wrap; align-items: center; gap: var(--corn-space-2); margin-top: var(--corn-space-3); }
|
|
36
|
+
.hx-whatif-addstep .hx-whatif-field { flex: 1 1 220px; }
|
|
37
|
+
.hx-whatif-edges { color: var(--corn-text-2); }
|
|
38
|
+
.hx-whatif-edges summary { cursor: pointer; }
|
|
39
|
+
.hx-whatif-edges .hx-whatif-list { margin-top: var(--corn-space-2); max-height: 200px; overflow: auto; }
|
|
40
|
+
.hx-rubber { position: absolute; inset: 0; pointer-events: none; z-index: 14; }
|
|
41
|
+
.hx-rubber svg { display: block; overflow: visible; }
|
|
42
|
+
.hx-rubber-line { stroke: var(--corn-edit); stroke-width: 3; stroke-dasharray: 8 6; stroke-linecap: round; }
|
|
43
|
+
.hx-rubber-from, .hx-rubber-to { fill: color-mix(in srgb, var(--corn-edit) 15%, transparent); stroke: var(--corn-edit); stroke-width: 2; }
|
|
44
|
+
@container corn-box (max-width: 767px) {
|
|
45
|
+
.hx-whatif .hx-btn { min-height: 44px; }
|
|
46
|
+
.hx-drawer .hx-whatif-drawer select, .hx-drawer .hx-whatif-edges summary { min-height: 44px; }
|
|
47
|
+
}
|
|
48
|
+
.hx-drawer .hx-whatif-drawer { align-items: flex-start; gap: var(--corn-space-2); font-size: var(--corn-text-md); color: var(--corn-text-2); }
|
|
49
|
+
.hx-whatif-drawer:focus { outline: none; } /* it only holds the focus between two paints */
|
|
50
|
+
.hx-drawer .hx-whatif-edgeto { display: flex; align-items: center; gap: var(--corn-space-2); align-self: stretch; }
|
|
51
|
+
.hx-drawer .hx-whatif-edgeto .hx-whatif-field { flex: 1; min-width: 0; }
|
|
52
|
+
.hx-drawer .hx-whatif-drawer select { max-width: 100%; }
|
|
53
|
+
.hx-drawer .hx-whatif-edges { align-self: stretch; }
|
|
54
|
+
.hx-whatif-edges .hx-whatif-list { scroll-padding-block: calc(var(--corn-focus-width) + var(--corn-focus-offset) + var(--corn-space-1)); }
|
|
55
|
+
.hx-whatif-row [aria-disabled="true"] { opacity: 0.55; cursor: default; }
|