Servoy provides support for cascading style sheets to control the appearance of fonts and other objects (including checkboxes, buttons, etc.). It supports a subset of CSS 2.1; however CSS use in Servoy is limited to styling and not positioning (which is done through the Forms Editor).

Stylesheets are stored in the solution's Resources project. This chapter describes how to create a new style sheet, manage your stylesheets, and use some of the features of the Script Editor.

Creating a New Stylesheet

To create a new stylesheet:

  1. In Solution Explorer under the Resources node, right-click on Styles and select Create new style from the context menu. (Alternatively, click on the Styles button on the mini-toolbar of the contextual list.)
  2. Enter a name for the new stylesheet.
  3. Click Next to select the option to fill the new style with sample content, if desired.
  4. Click Finish

Managing Your Stylesheets

The Solution Explorer allows you to view, open, and delete your style sheets. 

To open an existing stylesheet:

  1. Expand the Resources node, if it is currently collapsed.
  2. Click on Styles. A list of stylesheets will appear in the contextual list (the bottom part) of the Solution Explorer.
  3. Double-click on the desired stylesheet to open. The stylesheet will open in the Script Editor view. Alternatively, you can:

To delete an existing stylesheet:

  1. Expand the Resources node, if it is currently collapsed.
  2. Click on Styles. A list of stylesheets will appear at the bottom part of the Solution Explorer.
  3. Select the stylesheet to be deleted. 
  4. Delete the stylesheet using one of two options:
  5. Click OK to confirm delete in the confirmation window that appears.

Style Editor Features

The Style Editor contains the following special features:

Other common scripting features can be accessed via the context menu in the Style Editor. These include Undo/Redo, Revert File (to the last saved version), and file comparison.