| Earl Lee | 2e463fb | 2025-04-17 11:22:22 -0700 | [diff] [blame^] | 1 | /* Custom styles for diff2 view */ |
| 2 | |
| 3 | /* Override container max-width for diff2 view */ |
| 4 | #diff2View .diff-container { |
| 5 | max-width: 100%; |
| 6 | width: 100%; |
| 7 | } |
| 8 | |
| 9 | /* When diff2 view is active, allow container to expand to full width */ |
| 10 | .container.diff2-active, |
| 11 | .timeline-container.diff-active { |
| 12 | max-width: 100%; |
| 13 | padding-left: 20px; |
| 14 | padding-right: 20px; |
| 15 | } |
| 16 | |
| 17 | /* Fix line-height inheritance issue */ |
| 18 | .d2h-code-line, |
| 19 | .d2h-code-line-ctn, |
| 20 | .d2h-code-linenumber { |
| 21 | line-height: 1.4 !important; |
| 22 | } |
| 23 | |
| 24 | /* Make diff2 file container use the full width */ |
| 25 | .d2h-file-wrapper { |
| 26 | width: 100%; |
| 27 | margin-bottom: 20px; |
| 28 | } |
| 29 | |
| 30 | /* Make side-by-side view use the full width */ |
| 31 | .d2h-file-side-diff { |
| 32 | width: 50% !important; |
| 33 | } |
| 34 | |
| 35 | /* Style for diff lines - for both side-by-side and unified views */ |
| 36 | .d2h-code-line, |
| 37 | .d2h-code-side-line { |
| 38 | transition: background-color 0.2s; |
| 39 | position: relative; |
| 40 | } |
| 41 | |
| 42 | .d2h-code-line:hover, |
| 43 | .d2h-code-side-line:hover { |
| 44 | background-color: #e6f7ff !important; |
| 45 | } |
| 46 | |
| 47 | /* Plus button styles for commenting */ |
| 48 | .d2h-gutter-comment-button { |
| 49 | display: none; |
| 50 | position: absolute; |
| 51 | right: 0; /* Adjusted from -11px to prevent layout shifts */ |
| 52 | top: 50%; |
| 53 | transform: translateY(-50%); |
| 54 | width: 22px; |
| 55 | height: 22px; |
| 56 | background-color: #0366d6; |
| 57 | color: white; |
| 58 | border-radius: 50%; |
| 59 | text-align: center; |
| 60 | line-height: 20px; |
| 61 | font-size: 16px; |
| 62 | font-weight: bold; |
| 63 | cursor: pointer; |
| 64 | box-shadow: 0 1px 3px rgba(0,0,0,0.2); |
| 65 | opacity: 0.9; |
| 66 | z-index: 100; |
| 67 | user-select: none; |
| 68 | } |
| 69 | |
| 70 | .d2h-gutter-comment-button:hover { |
| 71 | background-color: #0256bd; |
| 72 | opacity: 1; |
| 73 | } |
| 74 | |
| 75 | /* Show the plus button on row hover (including line number and code) and when hovering over the button itself */ |
| 76 | tr:hover .d2h-gutter-comment-button, |
| 77 | .d2h-gutter-comment-button:hover { |
| 78 | display: block; |
| 79 | } |
| 80 | |
| 81 | /* Ensure diff2html content uses all available space */ |
| 82 | .diff2html-content { |
| 83 | width: 100%; |
| 84 | overflow-x: auto; |
| 85 | } |
| 86 | |
| 87 | /* Diff view controls */ |
| 88 | #diff-view-controls { |
| 89 | display: flex; |
| 90 | justify-content: flex-end; |
| 91 | padding: 10px; |
| 92 | background-color: #f5f5f5; |
| 93 | border-bottom: 1px solid #ddd; |
| 94 | } |
| 95 | |
| 96 | .diff-view-format { |
| 97 | display: flex; |
| 98 | gap: 15px; |
| 99 | } |
| 100 | |
| 101 | .diff-view-format label { |
| 102 | display: flex; |
| 103 | align-items: center; |
| 104 | gap: 5px; |
| 105 | cursor: pointer; |
| 106 | font-size: 14px; |
| 107 | user-select: none; |
| 108 | } |
| 109 | |
| 110 | .diff-view-format input[type="radio"] { |
| 111 | margin: 0; |
| 112 | cursor: pointer; |
| 113 | } |
| 114 | |
| 115 | /* Adjust code line padding to make room for the gutter button */ |
| 116 | .d2h-code-line-ctn { |
| 117 | position: relative; |
| 118 | padding-left: 14px !important; |
| 119 | } |
| 120 | |
| 121 | /* Ensure gutter is wide enough for the plus button */ |
| 122 | .d2h-code-linenumber, |
| 123 | .d2h-code-side-linenumber { |
| 124 | position: relative; |
| 125 | min-width: 60px !important; /* Increased from 45px to accommodate 3-digit line numbers plus button */ |
| 126 | padding-right: 15px !important; /* Ensure space for the button */ |
| 127 | overflow: visible !important; /* Prevent button from being clipped */ |
| 128 | text-align: right; /* Ensure consistent text alignment */ |
| 129 | box-sizing: border-box; /* Ensure padding is included in width calculation */ |
| 130 | } |
| 131 | |
| 132 | /* Ensure table rows and cells don't clip the button */ |
| 133 | .d2h-diff-table tr, |
| 134 | .d2h-diff-table td { |
| 135 | overflow: visible !important; |
| 136 | } |
| 137 | |
| 138 | /* Add a bit of padding between line number and code content for visual separation */ |
| 139 | .d2h-code-line-ctn, |
| 140 | .d2h-code-side-line-ctn { |
| 141 | padding-left: 8px !important; |
| 142 | } |