Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support fallback value of css variables #1192

Closed
TD-LiXiang opened this issue Jan 8, 2024 · 1 comment · Fixed by #1203
Closed

Support fallback value of css variables #1192

TD-LiXiang opened this issue Jan 8, 2024 · 1 comment · Fixed by #1203
Assignees
Labels
enhancement New feature or request

Comments

@TD-LiXiang
Copy link

Our project uses fallback value of css variables. For example:

.my-button {
  color: var(--my-var, #FFFFFF)
}

But the regular expression used by happy-dom only recognizes css variables with no fallback value. The Regular expression is:

const CSS_VARIABLE_REGEXP = /var\( *(--[^) ]+)\)/g;

Do we have plans to support fallback value of css variables?

@TD-LiXiang TD-LiXiang added the enhancement New feature or request label Jan 8, 2024
@capricorn86 capricorn86 self-assigned this Jan 13, 2024
capricorn86 added a commit that referenced this issue Jan 13, 2024
capricorn86 added a commit that referenced this issue Jan 13, 2024
…value-of-css-variables

#1192@patch: Adds support for fallback values when declaring a CSS va…
@capricorn86
Copy link
Owner

Thank you for reporting @TD-LiXiang! 🙂

This has been fixed now:
https://github.com/capricorn86/happy-dom/releases/tag/v13.0.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants