Skip to content

Wind4 preset with reset hidden forces display: none !important #4948

@chrisspiegl

Description

@chrisspiegl

UnoCSS version

66.5.3

Describe the bug

I upgraded to the latest version and presetWind4() with the reset. While looking through our application, I noticed that hidden appears to behave differently from before:

Before:

hidden meant display: none;

Now with the presetWind4 and the Tailwind reset:

hidden means: display: none !important;

Which means it cannot be overwritten by a sm:flex without using sm:!flex.

I looked into the Tailwind reset unocss provides. There it states that this should not apply the !important hidden when we use hidden="until-found". But I have tested this in my application and in the playground, and it does not work. Or rather, it works but only based on the hidden="until-found" browser implementation (which is a special feature).

Now, it appears, there is no way to just set display: none; to initially hide an element and to then make it visible for certain browser sizes? Or is the official way to overwrite the wind4 / tailwind 4 reset based hidden with sm:!flex and force the !important?

Please check the reproduction for an example of a few different ways I tried to apply this.

Reproduction

https://unocss.dev/play/#html=DwEwlgbgBAFgtAMwK4BsVQC4FMAeG4DGWAdtgE5QIq5QDOW1B%2BxA9sVlAIZoBcGZnYrTAYwbOABYADFIB8AKChRQkKAFtOCpUpURZnAEYsIWYAHpwexdt2wwIECTpqeVGiwAOAZimZc%2BFABzSgB3H181AEYtbSUYe0diLmIQKAADWhc3HDSoAkEAcgwoYywyELIRDgMsfKR6TE4wFBCwFKgJKDIsemKPbt7rWIQWMiJaOwcnVowYdIBCMDUPUYxBDDSh5QtIGJ1LScSAXgAiJFJmxBZzkBPnV2ocEu9fbDw4INDw9WituISnOdROgRjcuB4PCgwFhUgAKeJTJKOWgeKrpIGXUEpNIASj%2BUAAklBAkgehNZpwMAUJmwoB4kGQVg1OBMRFB6j1MDBqmQWCF6BQEFhKQyOCwEOkEcczhcUFcbidNrElCF4gQ5hoANactkQMDCAzUErEIhcnl8gV0YVjOYhFns%2BggAB0W3Mlj2ygOUqcmR482yzx8fnenwQYRkPw9-0RgDICEomcqVbDqerFDnpX3%2Bx65DAsRraqBYBBCpiunZWWK6WQ1FB8t27az1qxNhRAA&config=JYWwDg9gTgLgBAbwFBzgEwKYDNgDsMDCEuOA5gDQpxhQYDOGMAgjDFMAEYCuMwWAnpVQ16jAOp40AFkoBfOFigQQcAORdcEAMZ06qpEgwAPSLHTYAhlwA28TDnxESwUgApkw2gxh0AXHABtKk9RGAlcaVcASiFUai9GFjZOHj5%2BaNiAXTkopCA&css=PQKgBA6gTglgLgUzAYwK4Gc4HsC2YDCAyoWABYJQIA0YAhgHYAmYcUD6AZllDhWOqgAOg7nAB0YAGLcwCAB60cggDYIAXGBDAAUKDBi0mXGADe2sGC704AWgDuCGAHNScDQFYADJ4Dc5sAACtMLKAJ5gggCMLPK2ABR2pPBIcsoAlH4WAEa0yADWTlBYqEw2yFjK3Bpw5LxxAOTllVDoYpSMYgAs3vUZ2gC%2BmsBAA&options=N4IgLgTghgdgzgMwPYQLYAkyoDYgFwJTZwCmANCBCXAA5LwCWAbifocSQL5A&version=66.5.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions