The parenthesis matching was not checking the right balance before.
For the declaration value var(--box-shadow, 0px 2px 8px 0px rgba(0, 0, 0, 0.5)) it would extract the following parts
as it finds the var( look for the closing ) token, which it then finds just after 0.5. Instead it should look for () pairs, and check if the opening ( is after var. This way in the previous case, it would find:
Follow-up to PR https://github.com/MadLittleMods/postcss-css-variables/pull/112
Fix https://github.com/MadLittleMods/postcss-css-variables/issues/114
The parenthesis matching was not checking the right balance before. For the declaration value
var(--box-shadow, 0px 2px 8px 0px rgba(0, 0, 0, 0.5))
it would extract the following partsas it finds the
var(
look for the closing)
token, which it then finds just after0.5
. Instead it should look for(
)
pairs, and check if the opening(
is aftervar
. This way in the previous case, it would find: