Skip to main content

 –

Creating CSS helper classes

Suggest edit Updated on July 21, 2021

Make quick adjustments to the look and feel of your UI by creating a CSS-based helper class that you can use throughout your application. Helper classes style a single UI element, such as a control, and do not affect the appearance of other elements of the same kind, even if those elements use the same style format.

For example, you can create a helper class for green text. When you apply it to a button that uses the Strong style, the text on the button turns green, but other buttons that use the same Strong style format do not change.

Before you begin: Review the existing CSS helper classes to ensure that you need the additional helper class. For more information, see Reviewing standard CSS helper classes.
  1. Create a CSS file with the helper class that you want to add to the application.

    Tip: In the code, you can use the formats that are defined in mixins. For example, your CSS code can reference the color of the urgent mixin by using the variable $mx-urgent-color. You can access the full list of mixin variables and their values by clicking ActionsView mixin variables on the skin tab, or use autocomplete if you are developing the CSS file in Pega Platform.
  2. For each helper class, before the CSS Selector, add the following comment to define the properties and purpose of the helper class:

    Depending on where you want to use the helper class, the <target use> variable can have a value of layout, cell, or layout,cell.

    For example: This code adds a helper class that changes the text color to green. You can use this helper class in cells only.
    Code block representing a sample helper class.
  3. Attach the CSS file as an additional style sheet in your application skin.

    For more information, see Attaching a CSS to the skin.
Did you find this content helpful? YesNo

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Ready to crush complexity?

Experience the benefits of Pega Community when you log in.

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us