Skip to content

Commit 9a3feb6

Browse files
committed
style(css): Use custom --argparse-code-background variable
Replace overrides of Furo's --color-inline-code-background with a custom --argparse-code-background variable (#272822 monokai) to avoid affecting other inline code styling on the site.
1 parent 3eae0dd commit 9a3feb6

1 file changed

Lines changed: 6 additions & 16 deletions

File tree

docs/_static/css/argparse-highlight.css

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -278,29 +278,19 @@ pre.argparse-usage {
278278
========================================================================== */
279279

280280
/*
281-
* Light mode overrides
282-
* Use monokai background (#272822) to match code blocks.
281+
* Argparse-specific code background (monokai #272822)
282+
* Uses a custom variable to avoid affecting Furo's --color-inline-code-background.
283283
*/
284-
body:not([data-theme="dark"]) {
285-
--color-inline-code-background: #272822;
286-
}
287-
288-
/*
289-
* Dark mode overrides (respects prefers-color-scheme)
290-
* Use monokai background (#272822) to match code blocks.
291-
*/
292-
@media (prefers-color-scheme: dark) {
293-
body:not([data-theme="light"]) {
294-
--color-inline-code-background: #272822;
295-
}
284+
:root {
285+
--argparse-code-background: #272822;
296286
}
297287

298288
/*
299289
* Background styling for argument names - subtle background like code.literal
300290
* This provides visual weight and hierarchy for argument definitions.
301291
*/
302292
.argparse-argument-name {
303-
background: var(--color-inline-code-background);
293+
background: var(--argparse-code-background);
304294
border-radius: .2rem;
305295
padding: .325rem .6rem;
306296
font-family: var(--font-stack--monospace);
@@ -356,7 +346,7 @@ body:not([data-theme="dark"]) .argparse-argument-name .headerlink:hover:not(:vis
356346
* Styled like inline code with monokai background.
357347
*/
358348
.argparse-argument-meta .nv {
359-
background: var(--color-inline-code-background);
349+
background: var(--argparse-code-background);
360350
border-radius: .2rem;
361351
padding: .325rem .6rem;
362352
font-family: var(--font-stack--monospace);

0 commit comments

Comments
 (0)