It does not seem possible (let alone trivial) to inject CSS or JS content from a sphinx extension, not without serious contorsions anyway:
It's easy to do for the project owner by editing
It's specifically supported for theme authors using
For an extension however I have not found it, the only hook I've managed to dig is connecting to
html-page-context and injecting stuff inline in
context['metatags'], which feels like a hack and a misuse of the hook. On top of that, it forces the content inline and prevent minimization by sphinx (not that sphinx does minification at the moment, as far as I know) or styles and scripts being injected only where relevant (that is, on documents where the directive or role they're working with was used).