5.4. CssResource

Cascading Style Sheets (CSS) work fine for styling HTML, but when it comes to styling dynamic applications, CSS begins to show its limitations. Have you ever wished you could define constants or put conditional sections in your CSS? How about making method calls from CSS or defining values at runtime (runtime substitution)? Css-Resource gives you all of these features and more. It also adds optimization and obfuscation to make the CSS as efficient as possible.

Like the other resources, you define a method in our ClientBundle to return an instance of your CssResource and use a @Source annotation if necessary to point to the CSS file.

Unlike the other resource types you’ve already seen, you can’t use CssResource directly. The ...

Get GWT in Action, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.