edit_history: Highlight topic edit diffs by using correct CSS selector.

Previously, topic edit diffs in the edit history modal were not
highlighted in the same way as content diffs because the highlighting
CSS rules were inside a .rendered_markdown block. So they affected the
content diffs, which are classed as such, but not the topic diffs.

This commit moves the highlight rules to a
.message_edit_history_content block inside the already existing
 #message-edit-history block. .message_edit_history_content had
already existed in the edit history template message_edit_history.hbs,
and is assigned to both the content and topic diffs.

The ability to see topic edits in the edit history was added in
March 2019 in 38be5ea74394d2fd8586038de6ac447b4bbfbf67; the
highlighting worked at that time. It broke four mounths later in July
2019 in 38ffde37e5 when the highlight
rules were moved into a .rendered_markdown block after having been
global.

(As a further aside, .rendered_markdown was only added to the content
diffs in April 2019 in 5c36918c17.
.message_edit_history_content had been first added, to the content
diffs, in February 2019 in 7d42d7b4dbe6eb144a148135db50ad35efc01295.)

Aside from fixing topic edit diffs, this change is just more correct;
the highlight rules don't belong under .rendered_markdown, and they
don't need to be applied globally.
This commit is contained in:
Sharif Naas 2020-06-06 00:11:24 -07:00 committed by Tim Abbott
parent 78691b13ad
commit b148c8dbd6
2 changed files with 25 additions and 20 deletions

View File

@ -17,19 +17,20 @@
.messagebox-content {
padding: 0px 10px;
}
}
.rendered_markdown {
/* Highlighting for message edit history */
.highlight_text_inserted {
color: hsl(122, 72%, 30%);
background-color: hsl(120, 64%, 95%);
}
.message_edit_history_content {
.highlight_text_inserted {
color: hsl(122, 72%, 30%);
background-color: hsl(120, 64%, 95%);
}
.highlight_text_deleted {
color: hsl(0, 100%, 50%);
background-color: hsl(7, 90%, 92%);
text-decoration: line-through;
word-break: break-all;
.highlight_text_deleted {
color: hsl(0, 100%, 50%);
background-color: hsl(7, 90%, 92%);
text-decoration: line-through;
word-break: break-all;
}
}
}

View File

@ -479,16 +479,20 @@ on a dark background, and don't change the dark labels dark either. */
background-color: hsla(355, 37%, 31%, 1);
box-shadow: 0px 0px 0px 1px hsla(330, 40%, 20%, 1);
}
}
.highlight_text_inserted {
color: hsl(122, 100%, 81%);
background-color: hsla(120, 64%, 95%, 0.3);
}
#message-edit-history {
.message_edit_history_content {
.highlight_text_inserted {
color: hsl(122, 100%, 81%);
background-color: hsla(120, 64%, 95%, 0.3);
}
.highlight_text_deleted {
text-decoration: line-through;
background-color: hsla(7, 54%, 62%, 0.38);
color: hsl(0, 90%, 67%);
.highlight_text_deleted {
color: hsl(0, 90%, 67%);
background-color: hsla(7, 54%, 62%, 0.38);
text-decoration: line-through;
}
}
}