presetIcons using ?bg
shouldn't also apply 'width', 'height' or 'background-color'
#3744
Closed
4 tasks done
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 setwidth
,height
, andbackground-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
, andbackground-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
The text was updated successfully, but these errors were encountered: