@@ -348,10 +348,36 @@ Available context:
348
348
349
349
- ` section ` : The [ DocstringSection] [ griffe.docstrings.dataclasses.DocstringSection ] instance (see ` DocstringSection* ` subclasses).
350
350
351
- ## Style recommendations
351
+ ### Syntax highlight in signatures
352
+
353
+ You can customize the colors in syntax highlighted signatures.
354
+ If you are using the [ Material for MkDocs] theme,
355
+ here are some customization examples:
352
356
353
- <a id =" recommended-style-material " ></a >
357
+ ``` css
358
+ /* Fancier color for operators such as * and |. */
359
+ .doc-signature .o {
360
+ color : var (--md-code-hl-special-color );
361
+ }
354
362
363
+ /* Fancier color for constants such as None, True, and False. */
364
+ .doc-signature .kc {
365
+ color : var (--md-code-hl-constant-color );
366
+ }
367
+
368
+ /* Fancier color for built-in types (only useful when cross-references are used). */
369
+ .doc-signature .n > a [href ^= " https://docs.python.org/" ][href *= " /functions.html#" ],
370
+ .doc-signature .n > a [href ^= " https://docs.python.org/" ][href *= " /stdtypes.html#" ] {
371
+ color : var (--md-code-hl-constant-color );
372
+ }
373
+ ```
374
+
375
+ For other themes, use their own CSS variables,
376
+ or use plain colors such as ` violet ` or ` #2987f2 ` .
377
+
378
+ ## Style recommendations
379
+
380
+ [ ] ( ) {#recommended-style-material}
355
381
### Material
356
382
357
383
Here are some CSS rules for the [ Material for MkDocs] theme:
@@ -360,8 +386,7 @@ Here are some CSS rules for the [Material for MkDocs] theme:
360
386
--8<-- "docs/css/mkdocstrings.css"
361
387
```
362
388
363
- <a id="recommended-style-readthedocs "> </a >
364
-
389
+ [](){#recommended-style-readthedocs }
365
390
### ReadTheDocs
366
391
367
392
Here are some CSS rules for the built-in ReadTheDocs theme:
0 commit comments