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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

presetIcons using ?bg shouldn't also apply 'width', 'height' or 'background-color' #3744

Closed
4 tasks done
shapedigital opened this issue Apr 19, 2024 · 0 comments 路 Fixed by #3774
Closed
4 tasks done

Comments

@shapedigital
Copy link

UnoCSS version

"@unocss/nuxt": "^0.59.3"

Describe the bug

Perhaps not a bug, but also probably not a feature. 馃し

When using icons via presetIcons it also applies additional CSS which interferes with already set width, height, and background-color values, which I don't think it should be.

This approach has probably been taken so that it gives it the best chance to be 'visible' when first applied, but it's not considerate of existing CSS, and makes it harder to use.

As an example, if I would like to use a specific icon as a background on my 'checked' checkbox (which already has styling) it will override the width, height, and background-color.

Reproduction

https://unocss.dev/play/?html=DwEwlgbgBAxgNgQwM5ILwCIBGBzAtAOwFMBXAFwCcE5cBWABjqgAdcAWdAPgChgx8myUUgE8mhDDAAWhGAGtMAewAe6WIhQZMuAIxQtSBXDAg9uGIYXlcmRHNjFyBq0wV9ShclARMxCSvhhCAgUiKAB3HUZJSL08MMkwdyhyBWJ8EEIQHVhpOUyALjBcADMEADZcAyMsqRlZAH4cTh4AenAIDiA&config=JYWwDg9gTgLgBAbwFBzgEwKYDNgDsMDCEuOA5gDQpxhQYDOGMAgjDFMAEYCuMwWAnpVQ16jAJIBjYnSHVaDGAFVcESgF84WKBBBwA5FxUS6dPUiQYAHpFjpsAQy4AbeJhz4iJYKQAUyVFDO9ABccADaVKhhehJcdDA6ALSBThh65IhwUk7QoXq0aHpwagC6VCWydAAW0DCxMHSh-qj6sfFJ1bX1enkwVjCJTqRwfZYD0Pa4pBhwNQBuGFDBowN99k5mqGqyIgqN4ZFyokoqPgCUssLyjCxsnDx8-OeXRwqS0n6HqHQS6xihAEYAHQAJheqAkaFweSqrDAjQA9Aj6CAgdUEZsWmoLuUkNikEA&css=PQKgBA6gTglgLgUzAYwK4Gc4HsC2YDCAyoWABYJQIA0YAhgHYAmYcUD6AZllDhWOqgAOg7nAB0YAGLcwCAB60cggDYIAXGBDAAUKDBi0mXGADe2sGC704AWgDuCGAHNScDQFYADJ4Dc5sAACtMLKAJ5gggCMLPK2ABR2pPBIcsoAlH4WAEa0yADWTlBYqEw2yFjK3Bpw5LxxAOTllVDoYpSMYgAs3vUZ2gC%2BmsBAA&options=N4XyA

System Info

Universal issue. But present on MacOS / Chrome.

Validations

zyyv added a commit to zyyv/unocss that referenced this issue May 6, 2024
I'll add a hook to add handling of props to the final output. Since `iconify` merges the final properties into `usedProps`, it may not be the properties that the user ultimately wants.
close unocss#3744
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 a pull request may close this issue.

1 participant