Migration This is my new public git source viewer. Source coming soon. Please contact with concerns/bugs. Contact me

static/css/blob.css

4bda28df3ab3dbfcc789dcbbb184cabc8cac9398 · 5.0 KB · 168 lines raw

1 /* Blob view — numbered source lines. Owned by views/blob.html */
2
3 .source {
4 margin: .75rem 0;
5 background: var(--surface-2);
6 border: 1px solid var(--line);
7 border-radius: var(--r-sm);
8 overflow-x: auto;
9 }
10 .source table { border-collapse: collapse; font-size: .8rem; }
11 .source tr:target { background: rgba(167, 139, 250, 0.18); }
12 .source .ln {
13 padding: 0 .75rem;
14 text-align: right;
15 color: var(--fg-subtle);
16 user-select: none;
17 white-space: nowrap;
18 border-right: 1px solid var(--line);
19 }
20 .source .ln a { color: inherit; }
21 .source .lc {
22 padding: 0 .75rem;
23 white-space: pre;
24 width: 100%;
25 }
26
27 /* Syntax highlighting, set by internal/modules/highlight.go. Tokens without
28 a mapped class (punctuation, operators, plain names) are left uncoloured. */
29 .source .tok-k { color: var(--syn-kw); }
30 .source .tok-s { color: var(--syn-str); }
31 .source .tok-n { color: var(--syn-num); }
32 .source .tok-fn { color: var(--syn-fn); }
33 .source .tok-c { color: var(--fg-subtle); font-style: italic; }
34
35 /* JSON/YAML: a parse-error banner, and per-level indent guides set by
36 internal/modules/structured.go. Width is inlined per span since the
37 indent unit (2 vs 4 spaces) varies by file. */
38 .notice-warn { border-left-color: var(--del); }
39 .source .ind {
40 display: inline-block;
41 border-left: 1px solid var(--line-soft);
42 height: 1.2em;
43 vertical-align: text-top;
44 }
45
46 /* Fold controls. The chevron lives in the gutter, but the gutter reserves
47 its width on every row -- otherwise line numbers jog sideways down the
48 file depending on which lines happen to open a block. */
49 .source.foldable .ln { position: relative; padding-left: 1.5rem; }
50 .source .fold {
51 position: absolute;
52 left: .15rem;
53 top: 0;
54 width: 1.1rem;
55 padding: 0;
56 border: 0;
57 background: none;
58 color: var(--fg-subtle);
59 font: inherit;
60 line-height: inherit;
61 cursor: pointer;
62 }
63 .source .fold::before { content: "▾"; display: block; }
64 .source .fold[aria-expanded="false"]::before { content: "▸"; }
65 .source .fold:hover { color: var(--accent); }
66 .source tr.is-collapsed .lc::after {
67 content: " " attr(data-fold-note);
68 color: var(--fg-subtle);
69 }
70 .source tr.is-hidden { display: none; }
71
72 /* Search state. Matches are marked at row level: rewriting the cell to wrap
73 hits in <mark> would destroy the highlight spans underneath. */
74 .source tr.is-match { background: rgba(167, 139, 250, 0.10); }
75 .source tr.is-current { background: rgba(167, 139, 250, 0.28); }
76
77 /* YAML anchors and aliases, resolved in internal/modules/structured.go. */
78 .source .aref {
79 margin-left: .6rem;
80 padding: 0 .3rem;
81 border: 1px solid var(--line-soft);
82 border-radius: var(--r-sm);
83 color: var(--fg-muted);
84 font-size: .9em;
85 text-decoration: none;
86 white-space: nowrap;
87 }
88 .source .aref:hover { color: var(--accent); border-color: var(--accent); }
89 .source .anchor-uses {
90 margin-left: .6rem;
91 color: var(--fg-subtle);
92 font-size: .85em;
93 }
94
95 /* Toolbar, built at runtime by static/js/structured.js -- a page without JS
96 never shows it. */
97 .sbar {
98 display: flex;
99 flex-wrap: wrap;
100 align-items: center;
101 gap: .4rem;
102 margin-top: .75rem;
103 }
104 .sbar-q {
105 flex: 1 1 14rem;
106 min-width: 0;
107 padding: .3rem .5rem;
108 background: var(--surface);
109 border: 1px solid var(--line);
110 border-radius: var(--r-sm);
111 color: var(--fg);
112 font: inherit;
113 font-size: .8rem;
114 }
115 .sbar-q:focus { outline: none; border-color: var(--accent); }
116 .sbar-count {
117 min-width: 5.5rem;
118 color: var(--fg-subtle);
119 font-size: .75rem;
120 text-align: right;
121 }
122 .sbar-scope { display: flex; }
123 .sbar-scope button,
124 .sbar-btn {
125 padding: .3rem .55rem;
126 background: var(--surface);
127 border: 1px solid var(--line);
128 color: var(--fg-muted);
129 font: inherit;
130 font-size: .75rem;
131 cursor: pointer;
132 }
133 .sbar-scope button { border-radius: 0; margin-left: -1px; }
134 .sbar-scope button:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); margin-left: 0; }
135 .sbar-scope button:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
136 .sbar-btn { border-radius: var(--r-sm); }
137 .sbar-scope button:hover,
138 .sbar-btn:not(:disabled):hover { color: var(--fg); border-color: var(--line-soft); }
139 .sbar-scope button[aria-pressed="true"],
140 .sbar-btn[aria-pressed="true"] {
141 color: var(--accent);
142 border-color: var(--accent);
143 }
144 .sbar-btn:disabled { opacity: .45; cursor: default; }
145
146 /* Image preview. The bytes come from /raw/, which serves validated raster
147 formats inline; the frame keeps a large image from widening the page and
148 the checkerboard keeps a transparent PNG legible in both themes. */
149 .blob-image {
150 margin: .75rem 0;
151 padding: .75rem;
152 background: var(--surface-2);
153 border: 1px solid var(--line);
154 border-radius: var(--r-sm);
155 text-align: center;
156 overflow: auto;
157 }
158 .blob-image img {
159 max-width: 100%;
160 height: auto;
161 background-image:
162 linear-gradient(45deg, var(--line-soft) 25%, transparent 25%),
163 linear-gradient(-45deg, var(--line-soft) 25%, transparent 25%),
164 linear-gradient(45deg, transparent 75%, var(--line-soft) 75%),
165 linear-gradient(-45deg, transparent 75%, var(--line-soft) 75%);
166 background-size: 16px 16px;
167 background-position: 0 0, 0 8px, 8px -8px, -8px 0;
168 }