How do styles work?

<< Click to Display Table of Contents >>

Navigation:  Reference > Styles, Formatting and Tables >

How do styles work?

To understand how dynamic styles work you need to understand three concepts: Style definitions, dynamic linking and dynamic inheritance. Style definitions are how you create styles, dynamic linking is how your styles are associated with your text and dynamic inheritance enables you to create related "families" of styles.

Style definitions:

A style is a set of formatting definitions with a name that makes it possible for you to identify and select it. It can include all the formatting attributes that you can apply to text and paragraphs with the Font, Paragraph and Borders and Backgrounds formatting tools.

For convenience, you can create two kinds of styles: Text styles, which only define font formatting attributes, and paragraph styles, which define all available attributes, including font attributes. Similarly, styles can also be linked to either entire paragraphs or individual passages of text. These are the two "units" that are used in connection with styles. (See Paragraph and text styles for details.)

Dynamic linking:

A set of formatting definitions is no good on its own, of course. Styles are useful because you can link them to paragraphs and text in your project. As soon as you apply a style to a paragraph or a passage of text the style definition is dynamically linked to that paragraph or that text. All the style attributes are applied to the paragraph or the text automatically, and when the cursor is in the paragraph or the text the name of the style is displayed in the style selector in the Toolbar:

  Here the cursor is in a paragraph
  formatted with the Normal style.

We say that the style is dynamically linked because all changes in the style definition are automatically and immediately reflected in all paragraphs and/or text linked to the style. If you change the font face, font size, paragraph indents and so on in the style definition these changes are all immediately reflected in all the paragraphs and text linked to the style.

Dynamic inheritance:

Most styles are based on other styles. This makes defining styles easier, because you often have groups of quite similar styles. In addition to this it also makes styles much more powerful.  Here's why:

We refer to "parent" and "child" styles. Just as a human child inherits some genes from its parents and has some unique characteristics of its own, styles also inherit some properties from their parents and have some properties of their own.

In styles, however, inheritance is dynamic, in exactly the same way that linking to the text formatted by styles is dynamic. All attributes that you don't change in the child styles are shared with the parent style. If you change an attribute in the parent style the change is immediately reflected in both the child style and all paragraphs and/or text formatted with the child style.

This means that you can make changes to entire "families" of styles, and to all the text formatted with those styles, just by editing one parent style. For example, you can usually change the font in your entire project by changing the font setting in the Normal style, because most of styles in your project are  usually based on that style.

See About inheritance in styles for full details on this subject.

See also:

Text Formatting and Styles (how-to instructions)

About inheritance in styles