Don’t split vars with numbers in them inside arbitrary values (#8091)
* Don’t mangle vars with numbers in them * Update changelog
This commit is contained in:
parent
1d4c5c78bd
commit
34c1e36c2a
3 changed files with 53 additions and 4 deletions
|
|
@ -42,10 +42,16 @@ export function normalize(value, isRoot = true) {
|
|||
|
||||
// Add spaces around operators inside calc() that do not follow an operator
|
||||
// or '('.
|
||||
return value.replace(
|
||||
/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,
|
||||
'$1 $2 '
|
||||
)
|
||||
value = value.replace(/calc\(.+\)/g, (match) => {
|
||||
return match.replace(
|
||||
/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,
|
||||
'$1 $2 '
|
||||
)
|
||||
})
|
||||
|
||||
// Add spaces around some operators not inside calc() that do not follow an operator
|
||||
// or '('.
|
||||
return value.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([\/])/g, '$1 $2 ')
|
||||
}
|
||||
|
||||
export function url(value) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue