Hi all,

we have a disagreement on how to style hidden elements in Wicket 9.x.

Due to the new CSP support we can no longer use inline styling to hide elements.
WICKET-6725 introduces new CSS classes and a file wicket-core.css.

I don't think this is a good approach:

- it adds a CSS file that is referenced by each page (after Wicket doing fine without it for 15 years) - the CSS is a mingle-mangle of out-of-date stylings (see .wicket--hidden-fields)
- it's a kitchen-sink for left-over styles (see .wicket--color-red)
- it introduces a new class naming scheme not used anywhere else (wicket--)

IMHO we should remove that file again (and the required infrastructure in ResourceSettings/WebApplication) and just use the HTML5 "hidden" attribute instead, whenever we want to hide something (Component, Form, ...). This "just works" in all browsers and is semantically correct. It has one caveat when an application's CSS changes the default styling of hidden elements (see https://css-tricks.com/the-hidden-attribute-is-visibly-weak), but that's in the responsibility of the application developer. AjaxIndicatorAppender can just render a CSS class and leave the styling to the application developer, nobody will be happy with the default "red" anyway.

Thus I'll be starting a vote in the next days with the following two options:

[] leave as is with .wicket--hidden & wicket-core.css

[] use HTML5 "hidden" attribute instead

This isn't the vote yet, it's just the announcement.
Maybe others see a third (forth?) option or want to raise their concerns first.

Sven


Reply via email to