Object styles
The ObjectStyle element — the page-item analogue of a text style — its fill, stroke and corner attributes, its Enable switches, and the built-in [None] style.
An object style supplies the formatting a frame or shape takes when it does not set a value itself.
In short Where paragraph and character styles format text, an <ObjectStyle> formats a
page item: a text frame, rectangle, oval, polygon or line. It can carry fill, stroke and corner
settings, transparency effects, text frame options, text wrap and anchored-object settings. A
page item names its style with AppliedObjectStyle. Object styles inherit through BasedOn,
written as a typed <Properties> child, and the item's own attributes win over the style.
Where they live
Object styles sit under <RootObjectStyleGroup> in Resources/Styles.xml, optionally inside
<ObjectStyleGroup> folders. InDesign writes a set of built-ins into every document:
ObjectStyle/$ID/[None]— no fill, no stroke; the style an item has when it has none.ObjectStyle/$ID/[Normal Graphics Frame]— the default for new graphic frames and shapes.ObjectStyle/$ID/[Normal Text Frame]— the default for new text frames.ObjectStyle/$ID/[Normal Grid]— the default for frame grids, used in CJK layouts.
A rectangle with no fill or stroke of its own applies the "Panel" object style, which is
based on [None] and supplies a 40 % red fill and a 2 pt black stroke.
Attributes
| Attribute · ObjectStyle | Values | Paged | paged.set |
|---|---|---|---|
| FillColor | Color / Swatch reference | read · written | frameFillColor |
| FillTint | number (percent) | read · written | frameFillTint |
| StrokeColor | Color / Swatch reference | read · written | frameStrokeColor |
| StrokeTint | number (percent) | read · written | objectStyleStrokeTint |
| StrokeWeight | length (pt) | read · written | frameStrokeWeight |
| StrokeType | StrokeStyle reference | not read | |
| StrokeAlignment | CenterAlignment | not read | |
| CornerOption | None | RoundedCorner | InverseRoundedCorner | InsetCorner | BeveledCorner | FancyCorner | read · written | objectStyleCornerOption |
| CornerRadius | length (pt) | read · written | objectStyleCornerRadius |
| TopLeftCornerOption | None | not read | |
| TopLeftCornerRadius | integer / real | not read | |
| AppliedParagraphStyle | ParagraphStyle reference | not read |
Corners come in two spellings. CornerOption and CornerRadius set all four corners at once;
TopLeftCornerOption, TopRightCornerOption, BottomLeftCornerOption and
BottomRightCornerOption, each with its own …CornerRadius, set them one by one. InDesign
writes both. The corner tokens are None, RoundedCorner, InverseRoundedCorner,
InsetCorner, BevelCorner and FancyCorner.
AppliedParagraphStyle gives the paragraph style a text frame's new text starts in;
ApplyNextParagraphStyle chains through the paragraph styles' NextStyle.
Enable switches and categories
An object style is a set of categories, and each category has an Enable… switch: EnableFill,
EnableStroke, EnableStrokeAndCornerOptions, EnableParagraphStyle,
EnableTextFrameGeneralOptions, EnableTextFrameBaselineOptions, EnableTextWrapAndOthers,
EnableAnchoredObjectOptions, EnableFrameFittingOptions and others. A category whose switch is
false is not part of the style: applying the style leaves that aspect of the item alone. The
categories' settings are child elements of the style: <TextFramePreference>,
<TextWrapPreference>, <AnchoredObjectSetting>, <FrameFittingOption>, and the
<ObjectStyle…EffectsCategorySettings> blocks for transparency effects on the object, its
fill, stroke and content.
In Paged: an object style's fill, fill tint, stroke, stroke tint, stroke weight and the all-corner
CornerOption/CornerRadiuscascade into the items that apply it, and all five corner shapes are drawn. The per-corner attributes, theEnable…switches, theAppliedParagraphStyledefault and the effect, text-frame and wrap categories of an object style are not read yet; an item's own effects, text-frame options and wrap are.Swatch/Noneon an object style is read as unset rather than "no paint". Object styles survive a save. Supported · verified Supported · verified
How the style and the item combine
A frame's own attributes win. Whatever the frame leaves out comes from its object style,
resolved through that style's BasedOn chain. This is the same layering a run's local override
has over its character style.
Frequently asked questions
What does an object style format? A page item: a text frame, rectangle, oval, polygon or graphic line. It can carry fill, stroke, corners, transparency effects, text frame options, text wrap and anchored-object settings.
What is the [None] object style?
InDesign's built-in style with no fill and no stroke. An item that applies
ObjectStyle/$ID/[None] takes its whole look from its own attributes.
What do the Enable… attributes on an object style do?
Each switches one category of the style on or off. A disabled category is not part of the
style, so applying the style does not touch that aspect of the item.
How are rounded corners written on an object style?
With CornerOption="RoundedCorner" and CornerRadius for all four corners, and with the
per-corner TopLeftCornerOption / TopLeftCornerRadius family. InDesign writes both.
Character styles
The CharacterStyle element — identity, BasedOn, the attributes it usually sets, and how a range that applies a character style can still override one attribute.
Table and cell styles
The TableStyle and CellStyle elements — how a table style assigns a cell style to each region and dresses the table, and what a cell style carries.