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

static/css/blob.css

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