Skip to content

Commit 44adf31

Browse files
committed
Make language switch show current language
1 parent 6352a55 commit 44adf31

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

assets/css/custom.css

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,23 @@
7373

7474
.language-switch-button {
7575
background-color: rgba(0, 0, 0, 0.5);
76+
border-width: 2px;
77+
border-style: solid;
78+
border-color: white;
79+
border-radius: 5px;
7680
color: white;
77-
border: none;
7881
padding: 5px 10px;
79-
border-radius: 5px;
8082
cursor: pointer;
8183
transition: opacity 0.3s, background-color 0.3s;
8284
opacity: 0.7;
8385
}
8486

87+
body.page-language-js .language-switch-button.lang-js,
88+
body.page-language-ts .language-switch-button.lang-ts {
89+
background-color: black;
90+
color: white;
91+
}
92+
8593
.language-switch-button:hover {
8694
opacity: 1;
8795
background-color: rgba(0, 0, 0, 0.8);

assets/js/custom.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ function createLanguageButton(text, lang) {
221221
const button = document.createElement("button");
222222
button.textContent = text;
223223
button.classList.add("language-switch-button");
224+
button.classList.add("lang-" + lang);
224225
button.addEventListener("click", () => switchLanguage(lang));
225226
return button;
226227
}

0 commit comments

Comments
 (0)