Whether you're using predefined style sheets provided by the modeling tool or custom ones you've created, you can manage which style sheets are activated for the entire project and which for specific views. This flexibility allows you to combine multiple style sheets based on your modeling needs—for example, activating a global style sheet for the entire project while activating distinct style sheets for individual views. Additionally, style sheets activated at both the project and view levels can be prioritized by setting their order of application. You can also disable project-level style sheets for a specific view.

Style sheets can be activated for:

Style sheets activation priority order

The order of priority in which the style sheets are activated for views:

  1. The configurations for activating style sheets for individual views are of the highest priority. They are always of higher priority than the configuration for activating style sheets for the entire project.
    1. Take note of the type of style sheets you are using, i.e., whether the style sheet is created by reusing another or created from scratch. Those that reuse another style sheet inherit the latter's rules. This can result in unexpected usage of styles even if their style sheets are not activated directly. 

      Example

      • You have a custom style sheet, NewStyleSheet, which is created by subclassifying the DefaultStyleSheet. The NewStyleSheet contains several rules slightly modifying the DefaultStyleSheet.
      • You activate NewStyle for a specific view and BlackAndWhiteStyleSheet for the entire project.
      • The specific view with the activated NewStyleSheet displays some symbols with the styles inherited from the DefaultStyleSheet, even though the latter is not activated for the project.
  2. The ordering of style sheets for both individual views and the entire project is taken into account. If you specify multiple style sheets, order them based on your preferred priority, as the style sheets higher on the list take precedence over those lower on the list.
    • You can specify multiple style sheets. Activating multiple style sheets is useful if the prioritized style sheet does not cover all available symbols. In that case, the secondary style sheet will cover those not covered by the first (if it contains the necessary rules). 
    • If you specify multiple style sheets, order them based on your preferred priority, as the style sheets higher on the list take precedence over those lower on the list.
  3. The configuration for activating style sheets for the entire project is considered last.

Activating style sheets for the project

There must always be at least one style sheet activated for the project. If no style sheet is activated by the user, the default active project style sheet is DefaultStyleSheet.

Activating style sheets for the project via the Textual Editor

To activate style sheets for the project via the Textual Editor


  1. Declare a root namespace and open it in the Textual Editor.
  2. In the new package's body, declare an individual part definition and subset DS_Styles::CoreStylesComponents::StyleConfiguration.
  3. In the package's body, declare a part and define it by the part definition of the style sheet you want to activate for the project, then subset activeStyleSheets.
  4. Click the Synchronize button.

package ProjectStyleConfig {
    individual part def myProjectStyleConfig :> DS_Styles::CoreStylesComponents::StyleConfiguration {

        // BlackAndWhiteStyleSheet is activated as the primary style sheet for the project, and the DefaultStyleSheet as the secondary
        part : DS_Styles::StyleSheets::BlackAndWhiteStyleSheet :> activeStyleSheets;
        part : DS_Styles::StyleSheets::DefaultStyleSheet :> activeStyleSheets;
    }
}

Activating style sheets for the project via the Style Sheets button

To activate style sheets for the project via the Style Sheets button


  1. Click the Style Sheets button in the view toolbar. In the dropdown menu, click Project Style Sheets command. The Project Style Sheets dialog opens.
  2. On the left side panel of the Project Style Sheets dialog, select the style sheet(s) you want to use and click the Add button.  
  3. Select a style sheet on the right side of the panel and click the Up or Down buttons to change the selected style sheet's priority. 
  4. Click the OK button. The selected style sheets are activated and element symbols are updated on project views.

    Activating style sheets for the project via the Style Sheets button automatically creates a new namespace ProjectStyleConfig with the active project style sheets configuration.

Activating style sheets for a specific view

To activate style sheets for a specific view, the view must be defined by a symbolic view definition.

Activating style sheets for a specific view via the Textual Editor

To activate style sheets for a specific view via the Textual Editor


  1. In the Textual Editor, place the cursor within the body of the specific view whose style sheets you want to modify.
  2. Declare a part and define it by the needed style sheet, then subset explicitlyAppliedStyleSheets.
  3. (Optional) To ignore the specification of active project style sheets for the selected view, only taking into account the style sheets specified for this exact view:
    1. Declare a part, redefine effectiveStyleSheets and set it to explicitlyAppliedStyleSheets.
  4. Click the Synchronize button.

view 'General View' : DS_Views::SymbolicViews::gv {

   // ignores active project style sheets for the view, activating only those specified to be active for this view:
   part :>> effectiveStyleSheets = explicitlyAppliedStyleSheets

   // activating NewStyle1 and NewStyle2 style sheets for this specific view:

   part : NewStylesPackage::NewStyle1 :> explicitlyAppliedStyleSheets;
   part : NewStylesPackage::NewStyle2 :> explicitlyAppliedStyleSheets;

   // alternative notation for active style sheet specification for a specific view (equivalent to the above):

   part :>> explicitlyAppliedStyleSheets = (NewStylesPackage::NewStyle1(), NewStylesPackage::NewStyle2());
}

Activating style sheets for a specific view via the Style Sheets button

To activate style sheets for a specific view via the Style Sheets button


  1. Open the specific view whose style sheets you want to modify. 
  2. Click the Style Sheets button in the view toolbar. In the dropdown menu, click Apply Style Sheets command. The Apply Style Sheets dialog opens.
  3. On the left side panel of the Apply Style Sheets dialog, select the style sheet(s) you want to use and click the Add button.  
  4. Select a style sheet on the right side of the panel and click the Up or Down buttons to change the selected style sheet's priority. 
  5. (Optional) Select the check box for the Ignore Active Project Style Sheets option. Selecting the option ignores the specification of active project style sheets specified in the Project Style Sheets dialog for the selected view, only taking into account the style sheets specified for this exact view in the Apply Style Sheets dialog.
  6. Click the OK button. The selected style sheets are activated, and element symbols are updated in the view.