Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipse-incubator-e4-dev] CSS namespaces


Angelo brought up CSS namespaces, I think this is an important topic that hasn't been discussed here yet. The question is how to specify custom widget types in CSS. With SWT, the widget names are unambiguous, but custom widgets can involve name collisions.

Using CSS namespaces would be an option, although I would then opt for using a default namespace for SWT to avoid clutter. The CSS could look like this:

  @namespace "org.eclipse.swt.widgets";
  @namespace my "";

  Label {

  my|Label {

On the other hand, some frequently used SWT widgets live in "org.eclipse.swt.custom" (CLabel, CCombo, CTabFolder, ...), so those would have to be prefixed as well (which I somehow dislike):

  swtcustom|CLabel {
    color: blue;

Moreover, CSS 3 is not yet widely adopted and the available parsers do not support it out-of-the-box.

An alternative to CSS namespaces could be some kind of mapping between widget classes and CSS element names.


Best Regards,

CSS 3 Namespaces:

Back to the top