papegaaij commented on a change in pull request #400: WICKET-6725: replace display: none by css class URL: https://github.com/apache/wicket/pull/400#discussion_r368978477
########## File path: wicket-core/src/main/java/org/apache/wicket/settings/ResourceSettings.java ########## @@ -770,4 +777,51 @@ public ResourceSettings setEncodeJSessionId(boolean encodeJSessionId) this.encodeJSessionId = encodeJSessionId; return this; } + + /** + * Returns the resource reference of the core stylesheet for Wicket. This stylesheet contains + * some lowlevel styling used by Wicket. When the Wicket core stylesheet has been disabled, this + * returns an empty {@code Optional}. + * + * @return The resource reference of the base stylesheet for Wicket. + */ + public Optional<CssResourceReference> getWicketCoreCSS() + { + return wicketCoreCSS; + } + + /** + * Replaces the core stylesheet for Wicket. Changes made to the styling can break functionality + * like {@link Component#setOutputMarkupPlaceholderTag(boolean)}, causing components that should + * not be visible to be displayed. Make sure the replacement stylesheet has matching definitions + * for the corresponding sections in the Wicket version. + * + * @param wicketCoreCSS + * The replacement styleheet. + * @return {@code this} object for chaining + */ + public ResourceSettings setWicketCoreCSS(CssResourceReference wicketCoreCSS) + { + if (wicketCoreCSS == null) + { + throw new NullPointerException( + "Cannot set the Wicket core CSS to null, use disableWicketCoreCSS() instead."); Review comment: I deliberately chose not to use `ofNullable`, because disabling the core stylesheet has to be a conscious decision. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services