From f41f72804be9f69b65564670a7134069c6e43897 Mon Sep 17 00:00:00 2001 From: hirano00o Date: Thu, 12 Mar 2026 15:28:12 +0900 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20=E3=81=AF=E3=81=A6=E3=81=AA=E3=83=96?= =?UTF-8?q?=E3=83=AD=E3=82=B0=E3=81=A7=E3=81=AE=E3=82=B9=E3=82=AF=E3=83=AD?= =?UTF-8?q?=E3=83=BC=E3=83=AB=E3=83=90=E3=83=BC=E5=B9=85=E7=B8=AE=E5=B0=8F?= =?UTF-8?q?=E3=83=BB=E3=83=86=E3=83=BC=E3=83=96=E3=83=AB=E6=9C=AB=E5=B0=BE?= =?UTF-8?q?=E4=BD=99=E7=99=BD=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Chrome 121+ は @supports (scrollbar-color: auto) に入るため scrollbar-width: thin が適用され、スクロールバーが約8pxに縮小していた。auto に変更してブラウザデフォルト (約15px)を維持する。 また、はてなブログの table { margin-bottom: 1em } が .gce-table にも適用され、 スクロール領域内の末尾に余白が生じていた。margin: 0 を明示して外部CSSを打ち消す。 --- dist/git-code-embed.min.js | 3 ++- src/styles.ts | 3 ++- test/styles.test.ts | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dist/git-code-embed.min.js b/dist/git-code-embed.min.js index d51844b..e871018 100644 --- a/dist/git-code-embed.min.js +++ b/dist/git-code-embed.min.js @@ -173,7 +173,7 @@ ${It} @supports (scrollbar-color: auto) { .gce-container .gce-code-wrap { scrollbar-color: var(--gce-scrollbar-thumb) var(--gce-code-bg); - scrollbar-width: thin; + scrollbar-width: auto; } } @@ -189,6 +189,7 @@ ${It} border-collapse: collapse; width: 100%; display: table; + margin: 0; } .gce-container .gce-table td.gce-lineno { diff --git a/src/styles.ts b/src/styles.ts index 5cc759b..3c9695e 100644 --- a/src/styles.ts +++ b/src/styles.ts @@ -192,7 +192,7 @@ ${THEME_COLORS} @supports (scrollbar-color: auto) { .gce-container .gce-code-wrap { scrollbar-color: var(--gce-scrollbar-thumb) var(--gce-code-bg); - scrollbar-width: thin; + scrollbar-width: auto; } } @@ -208,6 +208,7 @@ ${THEME_COLORS} border-collapse: collapse; width: 100%; display: table; + margin: 0; } .gce-container .gce-table td.gce-lineno { diff --git a/test/styles.test.ts b/test/styles.test.ts index bd521ff..703c27d 100644 --- a/test/styles.test.ts +++ b/test/styles.test.ts @@ -178,7 +178,7 @@ describe("CSS (テーマ: light)", () => { it("scrollbar-color サポートブラウザ向けの @supports ブロックを含む", () => { expect(CSS).toContain("@supports (scrollbar-color: auto)"); expect(CSS).toContain("scrollbar-color: var(--gce-scrollbar-thumb) var(--gce-code-bg)"); - expect(CSS).toContain("scrollbar-width: thin"); + expect(CSS).toContain("scrollbar-width: auto"); }); it("scrollbar-color 非対応ブラウザ向けの @supports not ブロックに webkit ルールを含む", () => { From e97c8b2b2822dec5bff38ac974e94890871fb8ce Mon Sep 17 00:00:00 2001 From: hirano00o Date: Thu, 12 Mar 2026 15:30:01 +0900 Subject: [PATCH 2/4] Upgrade version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1400594..26ee896 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "git-code-embed", - "version": "0.2.0", + "version": "0.2.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "git-code-embed", - "version": "0.2.0", + "version": "0.2.1", "devDependencies": { "@types/node": "^24.12.0", "esbuild": "^0.27.3", diff --git a/package.json b/package.json index 6e4e7c4..54c5be7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "git-code-embed", - "version": "0.2.0", + "version": "0.2.1", "description": "Embed GitHub code snippets with syntax highlighting in blog posts", "main": "dist/git-code-embed.min.js", "scripts": { From 4d16e12dc9037887f40f21a3f3fe94bcd05c99fc Mon Sep 17 00:00:00 2001 From: hirano00o Date: Thu, 12 Mar 2026 15:33:24 +0900 Subject: [PATCH 3/4] =?UTF-8?q?test:=20.gce-table=20=E3=81=AE=20margin:=20?= =?UTF-8?q?0=20=E3=82=92=E6=A4=9C=E8=A8=BC=E3=81=99=E3=82=8B=E3=83=86?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit はてなブログ対応のバグ修正(テーブル末尾余白)が退行しないよう保護する。 --- test/styles.test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/styles.test.ts b/test/styles.test.ts index 703c27d..09fc1b1 100644 --- a/test/styles.test.ts +++ b/test/styles.test.ts @@ -175,6 +175,12 @@ describe("CSS (テーマ: light)", () => { expect(match![1]).toContain("color: var(--gce-code-text)"); }); + it(".gce-table に margin: 0 を含む", () => { + const match = CSS.match(/\.gce-container \.gce-table \{([^}]*)\}/); + expect(match).not.toBeNull(); + expect(match![1]).toContain("margin: 0"); + }); + it("scrollbar-color サポートブラウザ向けの @supports ブロックを含む", () => { expect(CSS).toContain("@supports (scrollbar-color: auto)"); expect(CSS).toContain("scrollbar-color: var(--gce-scrollbar-thumb) var(--gce-code-bg)"); From a3c2e6f7a8aa551819fbdf467d4ddd2bf3316741 Mon Sep 17 00:00:00 2001 From: hirano00o Date: Thu, 12 Mar 2026 15:46:13 +0900 Subject: [PATCH 4/4] Update artifacts --- dist/git-code-embed-dark.min.js | 3 ++- dist/git-code-embed-light.min.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dist/git-code-embed-dark.min.js b/dist/git-code-embed-dark.min.js index 9c08558..d61a879 100644 --- a/dist/git-code-embed-dark.min.js +++ b/dist/git-code-embed-dark.min.js @@ -173,7 +173,7 @@ ${It} @supports (scrollbar-color: auto) { .gce-container .gce-code-wrap { scrollbar-color: var(--gce-scrollbar-thumb) var(--gce-code-bg); - scrollbar-width: thin; + scrollbar-width: auto; } } @@ -189,6 +189,7 @@ ${It} border-collapse: collapse; width: 100%; display: table; + margin: 0; } .gce-container .gce-table td.gce-lineno { diff --git a/dist/git-code-embed-light.min.js b/dist/git-code-embed-light.min.js index d85ae06..49525bb 100644 --- a/dist/git-code-embed-light.min.js +++ b/dist/git-code-embed-light.min.js @@ -173,7 +173,7 @@ ${It} @supports (scrollbar-color: auto) { .gce-container .gce-code-wrap { scrollbar-color: var(--gce-scrollbar-thumb) var(--gce-code-bg); - scrollbar-width: thin; + scrollbar-width: auto; } } @@ -189,6 +189,7 @@ ${It} border-collapse: collapse; width: 100%; display: table; + margin: 0; } .gce-container .gce-table td.gce-lineno {