From 8a58a62963239dd4fd103d2c2fa2569a6b7031ba Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Fri, 5 Dec 2025 13:01:19 +0000 Subject: [PATCH] Prevent PurgeCSS from deleting dynamically-added version picker CSS classes These classes were getting removed from the final, minified CSS as they were only present after the dynamic JavaScript that builds the version picker HTML ran. --- assets/scss/_styles_project.scss | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/assets/scss/_styles_project.scss b/assets/scss/_styles_project.scss index ce0ce0ee..f1054945 100644 --- a/assets/scss/_styles_project.scss +++ b/assets/scss/_styles_project.scss @@ -51,12 +51,16 @@ Custom SCSS for the Matrix spec color: $black; } - /* Make the version dropdown scroll if its too large */ + /* Make the version dropdown scroll if it's too large */ ul#version-selector { max-height: 80vh; overflow-y: auto; } + /* As these styles are only applied by JavaScript, PurgeCSS doesn't see them + * in the source code and removes them unless we explicitly tell it not to. + */ + /* purgecss start ignore */ ul#version-selector li.selected a { font-weight: bold; } @@ -64,6 +68,7 @@ Custom SCSS for the Matrix spec ul#version-selector li.latest a { color: $secondary; } + /* purgecss end ignore */ } /* Styles for the sidebar nav */