How to add custom css file to Sphinx?

前端 未结 4 510
故里飘歌
故里飘歌 2020-12-02 15:25

How I can add custom css file? The following config does not work for me:

# conf.py
html_static_path = [\'_static\']
html_theme = \'default\'
html_theme_opti         


        
4条回答
  •  一向
    一向 (楼主)
    2020-12-02 15:55

    I'm using Sphinx 3.2.

    I was able to add some simple custom CSS by doing the following:

    • add this line in conf.py right under html_static_path = ['_static']:
    html_css_files = ['css/custom.css']
    
    • go to docs/_static/ and add css/custom.css

    • add custom css to your file then $ make html

    Source

提交回复
热议问题