Skip to main content

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

Hi,

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 "my.name.space";

  Label {
    color;red;
  }

  my|Label {
    color;red;
  }

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.

Thoughts?

Best Regards,
Ralf

CSS 3 Namespaces: http://www.w3.org/TR/2008/CR-css3-namespace-20080523/


Back to the top