Skip to content

Commit 6a21ec5

Browse files
pure css
1 parent f010d73 commit 6a21ec5

9 files changed

+46
-16
lines changed

packages/react/src/components/DiffSplitContentLineWrap.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ const _DiffSplitLine = ({ index, diffFile, lineNumber }: { index: number; diffFi
126126
backgroundColor: newLineNumberBG,
127127
color: `var(${plainLineNumberColorName})`,
128128
borderLeftColor: `var(${borderColorName})`,
129+
borderLeftStyle: "solid",
129130
}}
130131
>
131132
{hasDiff && enableAddWidget && (
@@ -172,7 +173,11 @@ const _DiffSplitLine = ({ index, diffFile, lineNumber }: { index: number; diffFi
172173
) : (
173174
<td
174175
className="diff-line-new-placeholder select-none border-l-[1px]"
175-
style={{ backgroundColor: `var(${emptyBGName})`, borderLeftColor: `var(${borderColorName})` }}
176+
style={{
177+
backgroundColor: `var(${emptyBGName})`,
178+
borderLeftColor: `var(${borderColorName})`,
179+
borderLeftStyle: "solid",
180+
}}
176181
data-side={SplitSide[SplitSide.new]}
177182
colSpan={2}
178183
>

packages/react/src/components/DiffSplitExtendLineWrap.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,19 @@ const _DiffSplitExtendLine = ({
6969
{newExtendRendered ? (
7070
<td
7171
className="diff-line-extend-new-content border-l-[1px] p-0"
72-
style={{ borderLeftColor: `var(${borderColorName})` }}
72+
style={{ borderLeftColor: `var(${borderColorName})`, borderLeftStyle: "solid" }}
7373
colSpan={2}
7474
>
7575
<div className="diff-line-extend-wrapper">{newExtendRendered}</div>
7676
</td>
7777
) : (
7878
<td
7979
className="diff-line-extend-new-placeholder select-none border-l-[1px] p-0"
80-
style={{ backgroundColor: `var(${emptyBGName})`, borderLeftColor: `var(${borderColorName})` }}
80+
style={{
81+
backgroundColor: `var(${emptyBGName})`,
82+
borderLeftColor: `var(${borderColorName})`,
83+
borderLeftStyle: "solid",
84+
}}
8185
colSpan={2}
8286
>
8387
{oldExtendRendered && <span>&ensp;</span>}

packages/react/src/components/DiffSplitHunkLineWrap.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,12 @@ const DiffSplitHunkLineGitLab = ({
215215
</div>
216216
</td>
217217
<td
218-
className="diff-line-hunk-action relative w-[1%] min-w-[40px] select-none border-l-[1px] p-[1px] z-[1]"
218+
className="diff-line-hunk-action relative z-[1] w-[1%] min-w-[40px] select-none border-l-[1px] p-[1px]"
219219
style={{
220220
backgroundColor: `var(${hunkLineNumberBGName})`,
221221
color: `var(${plainLineNumberColorName})`,
222222
borderLeftColor: `var(${borderColorName})`,
223+
borderLeftStyle: "solid",
223224
}}
224225
>
225226
{couldExpand ? (

packages/react/src/components/DiffSplitWidgetLineWrap.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,18 @@ const _DiffSplitWidgetLine = ({
6666
<td
6767
className="diff-line-widget-new-content border-l-[1px] p-0"
6868
colSpan={2}
69-
style={{ borderLeftColor: `var(${borderColorName})` }}
69+
style={{ borderLeftColor: `var(${borderColorName})`, borderLeftStyle: "solid" }}
7070
>
7171
<div className="diff-line-widget-wrapper">{newWidgetRendered}</div>
7272
</td>
7373
) : (
7474
<td
7575
className="diff-line-widget-new-placeholder select-none border-l-[1px] p-0"
76-
style={{ backgroundColor: `var(${emptyBGName})`, borderLeftColor: `var(${borderColorName})` }}
76+
style={{
77+
backgroundColor: `var(${emptyBGName})`,
78+
borderLeftColor: `var(${borderColorName})`,
79+
borderLeftStyle: "solid",
80+
}}
7781
colSpan={2}
7882
>
7983
{oldWidgetRendered && <span>&ensp;</span>}

packages/vue/src/components/DiffSplitContentLineWrap.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ export const DiffSplitContentLine = defineComponent(
147147
backgroundColor: newLineNumberBG,
148148
color: `var(${plainLineNumberColorName})`,
149149
borderLeftColor: `var(${borderColorName})`,
150+
borderLeftStyle: "solid",
150151
}}
151152
>
152153
{hasDiff.value && enableAddWidget.value && (
@@ -193,7 +194,11 @@ export const DiffSplitContentLine = defineComponent(
193194
) : (
194195
<td
195196
class="diff-line-new-placeholder select-none border-l-[1px]"
196-
style={{ backgroundColor: `var(${emptyBGName})`, borderLeftColor: `var(${borderColorName})` }}
197+
style={{
198+
backgroundColor: `var(${emptyBGName})`,
199+
borderLeftColor: `var(${borderColorName})`,
200+
borderLeftStyle: "solid",
201+
}}
197202
colspan={2}
198203
>
199204
<span>&ensp;</span>

packages/vue/src/components/DiffSplitExtendLineWrap.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,18 @@ export const DiffSplitExtendLine = defineComponent(
8686
<td
8787
class="diff-line-extend-new-content border-l-[1px] p-0"
8888
colspan={2}
89-
style={{ borderLeftColor: `var(${borderColorName})` }}
89+
style={{ borderLeftColor: `var(${borderColorName})`, borderLeftStyle: "solid" }}
9090
>
9191
<div class="diff-line-extend-wrapper">{newExtendRendered}</div>
9292
</td>
9393
) : (
9494
<td
9595
class="diff-line-extend-new-placeholder select-none border-l-[1px] p-0"
96-
style={{ backgroundColor: `var(${emptyBGName})`, borderLeftColor: `var(${borderColorName})` }}
96+
style={{
97+
backgroundColor: `var(${emptyBGName})`,
98+
borderLeftColor: `var(${borderColorName})`,
99+
borderLeftStyle: "solid",
100+
}}
97101
colspan={2}
98102
>
99103
{oldExtendRendered && <span>&ensp;</span>}

packages/vue/src/components/DiffSplitHunkLineWrap.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ const DiffSplitHunkLineGitLab = defineComponent(
278278
backgroundColor: `var(${hunkLineNumberBGName})`,
279279
color: `var(${plainLineNumberColorName})`,
280280
borderLeftColor: `var(${borderColorName})`,
281+
borderLeftStyle: "solid",
281282
}}
282283
>
283284
{couldExpand.value ? (

packages/vue/src/components/DiffSplitWidgetLineWrap.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,18 @@ export const DiffSplitWidgetLine = defineComponent(
9090
<td
9191
class="diff-line-widget-new-content border-l-[1px] p-0"
9292
colspan={2}
93-
style={{ borderLeftColor: `var(${borderColorName})` }}
93+
style={{ borderLeftColor: `var(${borderColorName})`, borderLeftStyle: "solid" }}
9494
>
9595
<div class="diff-line-widget-wrapper">{newWidgetRendered}</div>
9696
</td>
9797
) : (
9898
<td
9999
class="diff-line-widget-new-placeholder select-none border-l-[1px] p-0"
100-
style={{ backgroundColor: `var(${emptyBGName})`, borderLeftColor: `var(${borderColorName})` }}
100+
style={{
101+
backgroundColor: `var(${emptyBGName})`,
102+
borderLeftColor: `var(${borderColorName})`,
103+
borderLeftStyle: "solid",
104+
}}
101105
colspan={2}
102106
>
103107
{oldWidgetRendered && <span>&ensp;</span>}

scripts/build.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ const external = (id: string) =>
1212
!id.endsWith(".css");
1313

1414
// fix css path not found in legacy module bundler
15-
const copyCss = async (packageName: string) => {
16-
const cssPath = resolve(process.cwd(), "packages", packageName, "dist", "css", "diff-view.css");
15+
const copyCss = async (packageName: string, file: string) => {
16+
const cssPath = resolve(process.cwd(), "packages", packageName, "dist", "css", file);
1717
const cssContent = await readFile(cssPath, "utf-8");
1818
const legacyCssDirPath = resolve(process.cwd(), "packages", packageName, "styles");
1919
await mkdir(legacyCssDirPath).catch(() => void 0);
20-
const cssDistPath = resolve(legacyCssDirPath, "diff-view.css");
20+
const cssDistPath = resolve(legacyCssDirPath, file);
2121
await writeFile(cssDistPath, cssContent);
2222
};
2323

@@ -90,7 +90,8 @@ const start = async () => {
9090
});
9191
await buildCss("react");
9292
await buildType("react");
93-
await copyCss("react");
93+
await copyCss("react", "diff-view.css");
94+
await copyCss("react", "diff-view-pure.css");
9495
// 对于 "jsx": "preserve" 最新的rollup已经不支持解析,因此使用vite来进行打包
9596
// https://github.com/rollup/plugins/issues/72
9697
// https://rollupjs.org/migration/#configuration-changes
@@ -101,7 +102,8 @@ const start = async () => {
101102
});
102103
await buildCss("vue");
103104
await buildType("vue");
104-
await copyCss("vue");
105+
await copyCss("vue", "diff-view.css");
106+
await copyCss("vue", "diff-view-pure.css");
105107
process.exit(0);
106108
};
107109

0 commit comments

Comments
 (0)