Style sheets
While you can format graphic objects locally in
Properties
for a specific object, use a Style sheet object to globally specify style values displayed at runtime.Style sheets apply to all graphic objects in the project or a specific class of objects, such as
Switch
objects. FactoryTalk Optix Studio
includes default style sheet templates in the Templates
window.Style sheet properties include:
- Text and background colors
- Font family, thickness, font type, and weight
- Padding
- Opacity
- Radius and border thickness
- Animation duration
You can create more than one style sheet in the same project. This allows you to specify a different style sheet at runtime.
Some properties exist in both the style sheets and specific graphic objects. If the property is set in the graphic object, the property value overrides the value in the style sheet. If the object property is set to the default value, the object inherits the property value from the style sheet.
Objects and object instances inherit style properties from a style sheet and object types. Projects can contain multiple style sheets. Multiple style sheets allow you to switch between styles. For example, you could switch between a light interface and dark interface at runtime.
Inheritance of style properties
A property can be set at more than one level. For example, text color can be set in both the style sheet globally and on a custom
Label
object type. For a graphic object, property values are set in this order:
- Instance
- Object type of the instance
- Style sheet for the object class
- Global style sheet
If the value of a property is set to
Default
, the property inherits the value set at a higher level, in the order above. For example, if the value of Text color
for the instance of a Label
object is Default
, the color value that is set is the first value found for the same property of type, object class, or global level, in that order.Provide Feedback