css: Use a class for spoiler header text.

Having the :not() rule there affected the performance, see
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1920156
for more details.
This commit is contained in:
Shubham Padia
2024-09-02 07:52:14 +00:00
committed by Tim Abbott
parent 28d9c02479
commit 4a7983fad3
3 changed files with 5 additions and 1 deletions

View File

@@ -286,6 +286,8 @@ export const update_elements = ($content: JQuery): void => {
$(this).append($("<p>").text($t({defaultMessage: "Spoiler"})));
}
$(this).find("p").addClass("spoiler-header-text");
// Add the expand/collapse button to spoiler blocks
const toggle_button_html =
'<span class="spoiler-button" aria-expanded="false"><span class="spoiler-arrow"></span></span>';