The clue is in StylesheetLink#add. Try this:

void afterRender() {
    js.importStylesheet(new StylesheetLink(ieOnlyStylesheet,
        new StylesheetOptions(null).withCondition("(IE 7)|(IE 8)")) );
}

Only the constructor and getter are deprecated.

Steve.
--
Steve Eynon
-------------------------------
"If at first you don't succeed,
   so much for skydiving!"



On 14 June 2012 23:41, George Christman <gchrist...@cardaddy.com> wrote:
> Hello, I'm not finding a clear example how to use StylesheetOptions with a
> condition. I seen an example here,
>
> http://tapestry.apache.org/css.html
>
> But this has been deprecated in 5.3
>
> Could someone please help me figure out how to use the condition. I only
> want to display a style sheet if it's either ie7/ie8
>
> Current code
>
>    @Inject @Path("context:layout/ie-only.css")
>    private Asset ieOnlyStylesheet;
>
>    @Environmental
>    private JavaScriptSupport js;
>
>    // add an IE-only style sheet if browser is IE
>    void afterRender() {
>        js.importStylesheet(new StylesheetLink(ieOnlyStylesheet, new
>                            StylesheetOptions(null)) );
>    }
>
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/How-to-use-StyleSheetOptions-with-condition-tp5713879.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to