diff --git a/assets/js/versions.template.js b/assets/js/versions.template.js index e690cada..1554ad26 100644 --- a/assets/js/versions.template.js +++ b/assets/js/versions.template.js @@ -44,10 +44,10 @@ function appendVersion(parent, name, segment, url) { // The list item const li = document.createElement("li"); if (segment === selected) { - li.classList.add("selected"); + li.classList.add("version-picker-selected"); } if (segment === "latest") { - li.classList.add("latest"); + li.classList.add("version-picker-latest"); } parent.appendChild(li); diff --git a/assets/scss/_styles_project.scss b/assets/scss/_styles_project.scss index f1054945..0131f1f1 100644 --- a/assets/scss/_styles_project.scss +++ b/assets/scss/_styles_project.scss @@ -57,18 +57,13 @@ Custom SCSS for the Matrix spec 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 { + ul#version-selector li.version-picker-selected a { font-weight: bold; } - ul#version-selector li.latest a { + ul#version-selector li.version-picker-latest a { color: $secondary; } - /* purgecss end ignore */ } /* Styles for the sidebar nav */ diff --git a/changelogs/internal/newsfragments/2264.clarification b/changelogs/internal/newsfragments/2264.clarification new file mode 100644 index 00000000..468f55d5 --- /dev/null +++ b/changelogs/internal/newsfragments/2264.clarification @@ -0,0 +1 @@ +Add version picker in the navbar. diff --git a/postcss.config.js b/postcss.config.js index 50e7224f..493373bb 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -16,6 +16,9 @@ const purgecss = require('@fullhuman/postcss-purgecss')({ extensions: ["json"], }, ], + // As these classes are only applied by JavaScript, PurgeCSS doesn't see them + // in the source code and removes them unless we explicitly tell it not to. + safelist: ['version-picker-selected', 'version-picker-latest'] }); module.exports = {