fix: Line numbers when scrolling

This commit is contained in:
Rodrigo Fernandes 2019-05-01 13:17:03 +01:00
parent 6a02f2dd22
commit 4418f5f00a
No known key found for this signature in database
GPG key ID: C5DD1B4104382F6B

View file

@ -74,11 +74,6 @@
font-size: 13px; font-size: 13px;
} }
.d2h-diff-tbody > tr > td {
height: 20px;
line-height: 1;
}
.d2h-files-diff { .d2h-files-diff {
display: block; display: block;
width: 100%; width: 100%;
@ -86,7 +81,6 @@
} }
.d2h-file-diff { .d2h-file-diff {
overflow-x: scroll;
overflow-y: hidden; overflow-y: hidden;
} }
@ -102,13 +96,15 @@
.d2h-code-line { .d2h-code-line {
display: inline-block; display: inline-block;
white-space: nowrap; white-space: nowrap;
padding: 0 10px; /* Compensate for the absolute positioning of the line numbers */
padding: 0 8em;
} }
.d2h-code-side-line { .d2h-code-side-line {
display: inline-block; display: inline-block;
white-space: nowrap; white-space: nowrap;
padding: 0 10px; /* Compensate for the absolute positioning of the line numbers */
padding: 0 4.5em;
} }
.d2h-code-line del, .d2h-code-line del,
@ -149,26 +145,27 @@
.line-num1 { .line-num1 {
box-sizing: border-box; box-sizing: border-box;
float: left; float: left;
width: 40px; width: 3.5em;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
padding-left: 3px; padding: 0 0.5em 0 0.5em;
} }
.line-num2 { .line-num2 {
box-sizing: border-box; box-sizing: border-box;
float: right; float: right;
width: 40px; width: 3.5em;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
padding-left: 3px; padding: 0 0.5em 0 0.5em;
} }
.d2h-code-linenumber { .d2h-code-linenumber {
box-sizing: border-box; box-sizing: border-box;
width: 86px; width: 7.5em;
padding-left: 2px; /* Keep the numbers fixed on line contents scroll */
padding-right: 2px; position: absolute;
display: inline-block;
background-color: #fff; background-color: #fff;
color: rgba(0, 0, 0, 0.3); color: rgba(0, 0, 0, 0.3);
text-align: right; text-align: right;
@ -177,11 +174,16 @@
cursor: pointer; cursor: pointer;
} }
.d2h-code-linenumber:after {
content: '\200b';
}
.d2h-code-side-linenumber { .d2h-code-side-linenumber {
/* Keep the numbers fixed on line contents scroll */
position: absolute;
display: inline-block;
box-sizing: border-box; box-sizing: border-box;
width: 56px; width: 4em;
padding-left: 5px;
padding-right: 5px;
background-color: #fff; background-color: #fff;
color: rgba(0, 0, 0, 0.3); color: rgba(0, 0, 0, 0.3);
text-align: right; text-align: right;
@ -192,6 +194,10 @@
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.d2h-code-side-linenumber:after {
content: '\200b';
}
.d2h-code-side-emptyplaceholder, .d2h-code-side-emptyplaceholder,
.d2h-emptyplaceholder { .d2h-emptyplaceholder {
background-color: #f1f1f1; background-color: #f1f1f1;