我目前的theme.css
个档案:
.actionBlock[selected] {
color: var(--gray11);
background-color: var(--gray11);
}
我要把color: var(--gray11);
换成color: #FFF; /* EDITED : var(--gray11) */
在PowerShell中,我try 了:
$file = "theme.css"
$content = Get-Content $file -Raw
$content = $content -replace '(\.actionBlock\[selected\]\s*{[^{}]+color:\s*)([^;]+)(;)', ('$1#FFF; /* EDITED : $2 */')
Set-Content -Path $file -Value $content
这导致我的CSS改变如下:
.actionBlock[selected] {
color: var(--gray11);
background-color: #FFF; /* EDITED : var(--gray11) */
}
这不是我所期望的结果:我只想改变color
值,而不是background-color
值.