java - Best way to style GWT widgets in a library -
i'm developing widgets library internal use @ company work for.
i don't know what's recommended way style widgets.
there @ least these ways:
use widget.setprimarystylename , let user provide external css. use maven archetypes build applications can provide default styles. anyway don't much.
use gwt 2.0 cssresourcebundle. can compile css module , optimized (and can browser-dependant too).
provide module styling. default gwt themes. don't know how works.
i want to:
- make components cohesive can (don't depend on externally included css's)
- leave open door modify styles (if want change way widget looks in concrete application).
what's experience in subject?
note: if looking definitive answer through answers , comments. there different ideas , ones. choose best :)
i think best way provide styles in module. way able restyle, or add "themes" controls.
i'm doing similar project hosted on github (http://github.com/markovuksanovic/gwt-styles), might want check out. can download jar file, include in project , specify in module xml wanna use style.. sth like
<inherits name='gwt.theme.flick.flick'/>
i suggest use new module styles can switch among styles... (just change inherits tag). so, example, if 1 of widgets used css class "my-widget", have "style" module (or multiple modules) define css class (in css file) - way have multiple modules implement css class , switching amongst them easy changing module name in inherits tag. way nicely decoupled code - styles independent of technical implementation of widgets. if have more questions, feel free ask.
p.s. forgot mention above - pay close attention on how style module built (build.xml), it's little tricky. can find more information creating modules @ following lication http://developerlife.com/tutorials/?p=229
Comments
Post a Comment