Skip to main content

 

Developing an Application

 

 

OutSystems

Cascading Style Sheets (CSS)

Cascading Style Sheets (CSS) is a language for describing how HTML content should look in a browser. OutSystems uses the Silk framework (except for the themes based on London theme) and each theme has its own CSS. You can add new styles and modify the existing ones by copying them from the base Theme.

These elements have their own CSS which you can edit:

  • Themes
  • Web Screens and Emails
  • Web Blocks
  • Widgets (complex widgets have more than one style)

Applying CSS with the class attribute

You can specify classes of an element in the Properties Pane either by using the Style Classes or by using the Extended Properties and setting the Property field as class.

To specify static classes using Style Classes:

  • In Web Applications insert the class names without quotes and separated by a space (bold red)
  • In Mobile Applications insert the class names with quotes and separated by a space ("bold red")

To specify the CSS classes dynamically use an Expression:

  • In Web Applications use an Expression to define the class attribute in the Extended Properties
  • In Mobile Applications use an Expression in the Style Classes field

Editing CSS

CSS is edited in Style Sheet Editor. You can open it by double-clicking Style Classes property in Properties Pane when you edit an element that can have CSS.

You can also open Style Sheet Editor by clicking the CSS button in the Main Editor toolbar. Select the tab with the application name and define or edit the style to make it available to the whole application. Alternatively, select the tab with the name of the currently selected screen or block to narrow the scope of the style to that screen or block.

CSS of the Theme

CSS specificity

The styles have different priority and the order Service Studio imports the style sheets affects how the browsers apply them. The last style to be applied has the highest priority.

  1. System style sheet for Container widgets in the Grid
  2. Web Blocks style sheet
  3. Theme style sheet, which also includes a base theme (if specified)
  4. Web Screens or Emails style sheet
  5. Theme extra style sheet, with the Grid settings defined in the Theme properties
    1. Inline style you define in Attributes or Extended Properties

Inline CSS

To use inline CSS you can create it by adding style in the Extended Properties and then entering the CSS rules (for example, "background-color: green;").

OutSystems Grid

OutSystems uses a high-level grid system. If you specify the number of columns in the Theme grid settings, the width of elements can be expressed in columns. In some properties (for example, Margin Top), Service Studio converts auto to Auto. The Auto indicates the values are calculated automatically.

Importing CSS

Use the @import CSS at-rule in Style Sheet Editor to import style rules from other locations. Put it as the first line in your sheet.

Preporcessors

OutSystems development tools do not support use of CSS preprocessors (such as Sass ot LESS) in apps.