4 * Stable for use on any page where a diff is rendered.
5 * The early-loaded part of the mediawiki.diff module.
6 * Usually added via DifferenceEngine::showDiffStyle() and loaded for all diffs generated by DifferenceEngine
7 * IMPORTANT: This stylesheet is loaded on various pages.
8 * This includes (but is not limited to):
9 * diff pages, undo workflow, edit preview, edit conflict workflow.
12 @import 'mediawiki.skin.variables.less';
13 @import 'mediawiki.mixins.less';
15 /* stylelint-disable selector-class-pattern */
22 /* Ensure that columns are of equal width */
26 padding: 0.33em 0.5em;
29 /* Compensate padding for increased font-size */
37 content: attr( data-marker );
42 /* Force-wrap very long lines such as URLs or page-widening char strings */
43 word-wrap: break-word;
72 .mw-diff-inline-added,
73 .mw-diff-inline-changed,
74 .mw-diff-inline-moved,
75 .mw-diff-inline-deleted {
79 text-decoration: none;
80 white-space: break-spaces;
81 // When JS is enabled, deleted and added content will show a popup explaining what the colors mean.
82 // Show a cursor pointer to make it clear it's clickable.
84 // Note: This currently only happens at low resolutions.
85 @media only screen and ( max-width: @max-width-breakpoint-tablet ) {
92 .mw-diff-inline-added ins,
93 .mw-diff-inline-changed ins,
94 .mw-diff-inline-moved ins {
95 background: @background-color-content-added;
98 .mw-diff-inline-deleted del,
99 .mw-diff-inline-changed del,
100 .mw-diff-inline-moved del {
101 background: @background-color-content-removed;
104 .mw-diff-table-prefix {
106 justify-content: flex-end;
110 .mw-diff-inline-legend {
113 .mw-diff-inline-legend-ins,
114 .mw-diff-inline-legend-del {
115 display: inline-block;
119 .mw-diff-inline-legend-ins {
120 background: @background-color-content-added;
123 .mw-diff-inline-legend-del {
124 background: @background-color-content-removed;
128 .mw-diffPage-inlineToggle-container {
138 border-width: 1px 1px 1px 4px;
139 border-radius: 0.33em;
145 .mw-diff-inline-added,
146 .mw-diff-inline-deleted,
147 .mw-diff-inline-moved,
148 .mw-diff-inline-changed,
149 .mw-diff-inline-context {
150 /* TODO: Re-evaluate whether we should keep this over-ride or switch to ems */
151 /* stylelint-disable-next-line declaration-property-unit-disallowed-list */
153 /* Standardize tab width */
157 // Support Chrome <= 75, Firefox <= 68: Fallback for browsers that don't support `break-spaces`.
158 white-space: pre-wrap;
159 white-space: break-spaces;
161 // Allow editfont to be set on container while only
162 // affecting wikitext content.
163 // These classes match mw-editfont-*
164 .diff-editfont-monospace & {
165 font-family: monospace, monospace;
168 .diff-editfont-sans-serif & {
169 font-family: sans-serif;
172 .diff-editfont-serif & {
177 .mw-diff-inline-header {
183 background: @background-color-neutral-subtle;
185 border-color: @border-color-muted;
189 border-color: @background-color-content-added;
193 border-color: @background-color-content-removed;
198 text-decoration: none;
201 .diff-deletedline & {
202 border-radius: 0.33em;
207 background: @background-color-content-added;
210 .diff-deletedline & {
211 background: @background-color-content-removed;
215 /* Correct user & content directionality when viewing a diff */
216 .diff-currentversion-title,
222 .diff-contentalign-right td {
228 .diff-contentalign-left td {
238 direction: ltr !important; /* stylelint-disable-line declaration-no-important */
242 .mw-diff-slot-header {
246 .mw-diff-slot-error {
252 * Wikidiff2 rendering for moved paragraphs
255 .mw-diff-movedpara-left,
256 .mw-diff-movedpara-right {
262 .user-select( none );
266 text-decoration: none;
277 .mw-diff-movedpara-left::after,
278 .rtl .mw-diff-movedpara-right::after {
282 .mw-diff-movedpara-right::after,
283 .rtl .mw-diff-movedpara-left::after {
287 #mw-inlinediff-header {
296 /* Lock selection to a single side */
297 .diff[ data-selected-side='deleted' ] .diff-side-added,
298 .diff[ data-selected-side='added' ] .diff-side-deleted {
299 .user-select( none );
304 * Wikidiff2 rendering for new lines and deleted lines
306 .mw-diff-inline-added.mw-diff-empty-line,
307 .mw-diff-inline-deleted.mw-diff-empty-line,
308 .mw-inline-diff-newline {
310 font-family: @font-family-monospace;
313 display: inline-block;
314 color: @color-subtle;
318 .mw-diff-inline-added.mw-diff-empty-line,
319 .mw-inline-diff-newline {
321 content: '@{msg-diff-newline}';
322 background: @background-color-content-added;
326 .mw-diff-inline-deleted.mw-diff-empty-line {
328 content: '@{msg-diff-line-deleted}';
329 background: @background-color-content-removed;
333 .mw-diffPage-inlineToggle-container .oo-ui-fieldLayout-body {
338 .mw-diff-empty-line {
345 // Hidden by default, but can be used to adapt layout to mobile devices.
346 // This content may be useful on desktop skins too, however initially this
347 // is hidden by default as communities have not yet been consulted about this.
348 .mw-diff-usermetadata,
349 .mw-diff-revision-history-links {
353 // Hide the diff legend at lower resolutions.
354 @media only screen and ( max-width: @max-width-breakpoint-tablet ) {
355 .mw-diff-inline-legend {