let - const
This commit is contained in:
parent
0d21a7be8d
commit
2ea0f80a2d
src/components/ThemePicker
|
@ -66,11 +66,11 @@ export default {
|
|||
|
||||
methods: {
|
||||
updateStyle(style, oldCluster, newCluster) {
|
||||
let colorOverrides = [] // only capture color overides
|
||||
const colorOverrides = [] // only capture color overides
|
||||
oldCluster.forEach((color, index) => {
|
||||
let value = newCluster[index]
|
||||
let repl = new RegExp(`(^|})([^{]+{[^{}]+)${color}\\b([^}]*)(?=})`, 'gi')
|
||||
let nestRepl = new RegExp(color, 'ig') // for greed matching before the 'color'
|
||||
const value = newCluster[index]
|
||||
const repl = new RegExp(`(^|})([^{]+{[^{}]+)${color}\\b([^}]*)(?=})`, 'gi')
|
||||
const nestRepl = new RegExp(color, 'ig') // for greed matching before the 'color'
|
||||
let v
|
||||
while ((v = repl.exec(style))) {
|
||||
colorOverrides.push(v[2].replace(nestRepl, value) + value + v[3] + '}') // '}' not captured in the regexp repl to reserve it as locator-boundary
|
||||
|
|
Loading…
Reference in New Issue