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

ignoreAttributes doesn't disable scanning the attrs generate from component props #3650

Open
4 tasks done
johnson0903 opened this issue Mar 22, 2024 · 2 comments
Open
4 tasks done
Labels
bug Something isn't working

Comments

@johnson0903
Copy link

UnoCSS version

0.58.6

Describe the bug

I want to prevent Uno detect the 'size' attribute on my Icon component, because my icon's size is control by the "size" prop.
I use the setting below and it works on native html tag, but not on my vue icon component.

presetAttributify({
  ignoreAttributes: ['size'],
})

Reproduction

https://stackblitz.com/edit/vitejs-vite-y6gjgg?file=src%2FApp.vue

System Info

No response

Validations

@Simon-He95 Simon-He95 added the bug Something isn't working label Mar 22, 2024
@Simon-He95
Copy link
Contributor

@johnson0903
I don't know if this is a bug, because the current path of unocss matches exactly, so if you want to achieve your goal, you need to configure ["size", ":size"]
@antfu What do you think? We need to change the matching rules to directly support the a and :a forms in ignoreAttributes.

@johnson0903
Copy link
Author

johnson0903 commented Mar 25, 2024

Thank you, it works for me.

As for changing the matching rule, do you mean it should prevent all attributes added by the props from being detected? Or only the actual word list in ignore configuration?

For example, if component's :size props generate w-1 and h-1 (assume that these are valid attributes in uno rules)on child tag, instead of generate size attribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants