Skip to content
Sebi1006 edited this page Jun 25, 2021 · 15 revisions

The Style DSL is used for the design of elements like CSS.

  • A defined style can inherit from one or more other styles.
  • The attribute description is required (can also be an empty string).
  • Colors can be defined as hex-code (e.g. #ff0000) or as color-name (e.g. red).

A style is described with:

style <identifier> extends <identifier, identifier> { [attributes] }

Attributes

Attribute Type
description String
transparency Double
background-color Color
line-color Color
line-style String
line-width Int
font-color Color
font-name String
font-size Int
font-bold Boolean
font-italic Boolean
gradient-orientation String
gradient-area-color Color
gradient-area-offset Double

*Color = javafx.scene.paint.Color

Example

style corporateStyle {
  background-color = red
  line-color = blue
  line-width = 4
  line-style = dash
  font-name = Arial
  font-color = white
  font-size = 16
  font-italic = false
  font-bold = false
}

Example with all supported attributes including style inheritance

style X extends Y, Z {
  description = "Style for a connection between an interface and its implementing class"
  transparency = 1.0
  background-color = #ffffff
  line-color = black
  line-style = dash
  line-width = 1
  font-color = black
  font-name = Helvetica
  font-size = 20
  font-bold = true
  font-italic = true
  gradient-orientation = vertical
  gradient-area-color = black
  gradient-area-offset = 2.0
}