Skip to content

連番の箇条書きの字下げを中黒にそろえる - #186

Merged
ma91n merged 1 commit into
future-architect:masterfrom
ma91n:style/ol-indent
Sep 17, 2026
Merged

ma91n merged 1 commit into
future-architect:masterfrom
ma91n:style/ol-indent

Conversation

@ma91n

@ma91n ma91n commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

連番(1. 2. …)の箇条書きだけ、本文の左端が中黒より 28px 右にずれていました。

何が起きていたか

#174 で li の字下げを ul / ol 側の padding へ移すとき、クラス付きの ol を取り逃していました。

セレクタ 詳細度 margin-left
.rst-content section ol.arabic li(テーマ) クラス2・要素3 24px
.rst-content section ol li(#174) クラス1・要素3 0

reST の連番は種類ごとにクラスが付きます(arabic / loweralpha / upperroman など)。ol[class] li の形にして、どの種類でも当たるようにします。

残る 4px は意図です

これで差は 4px になります(中黒 374px / 連番 378px)。中黒は「1.」より字が細く、同じ空きだと広く見えるので、ブログは中黒側の余白だけ狭くしています(0.15em 対 0.4em)。マーカーは右揃えで置かれるため、見た目の空きはそろい、本文の左端が 4px ずれるという形です。

そろえたい場合は、中黒の余白を連番と同じ 0.4em にすれば本文の左端は一致します(そのぶん中黒と本文の空きは広く見えます)。

🤖 Generated with Claude Code

future-architect#174 で li の字下げを ul / ol の padding へ移すとき、クラス付きの ol を
取り逃していた(テーマの ol.arabic li が詳細度で勝っていた)。
reST の連番は種類ごとにクラスが付くので ol[class] li の形で当てる。

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ma91n
ma91n merged commit 20c618f into future-architect:master Sep 17, 2026
2 checks passed
@ma91n
ma91n deleted the style/ol-indent branch September 17, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant