Skip to content

fix(prefix): replace only the variable name, not all content of var(...)#4373

Open
pdanpdan wants to merge 1 commit intosaadeghi:masterfrom
pdanpdan:fix/string-prefix-replacement
Open

fix(prefix): replace only the variable name, not all content of var(...)#4373
pdanpdan wants to merge 1 commit intosaadeghi:masterfrom
pdanpdan:fix/string-prefix-replacement

Conversation

@pdanpdan
Copy link
Contributor

@pdanpdan pdanpdan commented Jan 7, 2026

  • existing regex was matching all text after var(-- until the first )
  • that solution does not work for var in var (var(--a, var(--b)))
  • new implementation will only replace the variable name ([a-zA-Z0-9_-]+)
  • it also accepts spaces between var and ( and between ( and --
  • as this regex is heavily used I extracted it to be only compiled once

close #4372
close #4408

…...)`

- existing regex was matching all text after `var(--` until the first `)`
- that solution does not work for `var` in `var` (`var(--a, var(--b))`)
- new implementation will only replace the variable name (`[a-zA-Z0-9_-]+`)
- it also accepts spaces between `var` and `(` and between `(` and `--`
- as this regex is heavily used I extracted it to be only compiled once

close saadeghi#4372
@kamontat
Copy link

kamontat commented Feb 2, 2026

@pdanpdan hi, may I ask what is blocking this to merge?

@pdanpdan
Copy link
Contributor Author

pdanpdan commented Feb 2, 2026

I think holiday/free time. Be patient :)

@saadeghi
Copy link
Owner

saadeghi commented Feb 2, 2026

Will be merged soon 👍

@saadeghi saadeghi added the 5.6 label Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: No prefix for --page-has-scroll variable bug: rootcolor incorrectly generated when using DaisyUI prefix

3 participants