Repository navigation
Expand file tree
/
Copy pathstyle.css
More file actions
560 lines (511 loc) · 16.4 KB
/
Copy pathstyle.css
File metadata and controls
560 lines (511 loc) · 16.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
/* ---------- tokens ---------- */
:root {
--bg: #0b0b0e;
--bg-raised: #111116;
--line: #26242e;
--fg: #eeecf2;
--text: #d5d3db;
--dim: #75727f;
--accent: #c792ff; /* light neon violet */
--accent-deep: #9d5cff;
--error: #ff5c8a;
--critical: #ff6ee6;
--warn: #ffcb6b;
--info: #82aaff;
--code-kw: #b5b1c0; /* keywords, yaml keys */
--code-str: #b8a8d8; /* strings, literals: desaturated accent */
--glow: 0 0 2px rgb(199 146 255 / 0.9), 0 0 10px rgb(170 100 255 / 0.7), 0 0 26px rgb(150 70 255 / 0.45);
--font: "Noto Sans Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
--measure: 760px;
color-scheme: dark;
}
/* ---------- base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
margin: 0;
background-color: var(--bg);
/* faint dot grid */
background-image: radial-gradient(rgb(255 255 255 / 0.055) 1px, transparent 1px);
background-size: 22px 22px;
color: var(--text);
font-family: var(--font);
font-weight: 200;
font-size: 16px;
line-height: 1.7;
-webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--bg); }
a,
.features details:not([open]) h3 {
color: var(--accent);
text-decoration: none;
border-bottom: 1px dashed rgb(199 146 255 / 0.45);
}
a:hover,
.features details:not([open]) > summary:hover h3 { border-bottom-style: solid; border-bottom-color: var(--accent); text-shadow: var(--glow); }
/* in-text link that doesn't stand out: body colour, dashed underline */
.quiet { color: inherit; border-bottom-color: var(--dim); }
.quiet:hover { color: var(--fg); border-bottom-color: var(--fg); text-shadow: none; }
/* a link that looks exactly like the text it wraps, such as a flag in <code>;
only hovering shows it is a link */
.plain { color: inherit; border-bottom: 0; }
.plain:hover { color: inherit; border-bottom: 1px solid var(--fg); text-shadow: none; }
a:focus-visible,
button:focus-visible,
summary:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }
code {
font-family: inherit;
font-weight: 400;
color: var(--fg);
}
strong { font-weight: 500; color: var(--fg); }
.dim { color: var(--dim); }
.wrap {
width: 100%;
max-width: calc(var(--measure) + 48px);
margin: 0 auto;
padding: 0 24px;
}
main.wrap { padding-bottom: 48px; }
/* ---------- site header: page tabs ---------- */
.site-header {
position: sticky;
top: 0;
z-index: 10;
background: rgb(17 17 22 / 0.88);
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
border-bottom: 1px solid var(--line);
}
.nav { display: flex; gap: 28px; font-size: 14px; }
.nav a {
position: relative;
padding: 13px 0;
color: var(--text);
border: 0;
}
.nav a:hover { color: var(--accent); }
.nav a[aria-current="page"] { color: var(--accent); text-shadow: var(--glow); }
.nav a[aria-current="page"]::after {
content: "";
position: absolute;
left: 0;
right: 0;
bottom: -1px;
height: 2px;
background: var(--accent);
box-shadow: var(--glow);
}
/* ---------- hero ---------- */
.hero { padding: 36px 0 0; }
.brand, .brand:hover { border: 0; }
.logo {
display: block;
width: min(320px, 72vw);
height: auto;
}
.slogan {
margin: 20px 0 0;
font-weight: 200;
font-size: clamp(21px, 3.6vw, 28px);
line-height: 1.3;
letter-spacing: -0.02em;
color: var(--fg);
}
.slogan em { font-style: normal; font-weight: 300; color: var(--accent); white-space: nowrap; text-shadow: var(--glow); }
/* ---------- sections ---------- */
section { padding: 24px 0; }
#why { padding: 36px 0 16px; }
h2 {
margin: 0 0 14px;
font-size: 15px;
font-weight: 600;
letter-spacing: 0.02em;
color: var(--fg);
}
h2 .hash { color: var(--accent); text-shadow: var(--glow); }
section > p { margin: 0 0 16px; max-width: 66ch; }
/* features: diff-style "+" lines, each a <details> that flips to "-" when open */
.features {
list-style: none;
margin: 0;
padding: 0;
display: grid;
gap: 14px;
line-height: 1.6;
}
.features li {
position: relative;
padding-left: 2.2ch;
}
.features summary {
list-style: none;
cursor: pointer;
}
.features summary::-webkit-details-marker { display: none; }
.features summary::before {
content: "+";
position: absolute;
left: 0;
top: 0;
color: var(--accent);
font-weight: 400;
text-shadow: var(--glow);
}
.features details[open] > summary::before { content: "-"; }
.features h3 {
display: inline;
margin: 0;
font-size: 16px;
font-weight: 500;
color: var(--fg);
}
.features details:not([open]) h3 { font-weight: inherit; }
.features p { margin: 0; }
.features code { white-space: nowrap; }
/* backers */
.backers {
list-style: none;
margin: 0;
padding: 0;
display: flex;
flex-wrap: wrap;
gap: 8px 28px;
}
.backers li::before { content: "./"; color: var(--dim); }
.backers li.dim::before { content: ""; }
/* social channels: one short paragraph, as wide as the main column */
#social > p { max-width: none; }
/* ---------- terminal / tabs ---------- */
.term {
border: 1px solid var(--line);
background: var(--bg-raised);
}
.tabs {
display: flex;
flex-wrap: wrap;
border-bottom: 1px solid var(--line);
}
.tabs button {
appearance: none;
background: none;
border: 0;
border-right: 1px solid var(--line);
margin: 0;
padding: 10px 18px;
font: inherit;
font-size: 14px;
color: var(--dim);
cursor: pointer;
position: relative;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] {
color: var(--fg);
font-weight: 400;
background: var(--bg);
}
.tabs button[aria-selected="true"]::after {
content: "";
position: absolute;
left: 0;
right: 0;
top: -1px;
height: 2px;
background: var(--accent);
box-shadow: var(--glow);
}
.tabs button[aria-selected="true"]::before { content: "> "; color: var(--accent); }
.panel {
position: relative;
background: var(--bg);
}
pre {
margin: 0;
padding: 20px 18px;
overflow-x: auto;
font-size: 14px;
line-height: 1.75;
}
pre code { font-weight: 300; color: var(--fg); }
pre .c { color: var(--dim); font-weight: 200; }
pre .p { color: var(--accent); user-select: none; text-shadow: var(--glow); }
.copy {
position: absolute;
top: 10px;
right: 10px;
appearance: none;
border: 0;
background: var(--bg);
color: var(--dim);
font: inherit;
font-size: 12px;
padding: 2px 6px;
cursor: pointer;
}
.copy:hover { color: var(--fg); }
.copy.done { color: var(--accent); }
.copy::before { content: "["; }
.copy::after { content: "]"; }
.note {
margin: 0;
padding: 0 18px 20px;
font-size: 14px;
}
/* ---------- source ---------- */
.repo {
display: inline-block;
padding: 14px 20px;
border: 1px solid var(--line);
background: var(--bg-raised);
color: var(--fg);
font-size: 14px;
font-weight: 300;
line-height: 1.75;
overflow-wrap: anywhere;
}
/* same type as the install commands; only the url keeps the link colour */
.repo strong { color: var(--accent); font-weight: inherit; }
.repo .p { color: var(--accent); text-shadow: var(--glow); }
.repo:hover { border-color: var(--accent-deep); border-bottom-style: solid; }
.stats {
margin: 14px 0 0;
font-size: 13px;
font-weight: 300;
color: var(--text);
display: flex;
gap: 24px;
}
/* subpage title next to the logo: "Opengrep: about" */
.crumb {
--logo-w: min(320px, 46vw);
margin: 0;
font-size: calc(var(--logo-w) * 0.16);
font-weight: 200;
/* 0 so the logo alone sets the line height: the logo then sits exactly
where it does on the home page, and the text keeps its baseline */
line-height: 0;
letter-spacing: -0.02em;
color: var(--fg);
white-space: nowrap;
}
.crumb .logo {
display: inline-block;
width: var(--logo-w);
/* sit the wordmark's baseline (77.5% down the svg) on the text baseline */
vertical-align: calc(var(--logo-w) * -0.0387);
}
.crumb .sep { margin: 0 0.16em 0 0.22em; color: var(--accent); text-shadow: var(--glow); }
/* ---------- about page ---------- */
.lede { margin: 20px 0 0; max-width: 66ch; }
.notes code { white-space: nowrap; }
.features .langs { margin-bottom: 8px; line-height: 1.9; }
.langs > span { white-space: nowrap; }
.langs > span:not(:last-child)::after { content: " · "; color: var(--dim); }
.star { color: var(--accent); font-weight: 400; text-shadow: var(--glow); }
.langs-note { color: var(--dim); }
/* ---------- examples page ---------- */
.example > p { margin: 0 0 16px; max-width: 66ch; }
.file {
position: relative;
margin: 0 0 14px;
border: 1px solid var(--line);
background: var(--bg);
}
.file-head {
padding: 7px 14px;
border-bottom: 1px solid var(--line);
background: var(--bg-raised);
font-size: 13px;
color: var(--fg);
}
.file-head .dim { margin-left: 1ch; }
.file .copy { top: 5px; background: none; }
pre.code { padding: 14px 0; counter-reset: ln; }
pre.code code { display: block; min-width: max-content; }
pre.code .line { display: block; padding: 0 18px 0 0; }
pre.code .line::before {
counter-increment: ln;
content: counter(ln);
display: inline-block;
width: 5ch;
padding-right: 2ch;
text-align: right;
color: var(--dim);
font-weight: 200;
}
pre.code .hit { background: rgb(199 146 255 / 0.09); box-shadow: inset 2px 0 0 var(--accent); }
pre.code .hit::before { color: var(--accent); }
/* syntax: structure recedes to grey, strings take a faint violet, rule wildcards the accent */
pre .k { color: var(--code-kw); }
pre .s { color: var(--code-str); }
pre.code .c { color: var(--dim); }
pre .mv { color: var(--accent); font-weight: 400; }
pre.out .b { font-weight: 500; }
pre.out .err { color: var(--error); }
pre.out .crit { color: var(--critical); }
pre.out .warn { color: var(--warn); }
pre.out .info { color: var(--info); }
pre.out .rule { color: var(--accent); }
pre.out .n { color: var(--dim); }
.notes { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.notes li { display: grid; grid-template-columns: 9ch 1fr; }
.notes .ref { color: var(--accent); }
.notes.flags li { grid-template-columns: 30ch 1fr; }
/* ---------- docs ---------- */
/* The text sits in the site's own column, the middle one, so it starts right
under the nav as on every other page; the contents tree hangs in the left
margin. Below 1300px the margin is too narrow, and the tree folds into a
"contents" toggle above the text. */
.docs-layout {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, calc(var(--measure) + 48px)) minmax(0, 1fr);
align-items: start;
padding-top: 32px;
padding-bottom: 64px;
}
.docs-main { grid-column: 2; grid-row: 1; min-width: 0; padding: 0 24px; }
/* sidebar: filter and contents tree; sticks below the site header and only the tree scrolls */
.docs-side {
grid-column: 1;
grid-row: 1;
justify-self: end;
width: min(260px, calc(100% - 40px));
margin-right: 8px;
position: sticky;
top: 76px;
font-size: 13px;
line-height: 1.6;
}
.docs-toc > summary { display: none; }
.docs-filter {
width: 100%;
margin: 0 0 12px;
padding: 5px 10px;
border: 1px solid var(--line);
border-radius: 0;
background: var(--bg);
color: var(--fg);
font: inherit;
outline: none;
}
.docs-filter:focus { border-color: var(--accent-deep); }
.toc {
position: relative;
max-height: calc(100vh - 140px);
overflow-y: auto;
padding-right: 8px;
scrollbar-width: thin;
scrollbar-color: var(--line) transparent;
}
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc > ul > li { margin: 0 0 4px; }
.toc a { display: block; padding: 1px 0; border: 0; color: var(--text); overflow-wrap: anywhere; }
.toc a:hover { color: var(--accent); text-shadow: none; }
.toc a[aria-current="page"] { color: var(--accent); text-shadow: var(--glow); }
.toc .top,
.toc summary { position: relative; padding-left: 2ch; }
.toc .top a,
.toc summary a { color: var(--fg); font-weight: 400; text-transform: lowercase; }
.toc summary { list-style: none; cursor: pointer; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::before { content: "+"; position: absolute; left: 0; top: 1px; color: var(--accent); font-weight: 400; }
.toc details[open] > summary::before { content: "-"; }
.toc details ul { margin: 2px 0 8px 0.5ch; padding-left: 1.5ch; border-left: 1px solid var(--line); }
/* page */
/* the overview's "Opengrep / docs" heading, at the height the other pages have theirs */
.docs-main > .hero { padding-top: 4px; margin-bottom: 20px; }
.docs-crumb { margin: 0 0 6px; font-size: 13px; color: var(--dim); text-transform: lowercase; }
.docs-crumb a { color: var(--dim); border-bottom-color: var(--line); }
.docs-crumb a:hover { color: var(--fg); border-bottom-color: var(--fg); text-shadow: none; }
.docs-main h1:not(.crumb) {
margin: 0 0 22px;
font-size: clamp(22px, 3vw, 28px);
font-weight: 300;
line-height: 1.3;
letter-spacing: -0.01em;
color: var(--fg);
}
.docs-main h1 code { font-weight: inherit; }
/* flags and names stay on one line ("--" never splits); long code with spaces may wrap */
.docs-main :not(pre) > code { white-space: nowrap; }
.docs-main :not(pre) > code.long { white-space: normal; }
.docs-main h2 { margin: 40px 0 14px; font-size: 16px; }
.docs-main h3 { margin: 28px 0 12px; font-size: 15px; font-weight: 500; color: var(--fg); }
.docs-main .hash { border: 0; color: var(--accent); text-shadow: var(--glow); }
.docs-main h3 .hash { color: var(--dim); text-shadow: none; }
.docs-main .hash:hover { color: var(--accent); }
.docs-main :is(h2, h3) { scroll-margin-top: 72px; }
.docs-main > p,
.docs-main > ul,
.docs-main > ol { margin: 0 0 16px; max-width: 72ch; }
.docs-main ul { list-style: none; padding-left: 2.2ch; }
.docs-main ul > li { position: relative; }
.docs-main ul > li::before { content: "-"; position: absolute; left: -2.2ch; color: var(--accent); font-weight: 400; }
.docs-main ol { padding-left: 3ch; }
.docs-main ol > li::marker { color: var(--accent); }
.docs-main li + li { margin-top: 4px; }
.docs-main li p { margin: 0 0 8px; }
.docs-main blockquote { margin: 0 0 20px; padding: 2px 0 2px 14px; border-left: 2px solid var(--accent-deep); }
.docs-main blockquote p { margin: 0; }
/* the facts under a title: accepted by, value, default, ... */
.facts {
display: grid;
gap: 4px;
margin: 0 0 24px;
padding: 12px 16px;
border: 1px solid var(--line);
background: var(--bg-raised);
font-size: 14px;
}
.facts div { display: grid; grid-template-columns: 13ch 1fr; gap: 2ch; }
.facts dt { color: var(--dim); }
.facts dd { margin: 0; }
.table-wrap { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--line); }
.docs-main table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.55; }
.docs-main th,
.docs-main td { padding: 7px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.docs-main th { background: var(--bg-raised); color: var(--fg); font-weight: 500; }
.docs-main tr:last-child td { border-bottom: 0; }
.docs-main td:first-child code { white-space: nowrap; }
/* the environment variables under a flag in the flags index, as quiet as the cells beside them */
.docs-main td br ~ code { color: inherit; font-weight: inherit; }
.docs-main .file { margin: 0 0 16px; }
pre.snip { padding: 14px 18px; }
.console pre.out code { color: var(--text); }
pre.out .cmd { color: var(--fg); font-weight: 400; }
@media (max-width: 1299px) {
.docs-layout { padding-top: 20px; row-gap: 24px; }
.docs-side { grid-column: 2; justify-self: stretch; width: auto; margin: 0; padding: 0 24px; position: static; }
.docs-main { grid-row: 2; }
.toc { max-height: 60vh; }
.docs-toc { border: 1px solid var(--line); background: var(--bg-raised); padding: 8px 14px; }
.docs-toc > summary { display: block; position: relative; padding-left: 2ch; color: var(--fg); cursor: pointer; list-style: none; }
.docs-toc > summary::-webkit-details-marker { display: none; }
.docs-toc > summary::before { content: "+"; position: absolute; left: 0; color: var(--accent); }
.docs-toc[open] > summary { margin-bottom: 10px; }
.docs-toc[open] > summary::before { content: "-"; }
}
@media (max-width: 900px) {
.facts div { grid-template-columns: 1fr; gap: 0; }
.notes.flags li { grid-template-columns: 1fr; }
}
/* ---------- small screens ---------- */
@media (max-width: 600px) {
.wrap { padding: 0 16px; }
.hero { padding: 28px 0 0; }
.slogan { margin-top: 24px; }
.tabs button { padding: 10px 12px; font-size: 13px; }
pre { padding: 16px 14px; font-size: 13px; }
.repo { font-size: 13px; }
.panel .copy + pre { padding-top: 34px; }
.copy { top: 6px; right: 6px; }
.file .copy { top: 4px; }
.nav { gap: 22px; }
.notes li { grid-template-columns: 1fr; }
.docs-main,
.docs-side { padding: 0 16px; }
}