Re: T5.3 rc3 ordering of css
On Nov 9, 2011, at 12:45 PM, Ville wrote: > Thanks for the input again, live and learn :) > > In case anyone comes looking, the easiest way is to set a class "c" to body > and prepend all your styles with .c. or if you have .t-error{color:red;} coming from your default.css you can add BODY .t-error{color:green;} to your own css. This saves you from having to add classes to every page. > > - Ville cheers, Joost > > -- > View this message in context: > http://tapestry.1045711.n5.nabble.com/T5-3-rc3-ordering-of-css-tp4969412p4977487.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
Re: T5.3 rc3 ordering of css
I often use Amazon CloudFront (or Google for jQuery) to serve CSS/Javascript on websites so the Tapestry @Include is only useful in development for me and currently there does not seem to be a generic way to turn off all the defaults. It would be OK (perhaps better) if there was a default include service I could override. The API seems to indicate that might be the case but in reality adding of defaults seems a bit ad hoc and you have to look at the source to figure out how to get rid of each one individually or I guess you could rewrite the DOM after it's rendered. I understand why defaults are important to get things going but I suspect many people override all of the default CSS. I would also guess I'm not the only one to use a CDN to serve css/javascript. The current way defaults are added is at best magic but closer to mysterious. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5.3 rc3 ordering of css
Thanks for the input again, live and learn :) In case anyone comes looking, the easiest way is to set a class "c" to body and prepend all your styles with .c. - Ville -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-3-rc3-ordering-of-css-tp4969412p4977487.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
Re: T5.3 rc3 ordering of css
Hmm, I might then have done an error by mistakenly took for granted that the Tap5 stylesheet comes before mine. Thanks for the specificity link, that clears it up nicely. Well, now I have to go write all my css again that overrides Tap 5 styles ;) - Ville -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-3-rc3-ordering-of-css-tp4969412p4977439.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
Re: T5.3 rc3 ordering of css
I might be missing something here but why do you not solve the problem with css specificity [1]? Css should never care about the order in which you load your css files IMHO. Cheers, Joost [1]: http://www.htmldog.com/guides/cssadvanced/specificity/ On Nov 9, 2011, at 9:19 AM, Ville wrote: > To clarify why the ordering IS important, if my css is included before > Tapestry's default, then I can't override T5's default styles. (And the > second picture in my earlier post demonstrates this..) > > The proposed fix that I then exclude the T5 defaults altogether is not imho > the most elegant fix. > > - Ville > > -- > View this message in context: > http://tapestry.1045711.n5.nabble.com/T5-3-rc3-ordering-of-css-tp4969412p4977069.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 >
Re: T5.3 rc3 ordering of css
To clarify why the ordering IS important, if my css is included before Tapestry's default, then I can't override T5's default styles. (And the second picture in my earlier post demonstrates this..) The proposed fix that I then exclude the T5 defaults altogether is not imho the most elegant fix. - Ville -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-3-rc3-ordering-of-css-tp4969412p4977069.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
Re: T5.3 rc3 ordering of css
So the fix is to exclude all css files that third party libs include, then copy the css from those jars, modify it and include it yourself? I don't get how the ordering is not important, as the order dictates how the styles are applied, and what overrides what? - Ville -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-3-rc3-ordering-of-css-tp4969412p4977047.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
Re: T5.3 rc3 ordering of css
Ordering of stylesheets is less of an issue imho, but I can see how excluding them can be important, as you could end up with tons of overrides that are excessive. So +1 for this idea: > @Import(stylesheet=false) Although I would rather prefer something along the lines of this for more precision: @Exclude("stylesheet=default.css") -Peter - Original Message - From: "Barry Books" To: "Thiago H. de Paula Figueiredo" Cc: "Tapestry users" , "Barry Books" Sent: Tuesday, 8 November, 2011 15:20:50 GMT +02:00 Athens, Bucharest, Istanbul Subject: Re: T5.3 rc3 ordering of css Good comment. That's even simpler. I'd still like some simple way to turn off the defaults. Perhaps @Import(stylesheet=false) could clear the current stylesheets then I just put them in layout.tml. Currently I'm using public void contributeMarkupRenderer(OrderedConfiguration configuration) { configuration.override("InjectDefaultStylesheet", new MarkupRendererFilter() { public void renderMarkup(MarkupWriter writer, MarkupRenderer renderer) { renderer.renderMarkup(writer); } }); } to turn off the Tapestry one but it seems like there must be a better way. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5.3 rc3 ordering of css
Hi, I have overridden the default themeroller theme, this is no problem. Take a look at this screenshot: http://tinypic.com/r/r1djqc/5 It clearly demonstrates that tapestry-console.css, t5-alerts.css and tree.css all come after my css -thus any overrides I have made take no effect (To those classes). The first picture is taken using @Import in my layout component. The second is even more wrong, now using direct http://tinypic.com/r/148b4n/5 Now my css is the dead first in the page, everything else coming after. And yes, T5 respects the order in which I declare MY css files, but how can I say that my css should be the last to include, always. (If the stack contribution would use the normal after:/before: notation it could be done using thous declaratives?) - Ville -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-3-rc3-ordering-of-css-tp4969412p4976938.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
Re: T5.3 rc3 ordering of css
Good comment. That's even simpler. I'd still like some simple way to turn off the defaults. Perhaps @Import(stylesheet=false) could clear the current stylesheets then I just put them in layout.tml. Currently I'm using public void contributeMarkupRenderer(OrderedConfiguration configuration) { configuration.override("InjectDefaultStylesheet", new MarkupRendererFilter() { public void renderMarkup(MarkupWriter writer, MarkupRenderer renderer) { renderer.renderMarkup(writer); } }); } to turn off the Tapestry one but it seems like there must be a better way.
Re: T5.3 rc3 ordering of css
Hi Ville > If I put MY css directly to the head the end result is this: > mycss > tapestry5 default css > css from tapestry5-jquery library did you try this in a layout component? because I was able to override the default jquery theme with a in the layout template of the following basic application https://github.com/got5/awlContact/blob/master/src/main/java/com/atosworldline/tapestry/components/Layout.tml Regards François - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5.3 rc3 ordering of css
On Tue, 08 Nov 2011 11:04:18 -0200, Ville wrote: The problem is the thirdparty libraries: If I include chenillekit, and that library includes css file for its window component, it is essential that my css comes after that - otherwise I have no way to override the styles. Tapestry always put your CSS and JavaScript files after the component-provided ones. If not, this is a bug. If I put MY CSS to @Import tag the result is this: tapestry5 default css mycss css from tapestry5-jquery library If I put MY css directly to the head the end result is this: mycss tapestry5 default css css from tapestry5-jquery library Have you tried without tapestry5-jquery, so we can be sure where the problem is? The tapestry5-jquery team had been done a wonderful job, but I've seen at least one bug specific to tapestry5-jquery that looked like a tapestry-core one. Nothing is perfect. :) -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5.3 rc3 ordering of css
The problem is the thirdparty libraries: If I include chenillekit, and that library includes css file for its window component, it is essential that my css comes after that - otherwise I have no way to override the styles. If I put MY CSS to @Import tag the result is this: tapestry5 default css mycss css from tapestry5-jquery library If I put MY css directly to the head the end result is this: mycss tapestry5 default css css from tapestry5-jquery library So, in that case tapestrys default css overrides my css :/ This is clearly not the intention. I can order MY css, but cannot control in which order Tapestry includes it's own css or the thirdparty libraries / components. Tested on 5.3 rc3, development mode. - Ville -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-3-rc3-ordering-of-css-tp4969412p4974198.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
Re: T5.3 rc3 ordering of css
On Tue, 08 Nov 2011 09:56:56 -0200, Barry Books wrote: Personally I wish you could just put the stylesheets you want in the layout.java @Import and have it work. Why using @Import in Layout if you can add the
Re: T5.3 rc3 ordering of css
Personally I wish you could just put the stylesheets you want in the layout.java @Import and have it work. In this particular case I think the whole AppModule configuration is overkill for the problem. I would be nice if there was a simple way to override all the stacks instead tracking down all the defaults and turning them off. Perhaps @Override(stylesheet=true) @Import(stylesheet={"classpath:/com/trsvax/bootstrap/bootstrap.css","myStyle.css"}) This would just put bootstrap.css and myStyle.css in the page in the order I specify. Any upstream styles would be suppressed. I think the whole auto include thing is useful in the beginning but at some point it just gets in the way. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5.3 rc3 ordering of css
Hi, the problem arises when I use third party libs, namely Tap5-Jquery (http://tapestry5-jquery.com/). I have no means to control how they include their CSS. As a developer I want to control the order in which CSS files get included stack by stack. Can this be achieved by contributing to public static void contributeJavaScriptStackSource(MappedConfiguration configuration)? I suppose not, as this is MappedConfiguration, not ordered. Perhaps it's time for ordered mapped configuration. Atleast, CSS is heavily dependant to the order and now I can't control it? Any thoughts? - Ville -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-3-rc3-ordering-of-css-tp4969412p4970857.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
Re: T5.3 rc3 ordering of css
Hi, I'm not sure where it is in the Docs (I can't see it on http://tapestry.apache.org/css.html ) but you can order your CSS by placing the @Import on various render phase methods. i.e. @Import(stylesheet="me-first.css") void setupRender() {} would come before any stylesheets declared with @Import(stylesheet="me-last.css") void cleanupRender() {} Steve. On 7 November 2011 04:05, 9902468 wrote: > Hi, > > is there any documentation how the ordering of css is done? I've tried > stacks and straight imports, but I really haven't found any way to say that > my css is last. > > I use T5-jquery library and the included form.css is always attached later > than mine. (Effectively only way to override bits of that css is to write > inline css to my forms?) > > - Ville > > -- > View this message in context: > http://tapestry.1045711.n5.nabble.com/T5-3-rc3-ordering-of-css-tp4969412p4969412.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
T5.3 rc3 ordering of css
Hi, is there any documentation how the ordering of css is done? I've tried stacks and straight imports, but I really haven't found any way to say that my css is last. I use T5-jquery library and the included form.css is always attached later than mine. (Effectively only way to override bits of that css is to write inline css to my forms?) - Ville -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-3-rc3-ordering-of-css-tp4969412p4969412.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