|
136 | 136 | border: 1px solid var(--border); |
137 | 137 | } |
138 | 138 |
|
| 139 | +/* ── Language identity: distinguish Jac from Python code blocks ── |
| 140 | + Works without any markup changes: `pygments_lang_class: true` stamps each |
| 141 | + rendered fence with `language-jac` / `language-python` on the .highlight |
| 142 | + wrapper. Jac gets the Jaseci-orange identity; Python stays neutral. */ |
| 143 | + |
| 144 | +/* Static (non-interactive) blocks: accent left border + corner badge */ |
| 145 | +.md-typeset .highlight.language-jac, |
| 146 | +.md-typeset .highlight.language-python { |
| 147 | + position: relative; |
| 148 | + border-left: 3px solid var(--border); |
| 149 | + border-radius: 4px; |
| 150 | +} |
| 151 | +.md-typeset .highlight.language-jac { |
| 152 | + border-left-color: var(--primary); |
| 153 | +} |
| 154 | + |
| 155 | +.md-typeset .highlight.language-jac::before, |
| 156 | +.md-typeset .highlight.language-python::before { |
| 157 | + position: absolute; |
| 158 | + top: 0; |
| 159 | + right: 0; |
| 160 | + z-index: 1; |
| 161 | + font: 600 0.62rem/1 var(--font-family-code); |
| 162 | + letter-spacing: 0.08em; |
| 163 | + padding: 0.3rem 0.5rem; |
| 164 | + border-bottom-left-radius: 4px; |
| 165 | + pointer-events: none; |
| 166 | +} |
| 167 | +.md-typeset .highlight.language-jac::before { |
| 168 | + content: "JAC"; |
| 169 | + color: var(--primary); |
| 170 | + background: var(--md-accent-bg-color); |
| 171 | +} |
| 172 | +.md-typeset .highlight.language-python::before { |
| 173 | + content: "PY"; |
| 174 | + color: var(--text-muted); |
| 175 | + background: rgba(255, 255, 255, 0.04); |
| 176 | +} |
| 177 | + |
| 178 | +/* Make room for the badge: nudge Material's copy button left of it */ |
| 179 | +.md-typeset .highlight.language-jac > .md-clipboard, |
| 180 | +.md-typeset .highlight.language-python > .md-clipboard { |
| 181 | + right: 2.6rem; |
| 182 | +} |
| 183 | + |
| 184 | +/* Interactive blocks already carry a toolbar + Monaco editor, so they don't |
| 185 | + need the overlay badge. Identity is marked on the wrapper border (see the |
| 186 | + .code-block component rule below); here we just suppress the inner static |
| 187 | + treatment to avoid doubling up. */ |
| 188 | +.code-block .highlight.language-jac, |
| 189 | +.code-block .highlight.language-python { |
| 190 | + border-left: none; |
| 191 | + border-radius: 0; |
| 192 | +} |
| 193 | +.code-block .highlight.language-jac::before, |
| 194 | +.code-block .highlight.language-python::before { |
| 195 | + display: none; |
| 196 | +} |
| 197 | +.code-block .highlight.language-jac > .md-clipboard, |
| 198 | +.code-block .highlight.language-python > .md-clipboard { |
| 199 | + right: 0.5rem; |
| 200 | +} |
| 201 | + |
139 | 202 | /* ── Jac Code Block Component ── */ |
140 | 203 | .code-block { |
141 | 204 | margin: 1.2em 0; |
142 | 205 | padding: 0; |
143 | 206 | background: #0d1117; |
144 | 207 | color: #c9d1d9; |
145 | 208 | border: 1px solid #21262d; |
| 209 | + border-left: 3px solid var(--border); |
146 | 210 | border-radius: 6px; |
147 | 211 | overflow: hidden; |
148 | 212 | transition: border-color 0.2s ease, box-shadow 0.2s ease; |
149 | 213 | } |
150 | 214 |
|
| 215 | +/* Jac identity on interactive blocks (Python interactive blocks stay neutral) */ |
| 216 | +.code-block[data-lang="jac"] { |
| 217 | + border-left-color: var(--primary); |
| 218 | +} |
| 219 | + |
151 | 220 | .code-block.jcb-running { |
152 | 221 | border-color: #f0883e; |
153 | 222 | } |
|
0 commit comments