Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

This content has been archived and is no longer being updated.

Links may not function; however, this content may be relevant to outdated versions of the product.

Using mixins in the skin to drive consistency and efficiency

Updated on May 3, 2020

A mixin is a reusable style pattern that you define in the skin. Mixins enable you to create incremental styling changes which provide a natural cascading of styles.

Using mixins helps ensure consistency across your user interface, maximize re-use, and minimize future maintenance. You can define mixins on the Mixins tab in the skin.

mixin_tab_0.png

About Mixins

Mixins can define a reusable typography, border, or background style — or a style that is a combination of typography, border, and background styles.

 You can modify, add, and delete mixins in the following categories:

  • Typography  — text styling mixin. Mixins in this category can inherit from other mixins containing text styling.
  • Backgrounds  —  background styling mixin. Mixins in this category can inherit from other mixins containing background styling.
  • Borders  — border styling mixin. Mixins in this category can inherit from other mixins containing border styling.
  • Combinations  — combination of text, border, or background styles. Mixins in this category can inherit from any other mixins.

If you want to create a mixin that is a combination of text, background, or border styling, add a mixin within the Combinations category. 

Mixin inheritance

You can reuse mixins in other mixins and component style formats. This provides consistency and enables you to easily and efficiently make modifications to your UI styling.

A mixin can inherit styles from other mixins. For example, the Heading 1 mixin inherits text styling from the General mixin.
mixin_inheritance_0.png

Note that a mixin can inherit some style elements from another mixin and override others. For example, the Heading 1 mixin inherits the Open Sans font from the General mixin, but overrides the Font size.
overrides_0.png

Using mixins in component style formats

Component style formats, such as dynamic layouts, or controls, such as buttons and links, can also inherit styling from mixins. You can reference one or multiple mixins to define the appearance of  component style formats.

For example, the Standard Button style format uses the General mixin to set its text styling.

component_references_mixin.png

Mixins and natural cascading of styles

Mixins can inherit from one another and component style formats can inherit from mixins. This provides a natural cascading of styles.

You can change mixins at any time. A change to a mixin cascades throughout all mixins and style formats in the skin that reference the mixin. This means that if you modified the General mixin, the change would display in all mixins and style formats that reference the General mixin, including the Standard Button style format.

Mixins and component style formats simplify your skin, ensure greater consistency, and enable easy and efficient modifications to your UI styling.

 

When you open a pre-PRPC 7.1 skin, mixins, formerly known as style presets, are automatically placed in the correct category. For example, a style preset containing only text styles displays in the Typography category, while a style preset containing text and background styles displays in the Combinations category.

 

Have a question? Get answers now.

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

Did you find this content helpful?

Want to help us improve this content?

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