Re: Define stylesheet import order

2012-03-21 Thread Beat Durrer
The Idea with mixins is great. Even simpler: Since I always use the same RootLayout as uppermost component, I could simply add some method to add/manage the page's CSS. I was able to solve the issue by reducing the amount of nested layout components to a maximum of two Then I put the @Import on

Re: Define stylesheet import order

2012-03-20 Thread Beat Durrer
Thanks for your help Lance, I'm sure it could work that way. I am a bit suprised that there is no direct solution to this. It's common to have some libraries or default CSS and override them on specific pages / layouts. Making CSS special cases or writing an own MarkupRendererFilter for an issue

Re: Define stylesheet import order

2012-03-20 Thread Thiago H. de Paula Figueiredo
On Tue, 20 Mar 2012 10:52:11 -0300, Beat Durrer bdur...@gmail.com wrote: Thanks for your help Lance, I'm sure it could work that way. I am a bit suprised that there is no direct solution to this. It's common to have some libraries or default CSS and override them on specific pages / layouts.

Re: Define stylesheet import order

2012-03-20 Thread Lance Java
For each component, Tapestry includes the stylesheets and javascript for each making sure to only include each unique file once. I'm not 100% but I guess that the order in which the components appear in the page probably defines the order in which they appear in the page. What would be nice is if

Re: Define stylesheet import order

2012-03-20 Thread Beat Durrer
I did some tests and the order of the stylesheets is actually reversed to what I expected it to be... Here is an example: Let's say we define a RootLayout, which has all the basics ( html tag, meta stuff, the body tag). Then we have a SimpleLayout which uses the RootLayout but adds a top

Re: Define stylesheet import order

2012-03-20 Thread Lance Java
I agree that tapestry could be a bit smarter when components/layouts extend each other. This improvement could be made without adding a priority/order to the @Import annotation. I think this is worthy of a Jira issue. As I mentioned before, adding a priority/order to the @Import annotation could

Re: Define stylesheet import order

2012-03-20 Thread Beat Durrer
Yeah, you're probably right about the priority having it's own issues. I wonder if there is a case, in which the current ordering (reversed to my needs) is actually required? In my opinion the innermost element is the most specific one and therefore should have the last word (and be the last one

Re: Define stylesheet import order

2012-03-20 Thread Lance Java
I have a hunch that the reverse order that you are seeing is a direct result of tapestry's RenderQueueImpl which iterates tail first. Perhaps you could write a MarkupRendererFilter that gets the html/head element and loops through all of the link elements calling moveToTop() on each (thus

Re: Define stylesheet import order

2012-03-20 Thread Thiago H. de Paula Figueiredo
On Tue, 20 Mar 2012 13:37:26 -0300, Lance Java lance.j...@googlemail.com wrote: Perhaps you could write a MarkupRendererFilter that gets the html/head element and loops through all of the link elements calling moveToTop() on each (thus reversing the order). You could do that in a mixin

Define stylesheet import order

2012-03-19 Thread Beat Durrer
Hi all, I have a RootLayout component which loads a CSS file, and some SubLayout components add an other CSS. I'm using T5.3.2 and simply applied the @Import(stylesheet={...}) to the Layout classes. At the moment, the CSS from RootLayout is loaded after the SubLayouts and therefore overrides

Re: Define stylesheet import order

2012-03-19 Thread Lance Java
In your AppModule, you can contribute a MarkupRendererFilter to fire after JavaScriptSupport public void contributeMarkupRenderer(OrderedConfigurationMarkupRendererFilter configuration) { configuration.addInstance(MyMarkupRendererFilter, MyMarkupRendererFilter.class,