Skip to content

Conversation

innocenzi
Copy link
Contributor

This pull request fixes a case where the CSS variable would be added as a style on the selected element, hence making useless the observation of said element in cases where the style is not changed but a class or an attribute is.

This version will behave as before, adding a style since we provide a value:

useCssVariables({
  onBackgroundColor: {
    name: "color-on-background",
    value: "red" // we define a value, so style is applied
  }
});

This version will behave as expected in the first PR, not adding a style if not required:

useCssVariables({
  onBackgroundColor: 'on-background-color' // we don't define a value, no style is applied
});

Copy link
Owner

@pikax pikax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you 👍

Co-Authored-By: Carlos Rodrigues <david-181@hotmail.com>
@pikax pikax merged commit 3b606c7 into pikax:master Mar 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants