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

Added a walk option #26

Closed
wants to merge 1 commit into from
Closed

Conversation

romaricpascal
Copy link

I needed a way to customize which nodes were walked through so I added a walk option allowing users to customise the walking (eg. use walkDecls instead of just walk).

@andyjansson
Copy link
Owner

I really don't get this change.

@romaricpascal
Copy link
Author

I'm making a plugin that processes url() declarations in the CSS through a url function. However, I want it to apply only to images urls, so for example ignore the ones in @font-face declarations.

This is why I added the walk option to allow me to override the default css.walk() call going through everything. This way, I can use walkDecls (and a RegExp) to only target the properties accepting an image URL according to the CSS specs.

@andyjansson andyjansson closed this Nov 8, 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.

None yet

2 participants