Re: Conditional CSS Updates

2011-09-09 Thread rth
Thanks all for your feedback. The reason I was trying to do this in CSS is that I have one CSS files with media selectors that handle subtle (but important) layout changes for different orientations that also work on mobile phones, small (~7in) tables, and large tablets. To do this in UIBinder

Re: Conditional CSS Updates

2011-09-09 Thread Thomas Broyer
If you can detect the changes in JS, can't you simply switch a few CSS classes here and there? You could even switch a global one on the body element and use the descendant selector everywhere: .portrait .foo, .landscape .foo, putting class=portrait or class=landscape on the body element. --

Re: Conditional CSS Updates

2011-09-08 Thread rth
Thanks for the tip Sanjay, Looking into getText for the CssResource though it looks like only one branch of the @if statement is contained in the CssResource.getText() value. E.g., below you can see that only the @else block has been included in the CssResource text (the correct block is always

Re: Conditional CSS Updates

2011-09-08 Thread Ben Munge
I don't think you can do this with conditional styles. I think you'd be better off firing an event on the event bus when they orientation changes and just change class/style through an event handler. On Aug 29, 12:39 am, rth rthol...@gmail.com wrote: Hi, I have a Conditional CSS block that

Re: Conditional CSS Updates

2011-09-08 Thread Sanjay
Yes, I agree. Even if my proposed method worked, it is not meant for this. If anything, CSS3 Media Queries are meant for this. Alas, gwt doesnt support them yet. My advice: as much as possible, build fluid layouts that scale to the amount of room on the screen. If you need a master/details

Re: Conditional CSS Updates

2011-09-05 Thread Sanjay
AFAIK, ensureInjected() on CssResource just calls getText() and injects a style element into the DOM using StyleInjector once and only once. getText() is more interesting. Every CssResource text is converted into a series of string concatenations. The runtime evaluation @if (boolean-expr) {

Re: Conditional CSS Updates

2011-09-01 Thread rth
Submitted as Issue 6754. http://code.google.com/p/google-web-toolkit/issues/detail?id=6754 On Aug 31, 3:21 pm, Rylan ry...@icottrell.com wrote: +1 -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to

Re: Conditional CSS Updates

2011-08-31 Thread Rylan
+1 On Aug 28, 11:39 pm, rth rthol...@gmail.com wrote: Hi, I have a Conditional CSS block that calls isPortrait() at runtime and correctly renders the right rule based on its return value. My problem is that I cannot figure out how to get the condition to be reevaluated in the future (e.g.,

Conditional CSS Updates

2011-08-29 Thread rth
Hi, I have a Conditional CSS block that calls isPortrait() at runtime and correctly renders the right rule based on its return value. My problem is that I cannot figure out how to get the condition to be reevaluated in the future (e.g., when the orientation changes, I would like to have the

Re: Conditional CSS Updates

2011-08-29 Thread Juan Pablo Gardella
Interesting... +1 2011/8/29 rth rthol...@gmail.com Hi, I have a Conditional CSS block that calls isPortrait() at runtime and correctly renders the right rule based on its return value. My problem is that I cannot figure out how to get the condition to be reevaluated in the future (e.g.,