EOL 警告バナーが sticky ヘッダに隠れないようにする#228
Merged
Merged
Conversation
#rurema-topbar は「body の余白(上 20px・左右 2%)を負マージンで 突き破って全幅化する」設計で、自分が body の先頭要素である前提に なっている。EOL 警告バナー(--eol-warning)はその前に挿入されるため、 topbar の margin-top -20px がバナーの下部に食い込み、文言の下半分 (折り返し時は2行目のほぼ全部)が隠れていた。 バナーにも topbar と同じ余白の突き破りを適用する。バナーの margin-bottom 20px が topbar の margin-top -20px と相殺されるので、 topbar はバナーの真下に密着する。バナーの無いページでは従来どおり topbar 自身の負マージンが body の余白を打ち消すため影響しない。 Fixes rurema#227 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
解決したい問題
Fixes #227
旧バージョンのページで、EOL 警告バナーの下部が sticky ヘッダ(
#rurema-topbar)に隠れていました(1行なら文言の下半分、折り返し時は2行目のほぼ全部)。
原因
#rurema-topbarは「body の余白(上 20px・左右 2%)を負マージン(
margin: -20px -2% 1em)で突き破って全幅化する」設計で、自分が body の先頭要素である前提になっています。
#215 の EOL バナーはその前に挿入されるため、topbar の
margin-top: -20pxがバナーの下部 20px に食い込んでいました。
変更内容
.eol-warningにも topbar と同じ「余白の突き破り」を適用します(CSS のみの変更)。.eol-warning { background-color: #aa3333; color: white; - padding: 0.4em; - margin: 0; + padding: 0.4em 2%; + margin: -20px -2% 20px; }マージン相殺の計算:
margin-top: 20px× バナーの-20px→ バナーがビューポート上端に密着(左右
-2%で全幅化+padding側 2% で文字位置は本文と揃う)margin-bottom: 20px× topbar の-20px→ topbar がバナーの真下に密着影響ありません
🤖 Generated with Claude Code