Not really. It’s easier to ask users to add CSS themselves — either
via EXTRA_HEAD_DATA, files/assets/custom.css, or their own CSS files
(if applicable). This is the easiest and sanest option, because while
you could modify EXTRA_HEAD_DATA programmatically or use the
oft-forgotten template hooks mechanism to add your own things, most
people won’t like it (hard to customize, performance hit).
You also couldn’t do it reliably on per-post basis, because the output
from the compiler (reST/Markdown/…) may end up on multiple pages (at
least 2 in default setup, possibly even more with *_ARE_INDEXES
settings), and those pages may contain multiple posts with the desired
CSS.
(If you are writing a custom blog template, you can make a conditional
inclusion like we do for MathJax.)
--
Chris Warrick <
https://chriswarrick.com/>
PGP: 5EAAEA16