mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-02-28 17:03:42 +01:00
Color the currently selected version in the picker
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
This commit is contained in:
parent
5fe78ced53
commit
eea13b0ff2
|
|
@ -14,9 +14,24 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// This oddity is an attempt at producing a readable Hugo template while avoiding
|
||||||
|
// JS syntax errors in your IDE
|
||||||
|
const currentVersion = `{{ if eq .Site.Params.version.status "unstable" }}
|
||||||
|
{{- /**/ -}}
|
||||||
|
unstable
|
||||||
|
{{- /**/ -}}
|
||||||
|
{{ else }}
|
||||||
|
{{- /**/ -}}
|
||||||
|
{{ printf "v%s.%s" .Site.Params.version.major .Site.Params.version.minor }}
|
||||||
|
{{- /**/ -}}
|
||||||
|
{{ end }}`;
|
||||||
|
|
||||||
function appendVersion(parent, name, url) {
|
function appendVersion(parent, name, url) {
|
||||||
// The list item
|
// The list item
|
||||||
const li = document.createElement("li");
|
const li = document.createElement("li");
|
||||||
|
if (name === currentVersion) {
|
||||||
|
li.classList.add("selected")
|
||||||
|
}
|
||||||
parent.appendChild(li);
|
parent.appendChild(li);
|
||||||
|
|
||||||
// The link
|
// The link
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,10 @@ Custom SCSS for the Matrix spec
|
||||||
a {
|
a {
|
||||||
color: $black;
|
color: $black;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ul#version-selector li.selected a {
|
||||||
|
color: $secondary;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Styles for the sidebar nav */
|
/* Styles for the sidebar nav */
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue