Thursday, May 15, 2014

Re: Dynamically replacing entire CSS style

I don't understand what most of that means. 

Where and how would I wrap "this" as a CSS rule?

What stylesheet are you talking about?

Is there a tutorial or something for this?  I've found several pages that mention StyleInjector, but they all seem to rely on knowledge I don't yet have.

Thanks for trying to help.

On Thursday, May 15, 2014 10:48:46 AM UTC-5, Thomas Broyer wrote:
You could probably wrap this as a CSS rule: ".somethingRandom {" + userProvidedCSS + "}" and then use the StyleInjector to inject that stylesheet, and finally call addStyleName on the Element or Widget to apply the rule.

On Thursday, May 15, 2014 4:54:30 PM UTC+2, eho...@usdataworks.com wrote:
I've figured out how to change CSS properties using Element.getStyle().setSomething(), but I need to replace an entire CSS style on the fly.  I want my users to be able to supply their own CSS for certain widgets and have GWT replace the current CSS with their user defined CSS.

So instead of asking a user for background image, background repeat, background size, etc, the user just pastes in

    background-size:100% 100%;
    background-repeat: no-repeat;
    background-image: url(some_image.jpg);

Is there a way to do this?

--
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/d/optout.

No comments:

Post a Comment