THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
As with included JavaScript libraries, each stylesheet will only be added once, regardless of the number of components that include it via the annotation.
Conditionally Loading IE-Only Stylesheets
For Tapestry 5.2 and later, if you need to load a different stylesheet for Internet Explorer browsers, or for certain versions of IE browsers, you can use Tapestry's built-in support for IE conditional comments. Just add something like the following to your page or component (or layout) class:
Code Block | ||||
---|---|---|---|---|
| ||||
@Environmental
private JavaScriptSupport javaScriptSupport;
@Inject @Path("context:layout/ie-only.css")
private Asset ieOnlyStylesheet;
// add an IE-only style sheet if browser is IE
void afterRender() {
javaScriptSupport.importStylesheet(new StylesheetLink(ieOnlyStylesheet, new StylesheetOptions(null, "IE")) );
}
|
The above will render something like:
Code Block | ||||
---|---|---|---|---|
| ||||
<!--[if IE]>
<link type="text/css" rel="stylesheet" href="/assets/1.0-SNAPSHOT/ctx/layout/ie-only.css"></link>
<![endif]-->
|