Skip to content

Commit b156a10

Browse files
committed
Fixes Commit Composer intrinsic height calculation for file diffs
1 parent f2953d3 commit b156a10

File tree

1 file changed

+14
-2
lines changed
  • src/webviews/apps/plus/composer/components/diff

1 file changed

+14
-2
lines changed

src/webviews/apps/plus/composer/components/diff/diff.css.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,14 @@ export const hljsStyles = css`
9999
export const diff2htmlStyles = css`
100100
:host {
101101
--d2h-intrinsic-base-height: 3.5rem; /* header height */
102+
--d2h-intrinsic-container-offset-height: 10px; /* 10px scrollbar height + 2px vertical borders */
102103
--d2h-intrinsic-line-count: 50;
103104
--d2h-intrinsic-line-height: calc(
104105
var(--editor-font-size) * 1.5
105-
); /* 1.8rem - line height, should be relative to font size, but still a fixed height */
106+
); /* 1.2rem (font) to 1.8rem (line height) ratio, but still fixed */
106107
--d2h-intrinsic-height: calc(
107-
var(--d2h-intrinsic-base-height) + (var(--d2h-intrinsic-line-height) * var(--d2h-intrinsic-line-count))
108+
var(--d2h-intrinsic-base-height) + (var(--d2h-intrinsic-line-height) * var(--d2h-intrinsic-line-count)) +
109+
var(--d2h-intrinsic-container-offset-height)
108110
);
109111
110112
display: block;
@@ -758,6 +760,16 @@ export const diffStyles = css`
758760
padding-block: 0;
759761
line-height: var(--d2h-intrinsic-line-height);
760762
}
763+
.d2h-code-line,
764+
.d2h-code-side-line {
765+
height: var(--d2h-intrinsic-line-height);
766+
overflow: hidden;
767+
vertical-align: top;
768+
}
769+
.d2h-file-diff {
770+
overflow-x: scroll;
771+
overflow-y: hidden;
772+
}
761773
.d2h-file-wrapper {
762774
margin-block-end: 0;
763775
}

0 commit comments

Comments
 (0)