[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipse-incubator-e4-dev] CSS flavor used for theming in RAP
|
Hi Angelo,
Thanks for pointing me to the TK-UI CSS engine, which is very
interesting. See my comments inline.
Angelo zerr wrote:
Hi Ralf,
I have read your RAP description about your CSS engine.
Thank you.
It seems that your CSS engine looks like TK-UI CSS engine.
TK-UI CSS design is very similar to Matthew Hatem's work too. But TK-UI
have design to manage any Object with CSS (Swing widgets, SWT widgets,
update XML element....).
My question is how do you apply CSS styles. Have you API to apply
styles.
We do not directly apply styles to the widgets. We parse the CSS theme
files and generate instructions for our client library that define the
default style of widgets.
RAP application developers register the CSS theme file with an extension
point. There is no other API to apply styling.
If you are interested you can see the TK-UI API at
http://tk-ui.sourceforge.net/user-guide/cssengine/cssengine.html.
Thanks for the pointers, I'll have a look closer look at it asap.
You can find some information about SWT CSS implementation at
http://tk-ui.sourceforge.net/user-guide/cssengine/swtcssengine.html.
I just read this. It seems that the CSS flavor of the SWT part of your
engine is indeed quite similar to ours, except for the use of attribute
selectors. Let me ask a few question regarding this:
You refer to SWT styles like this:
Button[style='SWT.CHECK'] {
color:red;
}
How would I select a button that has both style flags PUSH and BORDER set?
One other thing I'm not quite sure about: You map style as well as all
other widget properties, plus any user data to attributes, e.g.:
text.setEditable( true );
Text[editable=true] {
color: blue;
}
text.setData( "foo", "warning" );
Text[foo="warning"] {
color: red;
}
This mean that style flag (or property) attributes could also be
overwritten like this:
Button button = new Button( parent, SWT.PUSH );
button.setData( "style", "SWT.RADIO" );
Would this result in a push button rendered like a radio button?
Wouldn't it be a good idea to avoid such collisions by prefixing user
data attributes like this:
Text[data.foo="warning"] {
color: red;
}
Best Regards,
Ralf