Skip to content

Commit 6c0f84d

Browse files
disable scrollbar
1 parent fabf8da commit 6c0f84d

13 files changed

Lines changed: 71 additions & 14 deletions

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"prettier": "^3.2.4",
3535
"project-tool": "https://github.com/MrWangJustToDo/project-tool.git",
3636
"rollup-plugin-postcss": "^4.0.2",
37+
"tailwind-scrollbar-hide": "^1.1.7",
3738
"tailwindcss": "^3.4.1",
3839
"ts-node": "^10.9.2",
3940
"tslib": "^2.6.2",

packages/react/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
"autoprefixer": "^10.4.16",
6969
"postcss": "^8.4.33",
7070
"react": "^18.0.0",
71+
"tailwind-scrollbar-hide": "^1.1.7",
7172
"tailwindcss": "^3.4.1"
7273
},
7374
"peerDependencies": {

packages/react/src/components/DiffSplitViewNormal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export const DiffSplitViewNormal = memo(({ diffFile }: { diffFile: DiffFile }) =
7272
return (
7373
<div className="split-diff-view split-diff-view-wrap w-full flex basis-[50%]">
7474
<div
75-
className="old-diff-table-wrapper overflow-auto w-full"
75+
className="old-diff-table-wrapper overflow-auto w-full scrollbar-hide scrollbar-disable"
7676
ref={ref1}
7777
style={{
7878
overscrollBehaviorX: "none",
@@ -84,7 +84,7 @@ export const DiffSplitViewNormal = memo(({ diffFile }: { diffFile: DiffFile }) =
8484
</div>
8585
<div className="diff-split-line w-[1.5px] bg-[#ccc]" />
8686
<div
87-
className="new-diff-table-wrapper overflow-auto w-full"
87+
className="new-diff-table-wrapper overflow-auto w-full scrollbar-hide scrollbar-disable"
8888
ref={ref2}
8989
style={{
9090
overscrollBehaviorX: "none",

packages/react/src/components/DiffUnifiedView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export const DiffUnifiedView = memo(({ diffFile }: { diffFile: DiffFile }) => {
6060
<DiffWidgetContext.Provider value={contextValue}>
6161
<div className="unified-diff-view w-full">
6262
<div
63-
className="unified-diff-table-wrapper overflow-auto w-full"
63+
className="unified-diff-table-wrapper overflow-auto w-full scrollbar-hide scrollbar-disable"
6464
style={{ fontFamily: "Menlo, Consolas, monospace", fontSize: "var(--diff-font-size--)" }}
6565
>
6666
<table className="unified-diff-table border-collapse w-full">

packages/react/src/tailwind.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@
2121
--diff-hunk-content-color--: #777777;
2222
}
2323

24+
/* For Webkit-based browsers (Chrome, Safari and Opera) */
25+
.scrollbar-disable::-webkit-scrollbar {
26+
display: none;
27+
}
28+
29+
/* For IE, Edge and Firefox */
30+
.scrollbar-disable {
31+
-ms-overflow-style: none; /* IE and Edge */
32+
scrollbar-width: none; /* Firefox */
33+
}
34+
2435
.diff-style-root tr {
2536
content-visibility: auto;
2637
}

packages/react/tailwind.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ module.exports = {
44
theme: {
55
extend: {},
66
},
7-
plugins: [],
7+
plugins: [require("tailwind-scrollbar-hide")],
88
};

packages/vue/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
"@vitejs/plugin-vue-jsx": "^3.1.0",
5959
"autoprefixer": "^10.4.16",
6060
"postcss": "^8.4.33",
61+
"tailwind-scrollbar-hide": "^1.1.7",
6162
"tailwindcss": "^3.4.1",
6263
"vite": "^5.0.12",
6364
"vite-plugin-dts": "^3.7.1",

packages/vue/src/components/DiffSplitViewNormal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export const DiffSplitViewNormal = defineComponent(
113113
return (
114114
<div class="split-diff-view split-diff-view-wrap w-full flex basis-[50%]">
115115
<div
116-
class="old-diff-table-wrapper overflow-auto w-full"
116+
class="old-diff-table-wrapper overflow-auto w-full scrollbar-hide"
117117
ref={ref1}
118118
style={{
119119
overscrollBehaviorX: "none",
@@ -125,7 +125,7 @@ export const DiffSplitViewNormal = defineComponent(
125125
</div>
126126
<div class="diff-split-line w-[1.5px] bg-[#ccc]" />
127127
<div
128-
class="new-diff-table-wrapper overflow-auto w-full"
128+
class="new-diff-table-wrapper overflow-auto w-full scrollbar-hide"
129129
ref={ref2}
130130
style={{
131131
overscrollBehaviorX: "none",

packages/vue/src/components/DiffUnifiedView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const DiffUnifiedView = ({ diffFile }: { diffFile: DiffFile }) => {
2525
return (
2626
<div class="unified-diff-view w-full">
2727
<div
28-
class="unified-diff-table-wrapper overflow-auto w-full"
28+
class="unified-diff-table-wrapper overflow-auto w-full scrollbar-hide"
2929
style={{ fontFamily: "Menlo, Consolas, monospace", fontSize: "var(--diff-font-size--)" }}
3030
>
3131
<table class="unified-diff-table border-collapse w-full">

packages/vue/tailwind.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ export default {
44
theme: {
55
extend: {},
66
},
7-
plugins: [],
7+
plugins: [require("tailwind-scrollbar-hide")],
88
};

0 commit comments

Comments
 (0)