Skip to content

fix: はてなブログでのスクロールバー幅縮小・テーブル末尾余白を修正#7

Merged
hirano00o merged 4 commits intomainfrom
fix/scrollbar-and-table-margin
Mar 12, 2026
Merged

fix: はてなブログでのスクロールバー幅縮小・テーブル末尾余白を修正#7
hirano00o merged 4 commits intomainfrom
fix/scrollbar-and-table-margin

Conversation

@hirano00o
Copy link
Owner

概要

はてなブログにスクリプトを埋め込んだ際に発生する2つのスタイル問題を修正。

問題と修正

問題1: スクロールバーの幅が小さい

Chrome 121+ は @supports (scrollbar-color: auto) ブロックに入るため scrollbar-width: thin(約8px)が適用され、ドラッグしにくい状態になっていた。

scrollbar-width: auto に変更してブラウザデフォルト幅(約15px)を維持する。

問題2: 最終行と外枠の余白

はてなブログのグローバル CSS が table 要素に margin-bottom: 1em 等を付与しており、.gce-table にも適用されてスクロール領域内の末尾に余白が生じていた。

.gce-container .gce-tablemargin: 0 を明示して外部 CSS を打ち消す。

変更ファイル

ファイル 変更内容
src/styles.ts scrollbar-width: thinauto.gce-tablemargin: 0 追加
test/styles.test.ts テスト値更新 + margin: 0 を検証するテストケース追加

テスト

  • npm test: 100 tests passed
  • npm run build: 成功

Chrome 121+ は @supports (scrollbar-color: auto) に入るため scrollbar-width: thin
が適用され、スクロールバーが約8pxに縮小していた。auto に変更してブラウザデフォルト
(約15px)を維持する。

また、はてなブログの table { margin-bottom: 1em } が .gce-table にも適用され、
スクロール領域内の末尾に余白が生じていた。margin: 0 を明示して外部CSSを打ち消す。
はてなブログ対応のバグ修正(テーブル末尾余白)が退行しないよう保護する。
@hirano00o hirano00o merged commit 55282f8 into main Mar 12, 2026
1 check passed
@hirano00o hirano00o deleted the fix/scrollbar-and-table-margin branch March 12, 2026 06:47
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