using css with raphaelgwt

28 views
Skip to first unread message

pablochacin

unread,
Mar 2, 2012, 12:54:00 PM3/2/12
to raphaelgwt
Hi

I'm quite new to GWT and raphael. I'm working on which I will be using
raphaelgwt extensively to create complex vector graphics with many
shapes. I would like to use CSS to specify the attributes of those
shapes, like fill color, stroke width, etc. It would be even better If
I could use GWT'ws UIBuilder so that I can define the elements and
associate the styles in a declarative way, but this is not required
(just preferred, as the rest of the widgets will be defined using
UIBuilder.

I haven't found any example of how to set a shape's attributes from a
CSS. I will appreciate any help.

Regards

Pablo

Sebastian Gurin

unread,
Mar 2, 2012, 3:01:28 PM3/2/12
to rapha...@googlegroups.com
I think raphaël doesn't support reading element attributes from css. raphaël attributes names are not valid css names (i.e stroke, transform , etc do not exists in css).

Also there is the problem about how to reference raphaël shapes for applying the style, i.e. how do you do .button {stroke: "red"} or #apple1 {...}. Perhaps using raphael Element's setData(), like b1.setData("class", "button") ?

Also, in GWT, I wonder how the css will be provided to the application. using <style>? retrieving css code from ajax ? using gwt CSSResource?

It is an interesting idea indeed, and I think it can be done, but first defining some directions (like above).

Regards


--
Sebastian Gurin <sgu...@softpoint.org>

Reply all
Reply to author
Forward
0 new messages