forge
Explore
Log in

Don't you dare go Hollow

forge

Clone
★ 0

0 watching0 forksRustAGPL-3.07.1 MiB490f099Tahinli7 hours ago322 commits

_browse.scss352 lines, 5.7 KiBHistoryRawDownload
1// Code browsing: the diff toolbar and split view, blob line selection, blame, the file finder and
2// the branches page.
3
4// Diff toolbar: unified/split segment, ignore whitespace, patch downloads.
5.diff-toolbar {
6 display: flex;
7 align-items: center;
8 flex-wrap: wrap;
9 gap: 8px 12px;
10 margin: 0 0 12px;
11}
12
13// Split view: two sides per row, code wraps instead of scrolling sideways.
14.diff-table.diff-split {
15 width: 100%;
16 table-layout: fixed;
17
18 .diff-ln {
19 position: static;
20 width: 3.5em;
21 min-width: 0;
22 }
23
24 .diff-plus {
25 width: 24px;
26 padding: 0 2px;
27 }
28
29 .diff-code {
30 white-space: pre-wrap;
31 overflow-wrap: anywhere;
32 word-break: break-all;
33 min-width: 0;
34 }
35
36 .diff-line.hunk td {
37 white-space: pre-wrap;
38 }
39
40 .side-add {
41 background: var(--add-bg);
42 }
43
44 .diff-code.side-add {
45 color: var(--add-text);
46 }
47
48 .side-del {
49 background: var(--del-bg);
50 }
51
52 .diff-code.side-del {
53 color: var(--del-text);
54 }
55
56 .side-empty {
57 background: var(--surface-2);
58 }
59
60 .diff-code.side-dup,
61 .diff-code.side-ctx {
62 color: var(--text);
63 }
64
65 // The right half starts with a divider.
66 .diff-code + .diff-plus,
67 .diff-code + .diff-ln {
68 border-left: 1px solid var(--border-strong);
69 }
70
71 .diff-code:target {
72 background: var(--row-target);
73 }
74}
75
76// Phones: each split row stacks its old half over its new half; empty halves and the repeat of a
77// context line disappear, so nothing scrolls sideways.
78@media (max-width: 720px) {
79 .diff-table.diff-split {
80 display: block;
81 width: 100%;
82
83 tbody {
84 display: block;
85 }
86
87 tr.diff-split-row {
88 display: grid;
89 grid-template-columns: 3.5em minmax(0, 1fr);
90 }
91
92 &.anchored tr.diff-split-row {
93 grid-template-columns: 24px 3.5em minmax(0, 1fr);
94 }
95
96 .side-empty,
97 .side-dup {
98 display: none;
99 }
100
101 td.diff-ln,
102 td.diff-plus {
103 width: auto;
104 min-width: 0;
105 }
106
107 .diff-code + .diff-plus,
108 .diff-code + .diff-ln {
109 border-left: 0;
110 }
111
112 tr.diff-line.hunk,
113 tr.review-row {
114 display: block;
115 }
116
117 tr.diff-line.hunk td,
118 tr.review-row td {
119 display: block;
120 }
121 }
122}
123
124// Blob line selection.
125.file-table tr.line-hl td {
126 background: var(--row-target);
127}
128
129.file-table tr.line-hl .ln {
130 color: var(--text);
131 font-weight: 600;
132}
133
134.file-table .ln a {
135 display: block;
136 cursor: pointer;
137 color: var(--muted);
138}
139
140.file-actions .link-button {
141 font-size: inherit;
142 color: var(--text);
143 cursor: pointer;
144}
145
146// Blame.
147.blame-table {
148 .blame-meta {
149 position: sticky;
150 left: 0;
151 z-index: 2;
152 width: 22rem;
153 min-width: 16rem;
154 max-width: 22rem;
155 padding: 6px 12px;
156 font-family: var(--font);
157 font-size: 0.8125rem;
158 line-height: 1.35;
159 white-space: normal;
160 vertical-align: top;
161 background: var(--surface);
162 border-right: 1px solid var(--border);
163 border-top: 1px solid var(--border);
164 }
165
166 .blame-top {
167 display: flex;
168 align-items: baseline;
169 gap: 8px;
170 min-width: 0;
171 }
172
173 .blame-author {
174 min-width: 0;
175 overflow: hidden;
176 text-overflow: ellipsis;
177 white-space: nowrap;
178 font-weight: 500;
179 }
180
181 .blame-summary {
182 display: block;
183 overflow: hidden;
184 text-overflow: ellipsis;
185 white-space: nowrap;
186 color: var(--text-2);
187 }
188
189 .blame-prior {
190 display: inline-block;
191 margin-top: 2px;
192 }
193
194 tr.blame-first td:not(.blame-meta) {
195 border-top: 1px solid var(--border);
196 }
197
198 .ln {
199 left: 22rem;
200 }
201}
202
203@media (max-width: 720px) {
204 .blame-table {
205 .blame-meta {
206 position: static;
207 width: 12rem;
208 min-width: 12rem;
209 }
210
211 .ln {
212 left: 0;
213 position: static;
214 }
215 }
216}
217
218// File finder.
219.finder-open kbd,
220.finder-note kbd {
221 padding: 0 6px;
222 font-family: var(--mono);
223 font-size: 0.75rem;
224 color: var(--text-2);
225 background: var(--surface-2);
226 border: 1px solid var(--border-strong);
227 border-radius: var(--radius-sm);
228}
229
230.finder-open {
231 margin-left: auto;
232}
233
234dialog.finder {
235 width: min(640px, calc(100vw - 32px));
236 max-height: min(70vh, 560px);
237 margin: 10vh auto 0;
238 padding: 0;
239 color: var(--text);
240 background: var(--surface);
241 border: 1px solid var(--border-strong);
242 border-radius: var(--radius-lg);
243 box-shadow: var(--shadow);
244
245 &::backdrop {
246 background: rgba(20, 24, 22, 0.45);
247 }
248
249 &[open] {
250 display: flex;
251 flex-direction: column;
252 }
253}
254
255.finder-box {
256 display: flex;
257 flex-direction: column;
258 min-height: 0;
259 padding: 12px;
260 gap: 8px;
261}
262
263.finder-input {
264 flex: none;
265 width: 100%;
266 height: var(--control-h);
267 box-sizing: border-box;
268 font-size: 0.9375rem;
269}
270
271.finder-list {
272 margin: 0;
273 padding: 0;
274 list-style: none;
275 flex: 1 1 auto;
276 min-height: 0;
277 overflow-y: auto;
278 max-height: 50vh;
279 font-family: var(--mono);
280 font-size: 0.8125rem;
281
282 li {
283 margin: 0;
284 }
285
286 a {
287 display: block;
288 padding: 6px 10px;
289 color: var(--text);
290 text-decoration: none;
291 border-radius: var(--radius-sm);
292 overflow-wrap: anywhere;
293 }
294
295 li[aria-selected="true"] a {
296 background: var(--accent-soft);
297 }
298
299 a:hover {
300 background: var(--surface-2);
301 }
302
303 mark {
304 background: none;
305 color: var(--text);
306 font-weight: 700;
307 }
308}
309
310.finder-note {
311 margin: 0;
312}
313
314// Branches page.
315.new-branch {
316 margin: 0 0 12px;
317
318 > summary {
319 list-style: none;
320 cursor: pointer;
321
322 &::-webkit-details-marker {
323 display: none;
324 }
325 }
326}
327
328.button.small {
329 height: 28px;
330 padding: 0 10px;
331 font-size: 0.8125rem;
332}
333
334.confirm-inline {
335 display: inline-block;
336 max-width: 100%;
337 vertical-align: top;
338
339 > summary {
340 list-style: none;
341 cursor: pointer;
342
343 &::-webkit-details-marker {
344 display: none;
345 }
346 }
347
348}
349
350@media (max-width: 720px) {
351
352}