paged.IDML Reference
Styles

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.

Tier: IntermediateIntermediateIIreference

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.

Resources/Styles.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<idPkg:Styles xmlns:idPkg="http://ns.adobe.com/AdobeInDesign/idml/1.0/packaging" DOMVersion="20.0">
  <RootCharacterStyleGroup>
    <CharacterStyle Self="CharacterStyle/$ID/[No character style]" Name="$ID/[No character style]"/>
  </RootCharacterStyleGroup>
  <RootParagraphStyleGroup>
    <ParagraphStyle Self="ParagraphStyle/$ID/[No paragraph style]" Name="$ID/[No paragraph style]" PointSize="12" FillColor="Color/Black">
      <Properties>
        <AppliedFont type="string">Open Sans</AppliedFont>
      </Properties>
    </ParagraphStyle>
  </RootParagraphStyleGroup>
  <RootObjectStyleGroup>
    <ObjectStyle Self="ObjectStyle/$ID/[None]" Name="$ID/[None]" FillColor="Swatch/None" StrokeColor="Swatch/None" StrokeWeight="0" AppliedParagraphStyle="ParagraphStyle/$ID/[No paragraph style]" CornerOption="None" CornerRadius="0" EndCap="ButtEndCap" EndJoin="MiterEndJoin" MiterLimit="4" StrokeAlignment="CenterAlignment" StrokeType="StrokeStyle/$ID/Solid" Nonprinting="false"/>
    <ObjectStyle Self="ObjectStyle/Panel" Name="Panel" EnableFill="true" EnableStroke="true" FillColor="Color/Red" FillTint="40" StrokeColor="Color/Black" StrokeWeight="2">
      <Properties>
        <BasedOn type="object">ObjectStyle/$ID/[None]</BasedOn>
      </Properties>
    </ObjectStyle>
  </RootObjectStyleGroup>
</idPkg:Styles>

Attributes

Attribute · ObjectStyleValuesPagedpaged.set
FillColorColor / Swatch referenceread · writtenframeFillColor
FillTintnumber (percent)read · writtenframeFillTint
StrokeColorColor / Swatch referenceread · writtenframeStrokeColor
StrokeTintnumber (percent)read · writtenobjectStyleStrokeTint
StrokeWeightlength (pt)read · writtenframeStrokeWeight
StrokeTypeStrokeStyle referencenot read
StrokeAlignmentCenterAlignmentnot read
CornerOptionNone | RoundedCorner | InverseRoundedCorner | InsetCorner | BeveledCorner | FancyCornerread · writtenobjectStyleCornerOption
CornerRadiuslength (pt)read · writtenobjectStyleCornerRadius
TopLeftCornerOptionNonenot read
TopLeftCornerRadiusinteger / realnot read
AppliedParagraphStyleParagraphStyle referencenot read
Selected attributes. All 64 attributes of ObjectStyle →

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 / CornerRadius cascade into the items that apply it, and all five corner shapes are drawn. The per-corner attributes, the Enable… switches, the AppliedParagraphStyle default 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/None on 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.

On this page