0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

MkDocsで拡張CSSを読み込ませるのにハマった話

Last updated at Posted at 2025-01-20

ハマった内容

拡張のCSSを定義しても読み込まないと思ったら、定義位置が違うことにず~~~~~~~~~っと気が付かずにハマってました。

同じような方がいれば、これを見て気が付いてもらえればと。。。

定義位置間違いの内容

×:設定していた内容

mkdocs.yml
theme:
  name: 'material'
  # --- ( 省略 ) ---
  extra_css:
    - css/extra.css

○:正しい内容

mkdocs.yml
theme:
  name: 'material'
  # --- ( 省略 ) ---

extra_css: # ←theme配下ではない点に注意
  - css/extra.css

補足

mkdocs-with-pdfでPDF作成時も拡張CSSを読み込んでくれることも確認済み!
PDF出力時に見出しのスタイル変更する場合は、templates/styles.scssで上書きできます。

参考サイト

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?