Skip to content

Commit 55282f8

Browse files
authored
Merge pull request #7 from hirano00o/fix/scrollbar-and-table-margin
fix: はてなブログでのスクロールバー幅縮小・テーブル末尾余白を修正
2 parents 4cd0c0d + a3c2e6f commit 55282f8

7 files changed

Lines changed: 18 additions & 8 deletions

File tree

dist/git-code-embed-dark.min.js

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/git-code-embed-light.min.js

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/git-code-embed.min.js

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "git-code-embed",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"description": "Embed GitHub code snippets with syntax highlighting in blog posts",
55
"main": "dist/git-code-embed.min.js",
66
"scripts": {

src/styles.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ ${THEME_COLORS}
192192
@supports (scrollbar-color: auto) {
193193
.gce-container .gce-code-wrap {
194194
scrollbar-color: var(--gce-scrollbar-thumb) var(--gce-code-bg);
195-
scrollbar-width: thin;
195+
scrollbar-width: auto;
196196
}
197197
}
198198
@@ -208,6 +208,7 @@ ${THEME_COLORS}
208208
border-collapse: collapse;
209209
width: 100%;
210210
display: table;
211+
margin: 0;
211212
}
212213
213214
.gce-container .gce-table td.gce-lineno {

test/styles.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,16 @@ describe("CSS (テーマ: light)", () => {
175175
expect(match![1]).toContain("color: var(--gce-code-text)");
176176
});
177177

178+
it(".gce-table に margin: 0 を含む", () => {
179+
const match = CSS.match(/\.gce-container \.gce-table \{([^}]*)\}/);
180+
expect(match).not.toBeNull();
181+
expect(match![1]).toContain("margin: 0");
182+
});
183+
178184
it("scrollbar-color サポートブラウザ向けの @supports ブロックを含む", () => {
179185
expect(CSS).toContain("@supports (scrollbar-color: auto)");
180186
expect(CSS).toContain("scrollbar-color: var(--gce-scrollbar-thumb) var(--gce-code-bg)");
181-
expect(CSS).toContain("scrollbar-width: thin");
187+
expect(CSS).toContain("scrollbar-width: auto");
182188
});
183189

184190
it("scrollbar-color 非対応ブラウザ向けの @supports not ブロックに webkit ルールを含む", () => {

0 commit comments

Comments
 (0)