The user interface for Eclipse 4 is styled with CSS. Although this is loosely based on the CSS syntax used in browsers, the content that can be used is interpreted by the Eclipse 4 runtime. CSS stylesheets are composed of selectors and style rules. A selector can be one of a widget name (for example, Button
), a model class name (for example, .MPartStack
) or an identifier (for example, #PerspectiveSwitcher
).
The default Eclipse 4 application generated by the wizard with sample content will have an empty CSS file called
css/default.css
. Open this file, and add the following rule:Shell { background-color: blue; }
Run the application, and the background of the window (
Shell
) will be shown in blue.Basic CSS color names are supported, but hex values can also be used. Modify the
default.css
file as follows:Shell { background-color: #00FF00; }
Run the application, and the background color will be shown in green.
It's possible to support vertical gradients...