Skip to content

Commit f9e8b38

Browse files
committed
rework and simplify view-raw styles
1 parent 9336f57 commit f9e8b38

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

templates/repo/settings/lfs_file.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
{{else if .IsPlainText}}
2020
<pre>{{if .FileContent}}{{.FileContent | Safe}}{{end}}</pre>
2121
{{else if not .IsTextFile}}
22-
<div class="view-raw ui center{{if .IsPDFFile}} gt-p-0{{end}}">
22+
<div class="view-raw">
2323
{{if .IsImageFile}}
2424
<img src="{{$.RawFileLink}}">
2525
{{else if .IsVideoFile}}

templates/repo/view_file.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
{{else if .IsPlainText}}
7474
<pre>{{if .FileContent}}{{.FileContent | Safe}}{{end}}</pre>
7575
{{else if not .IsTextSource}}
76-
<div class="view-raw ui center{{if .IsPDFFile}} gt-p-0{{end}}">
76+
<div class="view-raw">
7777
{{if .IsImageFile}}
7878
<img src="{{$.RawFileLink}}">
7979
{{else if .IsVideoFile}}

web_src/css/repo.css

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -393,22 +393,25 @@
393393
cursor: default;
394394
}
395395

396-
.repository.file.list .non-diff-file-content .view-raw {
397-
padding: 5px;
396+
.view-raw {
397+
display: flex;
398+
justify-content: center;
399+
align-items: center;
398400
}
399401

400-
.repository.file.list .non-diff-file-content .view-raw > * {
402+
.view-raw > * {
401403
max-width: 100%;
402-
border: 1px solid var(--color-secondary);
403404
}
404405

405-
.repository.file.list .non-diff-file-content .view-raw img {
406+
.view-raw audio,
407+
.view-raw video,
408+
.view-raw img {
406409
margin: 1rem 0;
407410
border-radius: 0;
408411
object-fit: contain;
409412
}
410413

411-
.repository.file.list .non-diff-file-content .view-raw img[src$=".svg" i] {
414+
.view-raw img[src$=".svg" i] {
412415
max-height: 600px !important;
413416
max-width: 600px !important;
414417
}
@@ -448,6 +451,11 @@
448451
padding: 5px !important;
449452
}
450453

454+
.non-diff-file-content .attached.segment,
455+
.non-diff-file-content .pdfobject {
456+
border-radius: 0 0 var(--border-radius) var(--border-radius);
457+
}
458+
451459
.repository.file.list .sidebar {
452460
padding-left: 0;
453461
}

0 commit comments

Comments
 (0)