-
Notifications
You must be signed in to change notification settings - Fork 111
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
Add option to filter style properties #200
base: main
Are you sure you want to change the base?
Conversation
Sample use: | ||
|
||
``` | ||
filterStyles(node, propertyName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like the first parameter node
is not passed here. Even though the issue being fix does not require it, I think it's better to include just in case. WDYT?
Or maybe let's fix the README
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch @NogaMan ... I think we should add the node
as a parameter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I'll make the change
Minor issue with the test ignoring the node parameter. I will fix that when cutting the new release. |
Added the ability to specify a callback to invoke on each style property when copying, in order to filter the style properties to keep only the desired ones.
This can be interesting to simplify the copied element (removal of the background color for example) or not to keep the CSS variables (as Firefox or Safari does) and thus gain in performance or avoid failures on these browsers.
Sample use:
Fixes #194