// Code browsing: the diff toolbar and split view, blob line selection, blame, the file finder and // the branches page. // Diff toolbar: unified/split segment, ignore whitespace, patch downloads. .diff-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 0 0 12px; } // Split view: two sides per row, code wraps instead of scrolling sideways. .diff-table.diff-split { width: 100%; table-layout: fixed; .diff-ln { position: static; width: 3.5em; min-width: 0; } .diff-plus { width: 24px; padding: 0 2px; } .diff-code { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-all; min-width: 0; } .diff-line.hunk td { white-space: pre-wrap; } .side-add { background: var(--add-bg); } .diff-code.side-add { color: var(--add-text); } .side-del { background: var(--del-bg); } .diff-code.side-del { color: var(--del-text); } .side-empty { background: var(--surface-2); } .diff-code.side-dup, .diff-code.side-ctx { color: var(--text); } // The right half starts with a divider. .diff-code + .diff-plus, .diff-code + .diff-ln { border-left: 1px solid var(--border-strong); } .diff-code:target { background: var(--row-target); } } // Phones: each split row stacks its old half over its new half; empty halves and the repeat of a // context line disappear, so nothing scrolls sideways. @media (max-width: 720px) { .diff-table.diff-split { display: block; width: 100%; tbody { display: block; } tr.diff-split-row { display: grid; grid-template-columns: 3.5em minmax(0, 1fr); } &.anchored tr.diff-split-row { grid-template-columns: 24px 3.5em minmax(0, 1fr); } .side-empty, .side-dup { display: none; } td.diff-ln, td.diff-plus { width: auto; min-width: 0; } .diff-code + .diff-plus, .diff-code + .diff-ln { border-left: 0; } tr.diff-line.hunk, tr.review-row { display: block; } tr.diff-line.hunk td, tr.review-row td { display: block; } } } // Blob line selection. .file-table tr.line-hl td { background: var(--row-target); } .file-table tr.line-hl .ln { color: var(--text); font-weight: 600; } .file-table .ln a { display: block; cursor: pointer; color: var(--muted); } // Blame. .blame-table { .blame-meta { position: sticky; left: 0; z-index: 2; width: 22rem; min-width: 16rem; max-width: 22rem; padding: 6px 12px; font-family: var(--font); font-size: 0.8125rem; line-height: 1.35; white-space: normal; vertical-align: top; background: var(--surface); border-right: 1px solid var(--border); border-top: 1px solid var(--border); } .blame-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; } .blame-author { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; } .blame-summary { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); } .blame-prior { display: inline-block; margin-top: 2px; } tr.blame-first td:not(.blame-meta) { border-top: 1px solid var(--border); } .ln { left: 22rem; } } @media (max-width: 720px) { .blame-table { .blame-meta { position: static; width: 12rem; min-width: 12rem; } .ln { left: 0; position: static; } } } // File finder. .finder-open kbd, .finder-note kbd { padding: 0 6px; font-family: var(--mono); font-size: 0.75rem; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); } .finder-open { margin-left: auto; } dialog.finder { width: min(640px, calc(100vw - 32px)); max-height: min(70vh, 560px); margin: 10vh auto 0; padding: 0; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow); &::backdrop { background: rgba(20, 24, 22, 0.45); } &[open] { display: flex; flex-direction: column; } } .finder-box { display: flex; flex-direction: column; min-height: 0; padding: 12px; gap: 8px; } .finder-input { flex: none; width: 100%; height: var(--control-h); box-sizing: border-box; font-size: 0.9375rem; } .finder-list { margin: 0; padding: 0; list-style: none; flex: 1 1 auto; min-height: 0; overflow-y: auto; max-height: 50vh; font-family: var(--mono); font-size: 0.8125rem; li { margin: 0; } a { display: block; padding: 6px 10px; color: var(--text); text-decoration: none; border-radius: var(--radius-sm); overflow-wrap: anywhere; } li[aria-selected="true"] a { background: var(--accent-soft); } a:hover { background: var(--surface-2); } mark { background: none; color: var(--text); font-weight: 700; } } .finder-note { margin: 0; } // Branches page. .new-branch { margin: 0 0 12px; > summary { list-style: none; cursor: pointer; &::-webkit-details-marker { display: none; } } } .button.small { height: 28px; padding: 0 10px; font-size: 0.8125rem; } .confirm-inline { display: inline-block; max-width: 100%; vertical-align: top; > summary { list-style: none; cursor: pointer; &::-webkit-details-marker { display: none; } } }