Class StyleVariantConfig
java.lang.Object
com.inductiveautomation.perspective.common.config.styles.StyleVariantConfig
A style variant is one style or animated style, which might serve as the base style for a Style Class or as
a media-query or pseudo-selector variant style.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionThis is the style block + animation settings for animated styles.This will be non-null if this style variant is a media-query varient.This will be non-null if this style variant is a pseudo-selector variant.This is the style block for this variant for non-animated styles. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
append
(StringBuilder css, String className, Integer variantIndex) Compile this style to CSS format.boolean
boolean
boolean
-
Field Details
-
pseudo
This will be non-null if this style variant is a pseudo-selector variant. -
media
This will be non-null if this style variant is a media-query varient. -
style
This is the style block for this variant for non-animated styles. -
animation
This is the style block + animation settings for animated styles.
-
-
Constructor Details
-
StyleVariantConfig
public StyleVariantConfig() -
StyleVariantConfig
-
-
Method Details
-
isDefaultStyle
public boolean isDefaultStyle() -
isAnimated
public boolean isAnimated() -
equals
-
append
public void append(@Nonnull StringBuilder css, @Nonnull String className, @Nullable Integer variantIndex) Compile this style to CSS format.For example, let's say we have the following style represented by its serialized JSON format:
Resource "A":
The output of this method will compile this style to CSS. The CSS class name is equal to the style project resource name prepended with "psc-":{ "declarations": { "paddingTop": "10em", "borderColor": "red" } }
.psc-A:in-range { border-color: red; }
- Parameters:
className
- The name of the CSS class to generatevariantIndex
- The index of this variant in the parent style class, or null if this is the base variant
-