简体   繁体   English

如何更改,覆盖或切断Tapestry的默认样式?

[英]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. 我正在尝试在Tapestry 5.3中使用beaneditform,并且我想知道如何不使用表单的默认CSS样式。

I would like to use my css styles from my layout component. 我想使用布局组件中的CSS样式。

I tryed to override it but I think it would generate overhead in my application. 我试图覆盖它,但是我认为它会在我的应用程序中产生开销。

Best regards 最好的祝福

Order matters in CSS; CSS中的顺序事项; what you need to do is ensure that your CSS is added after the default Tapestry CSS. 您需要做的是确保在默认Tapestry CSS之后添加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. 这意味着样式表的导入是在Tapestry添加了自己的样式表之后的AfterRender阶段完成的。

Alternately, you can use Tapestry symbols to override the path to the Tapestry default stylesheet. 或者,您可以使用Tapestry符号来覆盖Tapestry默认样式表的路径。

in appmodule.java do the folowing 在appmodule.java中进行以下操作

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 文件site.css在网页/ css中

from now on default css is your custom site.css 从现在开始,默认CSS是您的自定义site.css

any css made by tapestry is nullifyed 挂毯产生的任何CSS均无效

everything must be made from scratch. 一切都必须从头开始。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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