mirror of
https://github.com/go-gitea/gitea.git
synced 2025-11-06 21:00:52 +01:00
Backport #35777 by @silverwind 1. Add the color on the link to the referenced file, which is the more likely thing the user wants to click 2. Use monospace font on the SHA 3. Tweak text colors 4. Change SHA link to go to the commit instead of the repo root with commit filter set 5. Added the repo name to the file link text 6. Fix broken line numbering rendering The only major difference to GitHub is now the missing line numbers. Before: <img width="286" height="162" alt="Screenshot 2025-10-29 at 19 09 59" src="https://github.com/user-attachments/assets/f16b4eec-caf2-4c31-a2b5-ae5f41747d4b" /> After: <img width="378" height="157" alt="image" src="https://github.com/user-attachments/assets/0c91dfd3-0910-4b2d-a43b-8c87cfbb933e" /> For comparison, GitHub rendering: <img width="286" height="177" alt="image" src="https://github.com/user-attachments/assets/8a9a07b7-9153-4415-9d7a-5685853e472a" /> Co-authored-by: silverwind <me@silverwind.io>
38 lines
1.0 KiB
CSS
38 lines
1.0 KiB
CSS
.markup .code-preview-container {
|
|
border: 1px solid var(--color-secondary);
|
|
border-radius: var(--border-radius);
|
|
margin: 0.25em 0;
|
|
}
|
|
|
|
.markup .code-preview-container .code-preview-header {
|
|
color: var(--color-text-light-1);
|
|
border-bottom: 1px solid var(--color-secondary);
|
|
padding: 0.5em;
|
|
font-size: 12px;
|
|
}
|
|
|
|
.markup .code-preview-container table {
|
|
width: 100%;
|
|
max-height: 240px; /* 12 lines at 20px per line */
|
|
overflow-y: auto;
|
|
margin: 0; /* override ".markup table {margin}" */
|
|
}
|
|
|
|
/* workaround to hide empty p before container - more details are in "html_codepreview.go" */
|
|
.markup p:empty:has(+ .code-preview-container) {
|
|
display: none;
|
|
}
|
|
|
|
/* override the polluted styles from the content.css: ".markup table ..." */
|
|
.markup .code-preview-container table tr {
|
|
border: 0 !important;
|
|
}
|
|
.markup .code-preview-container table th,
|
|
.markup .code-preview-container table td {
|
|
border: 0 !important;
|
|
padding: 0 0 0 5px !important;
|
|
}
|
|
.markup .code-preview-container table tr:nth-child(2n) {
|
|
background: none !important;
|
|
}
|