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

fix(useCssVar): ensure MutationObserver detects CSS variable changes #3985

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stephenjason89
Copy link
Contributor

Description:

This PR addresses an issue with the useCssVar function where the MutationObserver was not detecting changes to CSS variables after the initial style property was set.

Changes:

Removed the code responsible for setting the style property within the useCssVar function.
Ensured that the useCssVar function now correctly detects changes to the CSS variable using the MutationObserver without any interference.

Context:

The original implementation set the style property directly, which prevented the MutationObserver from detecting subsequent changes. By removing this code, the function can now observe changes more reliably, improving its reactivity and functionality.

…rver detects changes

- Removed the code responsible for setting the style property within the useCssVar function.
- This change was necessary because it caused the MutationObserver not to detect subsequent changes after the style property was initially set.
- Now, useCssVar correctly detects changes to the CSS variable using the MutationObserver without interference.
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant