简体   繁体   中英

How to change, override or cut off Tapestry default style?

I'm trying to use beaneditform in Tapestry 5.3 and I would like to know how to don't use the forms default css styles.

I would like to use my css styles from my layout component.

I tryed to override it but I think it would generate overhead in my application.

Best regards

Order matters in CSS; what you need to do is ensure that your CSS is added after the default Tapestry CSS. In you layout component:

@Import(stylesheet="context:css/mysite.css")
void afterRender() { }

This means that the import of the stylesheet happens during the AfterRender phase, which occurs at the end, after Tapestry has added its own stylesheets.

Alternately, you can use Tapestry symbols to override the path to the Tapestry default stylesheet.

in appmodule.java do the folowing

public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration) {
...
 configuration.add(SymbolConstants.DEFAULT_STYLESHEET, "context:css/site.css");
....
}

file site.css is in web pages/css

from now on default css is your custom site.css

any css made by tapestry is nullifyed

everything must be made from scratch.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM