Skip to main content

Styles

The styles object holds named style definitions, and a node takes one by naming it in its "style" key. A style is a block of the keys CSS and SVG would write for the same thing, so formatting is stated once and every node that names it agrees.

{
"document": {
"styles": {
"h1": { "fontSize": 22, "fontWeight": "bold", "color": "#1A1A2E" },
"body": { "fontSize": 10, "color": "#333333", "textAlign": "justify" }
},
"content": [
{ "h1": "Main Heading" },
{ "p": "Body paragraph text." }
]
}
}

This page says how a style is declared and applied, and lists every key with the page that documents it: Box model, Typography, Colour and paint, Borders and Structural selectors, and the content pages for the keys that belong to one kind of node (Lists, Tables, Breaks, Columns, Images).


Declaring and applying a style​

WhereWhat it does
document.stylesEach entry is a name and a block of style keys: "callout": { "padding": 8, "backgroundColor": "#f3f4f6" }.
a node's styleThe named style the node is drawn in: a paragraph, a heading, a cell, a list, a table, a columns node, an image, a rule, an svg and its shapes, a table of contents, a watermark.
a node with only a style, first in a column or a cellStyles that column or that cell: { "style": "card" } gives the column its box.
[span, name]...[/span] inside textDraws the run in the named style's inline box: its text keys (color, fontFamily, fontSize, fontWeight, fontStyle, letterSpacing and the font-feature keys) and its box (padding, background, border, radius, clip path). A fontWeight or fontStyle it states is the run's own, so normal sets a run upright or regular inside a bold or italic paragraph. Keys an inline box does not take are named once in a NOTICE; see Shortcodes.

Inline tags such as [b], [i] and [color] override the node's style for the span they enclose.

Keys apply in the order they are written, as the declarations of one CSS rule do, so a later key wins where two overlap: "padding": 6, "paddingLeft": 24 gives 24 on the left and 6 elsewhere, while "paddingLeft": 24, "padding": 6 gives 6 all round. The same holds for border and borderTop, or border and borderColor.

A style the document does not declare is drawn as the engine's default style, with a WARNING naming it. When a component brings styles with it, a style of the same name in the document replaces the component's whole.


Built-in style names​

A node that names no style is drawn in a built-in one. Declare a style of the same name and it replaces the built-in one for every node of that kind.

NameDrawn onWithout a declaration
bodyevery paragraph and list that names no stylethe built-in sans at 10pt, black
cellevery td that names no stylethe built-in sans at 10pt, black
cellHeaderevery th that names no stylethe built-in sans at 10pt, black
tableevery table that names no stylecollapsed borders, a 0.5pt black grid
tocTitlethe title of a table of contents
footnotethe text of a [note] at the page footbody's keys at three quarters of its size
h1 ... h6every heading of that level that names no styleHTML's scale against the body's size: 2, 1.5, 1.17, 1, 0.83 and 0.67 em, bold, with HTML's margins above and below

A declared h2 replaces the built-in h2 whole: { "h2": { "color": "#0F2A4A" } } draws level-two headings at the default 10pt, not bold. State the size and weight with the colour.

Styles only carry visual concerns. Structural attributes that change a node's footprint in its parent, such as a table cell's colspan and rowspan or a heading's outline toggle, live on the node itself, as colspan="2" is an attribute of an HTML <td> and not a CSS rule.


What a style hands down​

A style does not cascade from body: body is the style of nodes that name none, not a parent of the others. A paragraph in style note takes only what note says, so a style restates the family and size it needs.

What does pass down is what CSS inherits (CSS 2.1 6.2). Inside a container - a columns node, a table, a list, the box around a list or a table, an svg group - the text takes the container style's inherited keys (the font keys, color, lineHeight, textAlign and the other text keys) wherever its own style leaves them unset. A box key such as padding, border or backgroundColor stays on the container.

{
"styles": {
"panel": { "fontSize": 9, "color": "#1e3a5f", "backgroundColor": "#eef2f7", "padding": 8 },
"aside": { "fontStyle": "italic" }
},
"content": [
{ "columns": { "style": "panel", "rows": [
[ { "p": "Navy, 9pt: the panel's text keys." } ],
[ { "p": "Navy, 9pt and italic: its own key over the panel's.", "style": "aside" } ]
] } }
]
}

A table's style reaches its cells the same way, a list's style its items' text, and the style of a columns node every block in its columns.

A style beside a list or a table​

A list or a table can carry two styles. The one inside the payload is the list's or the table's own: its markers or its grid, its text, its structural selectors. The one beside it, on the node that holds the payload, is the box around it: its margins, padding, border and background, and the text keys it hands in.

{
"styles": {
"inBrief": { "backgroundColor": "#fdf3e3", "padding": 10, "borderLeft": "3pt solid #b45309", "color": "#7a3e00" },
"steps": { "listStyleType": "upperRoman" }
},
"content": [
{ "ol": { "style": "steps", "li": [ { "p": "Moor on the starboard side." }, { "p": "Double the stern line." } ] },
"style": "inBrief" }
]
}

A key that is the payload's own and not inherited, written beside it (start beside a list, tableLayout beside a table), reaches nothing there, and a NOTICE says to write it in the list's or the table's own style.


How style validation works​

Styles are held to the published schema at both layers, so what the editor accepts is exactly what renders:

LayerBehavior
Editor / IDE (via the JSON schema)Unknown style keys get a red squiggle. The schema enumerates every valid property name and value; typos like fontWieght or colour are flagged on the line you type them.
API (before rendering)The same schema is applied before anything is rendered or billed. An unknown key, a misspelt value, or a key or value in another case (FontWeight, "CENTER") is refused with a 400 naming the path and the allowed values.

Keys and values are case-sensitive: fontWeight and "center" are the only spellings. A well-formed key that cannot act where it is placed (a table key on a paragraph, say) is not refused; the render report names it. Each module page lists the placements its keys cannot act on.


Naming follows CSS and SVG​

Property names mirror the CSS and SVG specifications, so anyone fluent in HTML and CSS writes DocPayload styles by ear. The translation is mechanical:

  • Keys: CSS kebab-case becomes JSON camelCase. font-size becomes fontSize, margin-top becomes marginTop, border-collapse becomes borderCollapse, text-align becomes textAlign.
  • Values: lower case, as CSS writes them: textAlign: "center", borderCollapse: "collapse", verticalAlign: "middle", strokeLinecap: "round", fontWeight: "bold".
  • Values are camelCase where CSS hyphenates them: lineThrough, nonScalingStroke, textBeforeEdge, noRepeat, borderBox, selfStart.
  • Shape properties follow SVG's presentation attributes: fill, stroke, strokeWidth, strokeDasharray, strokeLinecap, strokeLinejoin. See Colour and paint.
  • Lengths are a number of points, or a string with a unit pt, in, mm or px: 12, "12pt", "4mm", "0.5in".
  • Borders use CSS's shorthand string, "1pt solid #9ca3af", its parts in any order. See Borders.

Every style key​

The schema's 144 style keys, grouped as the engine's style catalogue groups them. "Takes" is what the key accepts, a length being a number of points or a string with a unit; the page named is where the key is documented in full.

Typography​

KeyTakesDefaultWhat it doesPage
directionltr, rtlltrBase writing direction of the textTypography
writingModehorizontalTb, verticalRl, verticalLrhorizontalTbLines across the page or down itTypography
textOrientationmixed, upright, sidewaysmixedHow characters stand in a vertical lineTypography
textCombineUprightnone, all, digits2, digits3, digits4noneDigits set side by side in one em, vertical lines onlyTypography
fontFamilya declared or built-in familyThe family the text is set inTypography
fontSizelength, up to 1638ptSize of the textTypography
fontStylenormal, italic, obliquenormalItalic or upright faceTypography
fontWeightnormal, bold, bolder, lighter, 100-900, or 1 to 1000normalWeight of the textTypography
letterSpacinglength, negative allowedExtra space after every characterTypography
lineHeighta multiplier, a length, a percentage, an em, normalnormalDistance between baselinesTypography
defaultTabStoplength above 036Interval of the automatic tab stopsTypography
tabStopsan array of lengths or stop objectsThe paragraph's own tab stopsTypography
textAlignstart, end, left, center, right, justifystartHow lines sit across the blockTypography
textAlignLastauto, start, end, left, center, right, justifyautoHow the last line sitsTypography
textJustifyauto, none, interWord, interCharacterautoHow a justified line is stretchedTypography
textDecorationnone, underline, lineThrough, or bothLines drawn with the textTypography
textIndentlength, negative allowed0Indent of the first lineTypography
horizontalScalinga whole percentage100Stretches or compresses the glyphs acrossTypography
textRiselength, negative allowed0Shifts the baseline of every runTypography
hyphensnone, manual, automanualWhere a word may breakTypography
hyphenateLimitCharsone to three of auto or a whole number: "6 3 2"autoThe shortest word hyphens: auto divides, and the letters kept each side of its hyphenTypography
hyphenateLimitLinesa whole number, 0 or moreno limitThe most lines in a row ending on a hyphenTypography
hyphenateCharacterauto, one character, or ""autoWhat a divided word draws at the breakTypography
hangingPunctuationnone, or in this order one space apart: first, forceEnd or allowEnd, lastnonePunctuation set outside the lineTypography
lineSnapnone, baseline, containnoneLines shifted down onto the line gridTypography
textSpacingTrimnormal, spaceAll, spaceFirst, trimStart, trimBoth, trimAllnormalHalf-width CJK punctuation at line endsTypography
whiteSpacenormal, nowrapnormalWhether the text wrapsTypography
wordSpacinglength, negative allowedExtra space at every word spaceTypography
fontKerningauto, normal, noneautoWhether the font's kerning is appliedTypography
fontSynthesisnone, or weight, style, smallCaps, position in any orderweight style smallCaps positionWhether a missing bold, italic, small capitals or superscripts are madeTypography
fontVariantCapsnormal, smallCaps, allSmallCaps, petiteCaps, allPetiteCaps, unicase, titlingCapsnormalThe face's small, petite or titling capitalsTypography
fontVariantPositionnormal, sub, supernormalThe face's own superscript or subscript glyphsTypography
fontVariantAlternatesnormal, or historicalForms, stylistic(name), styleset(name, ...), characterVariant(name, ...), swash(name), ornaments(name), annotation(name)normalAlternate glyphs by the names the family declaresTypography
fontVariantEastAsiannormal, or in this order one space apart: one of jis78, jis83, jis90, jis04, simplified, traditional; one of fullWidth, proportionalWidth; rubynormalEast Asian glyph forms and widthsTypography
fontVariantNumericnormal, or in this order: liningNums/oldstyleNums, proportionalNums/tabularNums, diagonalFractions/stackedFractions, ordinal, slashedZeronormalWhich figures are drawnTypography
fontVariantLigaturesnormal, none, or in this order one space apart: commonLigatures or noCommonLigatures, discretionaryLigatures or noDiscretionaryLigatures, historicalLigatures or noHistoricalLigatures, contextual or noContextualnormalWhich ligatures are joinedTypography
fontFeatureSettingsnormal, or quoted OpenType tags: "'ss01', 'tnum' off"normalAny OpenType feature by its tag, applied lastTypography
dominantBaselineauto, alphabetic, ideographic, middle, central, mathematical, hanging, textTop, textBottom, textBeforeEdge, textAfterEdgeWhich part of svg text sits on its yTypography
alignmentBaselineauto, baseline, beforeEdge, textBeforeEdge, middle, central, afterEdge, textAfterEdge, ideographic, alphabetic, hanging, mathematicalSVG's alignment-baseline, read when dominantBaseline is absentTypography
strokeLinecapbutt, round, squarebuttShape of line endsColour and paint
strokeLinejoinmiter, round, bevelmiterShape of cornersColour and paint
textRenderingModefill, stroke, fillstroke, invisible, fillclip, strokeclip, fillstrokeclip, clipfillHow text is painted: filled, stroked, invisible, clippingTypography
overflowWrapnormal, breakWord, anywherenormalWhether a word too long for its line is splitTypography

Box​

KeyTakesDefaultWhat it doesPage
collapsingMarginstrue, falseTop margin collapses into the margin aboveBox model
columnGaplengthSpace between columnsColumns
columnWidthlengthWidth of each flowed columnColumns
heightlengthHeight of the box (least and most)Box model
justifySelfstart, center, end, left, right, auto, normal, stretch, selfStart, selfEnd, flexStart, flexEndautoWhere a narrower block sits across its containerBox model
marginBottomlength, negative allowedSpace outside the box, belowBox model
marginLeftlength, negative allowed0Space outside the box, leftBox model
marginRightlength, negative allowed0Space outside the box, rightBox model
marginToplength, negative allowed0Space outside the box, aboveBox model
maxHeightlengthThe most height the box takesBox model
maxWidthlengthThe most width the box takesBox model
minHeightlengthThe least height the box takesBox model
minWidthlengthThe least width the box takesBox model
clipPathcircle(), ellipse(), inset(), polygon(), path(), nonenoneClips the box and its content to a shapeColour and paint
paddingone to four lengths0Space inside the box, every sideBox model
paddingBottomlength0Space inside the box, belowBox model
paddingLeftlength0Space inside the box, leftBox model
paddingRightlength0Space inside the box, rightBox model
paddingToplength0Space inside the box, aboveBox model
verticalAligntop, middle, bottom, baselinebaselineWhere a cell's content sits in its boxBox model
widthlengthWidth of the box (least and most)Box model
alignContentnormal, start, center, endnormalWhere content sits down a box taller than itBox model
alignItemsnormal, stretch, start, end, center, baseline, firstBaseline, selfStart, selfEnd, flexStart, flexEndnormalWhere each column sits in its rowBox model
justifyContentnormal, start, end, center, left, right, spaceBetween, spaceAround, spaceEvenly, stretch, flexStart, flexEndnormalWhere the columns stand when fixed widths leave roomColumns
alignSelfauto, normal, stretch, start, end, center, baseline, firstBaseline, selfStart, selfEnd, flexStart, flexEndautoOne column's own placement in its rowBox model
clearnone, left, right, bothnoneWhich floats the block stands belowBox model
columnCounta whole numberHow many columns the content flows acrossColumns
columnFillbalance, autobalanceWhether a flow's columns are balanced or filled in turnColumns
lineGridmatchParent, creatematchParentThe grid a block's lines snap toTypography
boxDecorationBreakslice, clonesliceWhether a box a page or a line breaks is cut at the break or closed on each pieceBreaks
columnSpannone, allnoneWhether a block in a column flow spans every columnColumns
floatnone, left, rightnoneTakes the block out of the flow to an edgeBox model
marginone to four lengths, negative allowedSpace outside the box, every sideBox model
overflowXvisible, hidden, clip, scroll, autovisibleContent past the box across: drawn or cutBox model
overflowYvisible, hidden, clip, scroll, autovisibleContent past the box downward: drawn or cutBox model
strokeWidthlength1Width of a shape's outline or a lineColour and paint
boxSizingcontentBox, borderBoxcontentBoxWhat width and height measureBox model
objectFitfill, contain, cover, none, scaleDownfillHow an image fills its boxImages

Borders​

KeyTakesDefaultWhat it doesPage
outline"width style colour"A frame outside the border box, taking no spaceBorders
outlineOffsetlength, negative allowed0Distance of the outline from the border boxBorders
columnRule"width style colour"A rule in each gap between flowed columnsBorders
border"width style colour"Every side's borderBorders
borderBottom"width style colour"The bottom borderBorders
borderBottomLeftRadiuslength0Rounds the bottom-left cornerBorders
borderBottomRightRadiuslength0Rounds the bottom-right cornerBorders
borderCollapseseparate, collapseShared cell borders or separate onesBorders
borderColora colourColour of every side's borderBorders
borderLeft"width style colour"The left borderBorders
borderRadiuslengthRounds every cornerBorders
borderRight"width style colour"The right borderBorders
borderStylenone, solid, dashed, dotted, double, roundDots, groove, inset, outset, ridge, dashedFixedLine style of every side's borderBorders
borderTop"width style colour"The top borderBorders
borderTopLeftRadiuslength0Rounds the top-left cornerBorders
borderTopRightRadiuslength0Rounds the top-right cornerBorders
borderWidthlengthWidth of every side's borderBorders

Paint​

KeyTakesDefaultWhat it doesPage
backgrounda colourShorthand: only a colour is readColour and paint
backgroundColora colourtransparentColour behind the boxColour and paint
colora colourColour of the textColour and paint
opacity0 to 11Transparency of the elementColour and paint
backgroundImageurl(name.png) or nonenoneAn image behind the boxColour and paint
backgroundSizecover, contain, or a width and heightautoHow large the background image is drawnColour and paint
backgroundPositionkeywords, lengths or percentages0% 0%Where the background image's first copy standsColour and paint
backgroundRepeatrepeatX, repeatY, or one or two of repeat, space, round, noRepeat (across, then down)repeatHow the background image tilesColour and paint
dropShadowan object: dx, dy, blur, color, opacityA shadow cast behind a shapeColour and paint
filla colour, none, or a gradientblackInterior of a shapeColour and paint
fillOpacity0 to 11Transparency of the fill aloneColour and paint
strokea colour or nonenoneColour of a shape's outline or a lineColour and paint
strokeDasharrayon and off lengths, up to 64Dash patternColour and paint
strokeDashoffsetlength, negative allowed0Starting offset into the dash patternColour and paint
strokeMiterlimita number, 1 or more4How far a mitred corner may reachColour and paint
strokeOpacity0 to 11Transparency of the stroke aloneColour and paint

Lists​

KeyTakesDefaultWhat it doesPage
starta whole number, 0 and negative too1The number the first item carriesLists
listStylePositionoutside, insideoutsideMarker hangs before the text or starts itLists
markera block of style keysStyles the markers apart from the item textList markers, below
listStyleTypea counter style, none, or any textThe list's markerLists
symbolAlignstart, endstartWhich end the markers line up onLists
symbolIndentlength, negative allowedSpace before the markerLists
prefixtext""Text before each marker's numberLists
suffixtextText after each marker's numberLists

Tables​

KeyTakesDefaultWhat it doesPage
borderSpacinga length, or [across, down]Space between separate cellsBorders
repeatHeadertrue, falseHeader rows repeat on every pageTables
tableLayoutfixed, autoDeclared widths kept, or sized to contentTables
captionSidetop, bottomtopCaption above or belowTables

Breaks​

KeyTakesDefaultWhat it doesPage
breakAfterauto, avoid, always, page, column, left, right, recto, versoautoA page or column break after the blockBreaks
breakBeforeauto, avoid, always, page, column, left, right, recto, versoautoA page or column break before the blockBreaks
breakInsideauto, avoid, avoidPageautoWhether the block may break across pagesBreaks
orphansa whole number, 1 or more2Fewest lines left at the foot of a pageBreaks
widowsa whole number, 1 or more2Fewest lines carried to the next pageBreaks

Transforms and positioning​

KeyTakesDefaultWhat it doesPage
bottomlength, negative allowedOffset from the bottom; the page's bottom edge under fixedBox model
leftlength, negative allowedOffset from the left; the page's left edge under fixedBox model
rightlength, negative allowedOffset from the right; the page's right edge under fixedBox model
positionstatic, relative, fixedstaticIn the flow, shifted from it, or at page coordinatesBox model
pageNumbera whole numberThe page a fixed block is drawn onBox model
toplength, negative allowedOffset from the top; the page's top edge under fixedBox model
transformOriginkeywords, percentages or lengths50% 50%The point rotate turns aboutTransforms, below
rotatedegrees, positive clockwiseTurns the blockTransforms, below
transforma CSS transform listnoneTranslates, scales, skews, turns or applies a matrixTransforms, below

Structural selectors​

KeyTakesDefaultWhat it doesPage
nthChildAn+B index to a block of style keysStyles children by position from the firstStructural selectors
nthLastChildAn+B index to a block of style keysStyles children by position from the lastStructural selectors
firstChilda block of style keysStyles the first childStructural selectors
lastChilda block of style keysStyles the last childStructural selectors

Other​

KeyTakesDefaultWhat it doesPage
vectorEffectnonScalingStroke, nonenoneKeeps a stroke's width in a scaled symbolColour and paint

Transforms — rotation, skew, affine​

Transformation primitives, for vertical sidebars, stamped overlays, edge-mounted barcodes and angled banners. A transform moves what the block draws and leaves its place in the flow alone, as in CSS.

PropertyTakesDescription
rotatedegreesRotation, positive clockwise, about transformOrigin.
transformOriginkeywords, percentages or lengthsThe point rotate turns about, as CSS's transform-origin: "left top", "100% 50%", "10pt 0". Default "50% 50%", the centre.
transforma CSS transform listmatrix(), translate(), scale(), rotate(), skewX(), skewY() and skew(), such as "skewX(20deg)"; angles carry their unit, and a bare number is points, or the svg's own units in an svg.

Neither a turn nor a transform is carried across a page break; the render report says so. In a DOCX a rotated paragraph is a turned text box, in a table cell too; a transform matrix, and a rotated block other than a paragraph, are reported, as is a rotated paragraph that floats, is shifted by position, holds more than text (an image, a barcode, a field), or is written under a Strict claim: it stands upright.

Example — angled rubber-stamp overlay​

{
"styles": {
"stamp": {
"fontSize": 28,
"fontWeight": "bold",
"color": "#7A1F2A",
"letterSpacing": 4,
"rotate": -15,
"opacity": 0.55,
"textAlign": "center"
}
},
"content": [
{ "p": "AWAITING PAYMENT", "style": "stamp" }
]
}

Example — vertical sidebar text​

{
"styles": {
"sidebar": {
"fontSize": 14,
"fontWeight": "bold",
"color": "#1B5E3F",
"letterSpacing": 8,
"rotate": 90
}
},
"content": [
{ "p": "DOCUMENT OFFICIEL", "style": "sidebar" }
]
}

For lines that run down the page rather than a turned block, see writingMode in Typography.


List markers: marker​

CSS Lists 3 gives every list item a ::marker pseudo-element. Here it is the marker block inside the list's style: a block of the keys a marker takes, so the number or bullet is styled apart from the item's text, which keeps the list's own keys. The list's other keys are on Lists.

KeyTakesWhat it does
color, fontFamily, fontSize, fontWeight, fontStyle, letterSpacing, horizontalScalingas the style keys of the same namethe marker's text: the "inheritable properties that apply to text" CSS Lists 3 3.1.1 lets reach a marker.
width, height, padding, backgroundColor, border, borderRadiusas the style keys of the same namea box drawn behind the marker, centred on the item's first line, with the marker centred in it. A 14 x 14 box with borderRadius 7 is a disc.
clipPathcircle(), ellipse(), inset() or polygon() (CSS Masking 1, CSS Shapes 1), lengths in points or percentages of the box; noneclips the box and the marker to a shape: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%) is a diamond.
{
"styles": {
"steps": {
"listStyleType": "decimal", "suffix": "",
"marker": { "color": "#ffffff", "fontWeight": "bold", "backgroundColor": "#3b4a2f", "width": 14, "height": 14, "borderRadius": 7 }
},
"alternating": {
"listStyleType": "upperRoman",
"marker": { "fontWeight": "bold" },
"nthChild": { "even": { "marker": { "color": "#b91c1c" } } }
}
},
"content": [
{ "ol": { "style": "steps", "li": [ { "p": "Survey" }, { "p": "Design" }, { "p": "Build" } ] } },
{ "ol": { "style": "alternating", "li": [ { "p": "Survey" }, { "p": "Design" }, { "p": "Build" } ] } }
]
}

A key a marker does not take (marginLeft, textAlign) is refused where it is written. A position rule's marker block lays over the list's key by key, as the second style shows. The DOCX puts the text keys, the border and the shading on Word's own numbering, keeps that numbering in every case, and the render report names the box keys a numbering level cannot carry (width, height, padding, radius, clip path): Word then draws the marker as a shaded square hugging the number.


Worked examples​

Layered heading hierarchy h1–h5​

{
"styles": {
"h1": {
"fontSize": 18, "fontWeight": "bold", "color": "#FFFFFF", "letterSpacing": 2,
"backgroundColor": "#0F2A4A",
"paddingTop": 10, "paddingRight": 14, "paddingBottom": 10, "paddingLeft": 14,
"marginTop": 18, "marginBottom": 8
},
"h2": {
"fontSize": 12, "fontWeight": "bold", "color": "#0F2A4A", "letterSpacing": 1,
"borderBottom": "1pt solid #0F2A4A",
"paddingBottom": 4,
"marginTop": 14, "marginBottom": 6
},
"h3": { "fontSize": 10.5, "fontWeight": "bold", "color": "#C66B1B", "marginTop": 10, "marginBottom": 3 },
"h4": { "fontSize": 9.5, "fontWeight": "bold", "fontStyle": "italic", "color": "#1A1A2E" },
"h5": { "fontSize": 8.5, "fontWeight": "bold", "color": "#666666", "letterSpacing": 2 }
}
}

Tier-coded data badges​

For per-row variation in a data-driven table, put the inline highlight and colour in the bound data. This is the document's .data.json, not the definition; a table with "source": "$data.tiers" and "map": ["name", "badge"] draws each badge as written. For banding by row number instead, see Structural selectors.

{
"tiers": [
{ "name": "Public", "badge": "[hl, #E8F4EC][color, #1E6F3A][b] PUBLIC [/b][/color][/hl]" },
{ "name": "Restricted", "badge": "[hl, #FCEEF0][color, #7A1F2A][b] RESTRICTED [/b][/color][/hl]" }
]
}

Encrypted-document banner with stroked text​

{
"styles": {
"banner": {
"fontSize": 36,
"fontWeight": "bold",
"color": "#7A1F2A",
"letterSpacing": 6,
"textRenderingMode": "stroke",
"strokeWidth": 0.5,
"textAlign": "center",
"opacity": 0.3
}
}
}

See Shortcodes for the inline-formatting tag reference and Page Setup for page-level styling (borders, backgrounds, margins).