Tuesday, November 19, 2013

Re: Changing css without recompiling



Thanks Ed,


that's close to what I'm looking for but not quite. I'll try and explain. I actually got closer (or so I thought) to achieving what I wanted.

What I did is all the css classes that were included in my uibinder templates I changed to @external so they don't get obfuscated. That seemed to work fine.

My next step was going to be to add a <link> to the host html where I could include perhaps the same css file and then at runtime simply replace it if I wanted to change the style.
The issue I ran into is that it turns out that in the generated html (once I visit my page) GWT places all the 'compile-time' styles in <style/> tags that ALWAYS come right AFTER the <link> tag!

So I end up with something in my html..

<head>

<link>include the overriding css</link>
<!-- but now that is overriden with the compile time styles!!! -->

<style> ....</style>
</head>


If I go and manually change the generated html and swap the order of the <link> and <style> tags I get exactly what I wanted, the css referred to in the <link> tag overrides any "compile-time" styles
defined in the <style> tags.

However, I cannot get gwt to follow this order!

Using your suggestion, I tried to inject the css as part of onModuleLoad() but that also places it right before the <style> tags so no luck there.

Any other suggestions? I feel I've hit a brick wall here even though I find it hard to believe it's not possible. In other words, I feel it's me, not gwt! :)


Cheers!



--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment