You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Chris Lewis <ch...@bellsouth.net> on 2008/08/28 22:13:32 UTC

T5: order of CSS via @IncludeStylesheet

Hello,

I'm having a problem styling a component that includes its own style
sheet. Many components need to have a default look out of the box, much
like some of the corelib components do, but the problem is the order in
which the style sheets (via @IncludeStylesheet) are added to the page.
The order appears to be default, page, and then each of the components
in the order they render. This makes it impossible for a page's style
sheet to override any rules set in a component's, or worse, means a
component's may trump one in the page's with a conflicting name.

The easist way around this seems to be by using
RenderSupport#addStylesheetLink explicitly in afterRender of the page
(thanks tsweetser in IRC), but in the face of @IncludeStylesheet it just
feels so wrong. With @IncludeStylesheet you instantly know, without a
doubt, all page-related css.

I had it in my head that the annotation was backed by an annotation, but
after looking at the source I see it's actually grafted into the
transformed class at runtime. I thought about adding my own annotation
to support a kind of ordering flag (before render, after render, etc),
but that was when I thought it was an environmental. I actually think it
/was/ an envoronmental and assume the change to an actual class
modification was made for performance reasons.

So... would this be a possible addition to the core @IncludeStylesheet
annotation, or should I look in to writing my own?

thanks,
chris

-- 
http://thegodcode.net


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