2.4.6. Using style variants
A style variant is a style which has the same Style-ID than another style, but has an additional variant name assigned. This way it is possible to create different formatting variants for the same style. The output configuration for a publication allows to set a variant name which defines the preferred style variant to be used for the formatting of a publication (see Section 2.6.2, “Output configuration”). This mechanism can be used to export the same publication in several different formatting variants, e.g. one variant for web- and one variant for print-output.
Let's assume that three styles exist with the same Style-ID "info_header". The first style has no variant name, the second style has the variant name "print" and the third style has the variant name "web". Furthermore let's assume a fourth style with Style-ID "warning_header" exists which has no variant. Following screenshot depicts the situation:
Figure 2.4.5. Style variants example
Given this example, if the variant "print" is set in the output configuration used for publication export, then the second style (with variant name "print") will be used to format all content elements to which the style "info_header" was applied. All content elements to which the style "warning_header" was applied, will be formatted with the fourth style, because if no style variant with the name given in the output configuration exists, then the style which has the same Style-ID but no variant name assigned will be selected.