Skip to content

Commit cbbef98

Browse files
authored
Fixed switchers for "Changing the color" and "Changing the language" guides (#3435)
* Update changing-the-language.md * Update changing-the-colors.md * Update changing-the-colors.md * Update changing-the-language.md
1 parent 5fa155d commit cbbef98

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/setup/changing-the-colors.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Click on a tile to change the color scheme:
4444
button.addEventListener("click", function() {
4545
var attr = this.getAttribute("data-md-color-scheme")
4646
document.body.setAttribute("data-md-color-scheme", attr)
47-
var name = document.querySelector("#__code_1 code span:nth-child(7)")
47+
var name = document.querySelector("#__code_1 code span.l")
4848
name.textContent = attr
4949
})
5050
})
@@ -99,7 +99,7 @@ Click on a tile to change the primary color:
9999
button.addEventListener("click", function() {
100100
var attr = this.getAttribute("data-md-color-primary")
101101
document.body.setAttribute("data-md-color-primary", attr)
102-
var name = document.querySelector("#__code_2 code span:nth-child(7)")
102+
var name = document.querySelector("#__code_2 code span.l")
103103
name.textContent = attr.replace("-", " ")
104104
})
105105
})
@@ -156,7 +156,7 @@ Click on a tile to change the accent color:
156156
button.addEventListener("click", function() {
157157
var attr = this.getAttribute("data-md-color-accent")
158158
document.body.setAttribute("data-md-color-accent", attr)
159-
var name = document.querySelector("#__code_3 code span:nth-child(7)")
159+
var name = document.querySelector("#__code_3 code span.l")
160160
name.textContent = attr.replace("-", " ")
161161
})
162162
})

docs/setup/changing-the-language.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ Click on a tile to change the directionality:
167167
button.addEventListener("click", function() {
168168
var attr = this.getAttribute("data-md-dir")
169169
document.body.dir = attr
170-
var name = document.querySelector("#__code_3 code span:nth-child(5)")
170+
var name = document.querySelector("#__code_3 code span.l")
171171
name.textContent = attr
172172
})
173173
})

0 commit comments

Comments
 (0)