Skip to main content

Module style

Module style 

Source
Expand description

The style tree: resolved styling.

Styling enters as CSS. A built-in user-agent stylesheet supplies the defaults; author CSS cascades over it. What comes out is one computed style per content node and one page master per situation a page can be in, and that is the whole of what layout is told.

content tree + CSS ─► style tree ─► box tree ─► …

Font faces reach the registry here too: @font-face names a source, the host loader hands back bytes, and every node’s face is an id by the time layout sees it.

Modules§

subset
The CSS subset as data.

Structs§

Ancestor
One element an inspected element sits inside.
Background
What one box paints behind its content.
BackgroundPosition
Where the image sits in the box, from background-position.
Border
One border edge: its style, its width and its colour.
BorderRadius
The four corners of a box, each rounded by what border-radius set.
Color
A colour: three eight-bit channels and an eight-bit alpha, where 255 is opaque.
ColumnRule
The rule painted down a page’s gutters, from column-rule-width and column-rule-style. It takes no room: the gutter is the room it has.
Columns
How a page’s content box divides, from column-count, column-width and column-gap.
ComputedStyle
One node’s resolved style: what every downstream pass reads.
CornerRadius
How far one corner of a box is rounded, as the cascade computed it.
DecorationLine
Which rules a run has drawn across it, from text-decoration-line.
Edges
The four edges of a box, in whatever the property resolves to: points for margin and padding, a Border for border.
FontFace
One @font-face: an identity, and the sources to try for it.
FontVariantLigatures
Which ligatures a run is set with, from font-variant-ligatures. A group left at None keeps whatever the shaper does with it, which is liga, clig and calt on and the rest off.
FontVariantNumeric
Which figures a run is set with, from font-variant-numeric.
InspectedDeclaration
One declaration of a matched rule.
Inspection
What one element, or one page margin box, answers with.
MarginBoxStyle
One page margin box: what it paints and the style it paints with.
MatchedRule
One rule that matched.
NoFonts
A loader that resolves nothing.
NodeStyle
One node’s place in the tree: what it is, and which style it got.
PageGeometry
Page trim, margins and columns, in points: the resolved @page box.
PageMaster
One page master, named and situated.
PageQuery
Which page a @page lookup is about.
PageStyle
One resolved page master: the page box, and what its margin boxes paint.
ShapePoint
One point of a polygon(), from the top left of the margin box.
SheetPosition
Where something was written in a stylesheet: the sheet’s name, and the line and column of its first character, counted the way a warning counts them.
Source
One stylesheet handed to the compiler: its text, a name for diagnostics, and the origin it cascades at.
StringSet
One string-set entry: a named string, and what the element sets it to when the flow reaches it.
StyleTree
The compiled styling of one book.
Stylesheets
Parsed stylesheets: the built-in sheet, then whatever the host added, ready to compile against a book.
TextDecoration
What a run has drawn across it: the rules, what they are painted in, how they are drawn, and how thick they are.
Url
A url the sheet named, and where it was written.
Written
One declaration as the author wrote it, and the longhands it became.
WrittenPage
One @page rule as it was written.
WrittenRule
One style rule as it was written.
WrittenSheet
One sheet as it was written. See Stylesheets::written.

Enums§

Align
Where in its band a margin box’s content sits. Center centres on the trim rather than on the content box: a folio belongs on the page’s axis, and mirrored margins put the content box off it.
AlignContent
Where a page’s content sits down its content box, from align-content on @page.
BackgroundRepeat
Whether the image repeats to fill the box, from background-repeat.
BackgroundSize
How large the image is drawn, from background-size.
Band
Which margin a painted margin box lives in.
BorderCollapse
Whether the cells of a table share their borders, from border-collapse.
BorderStyle
How a border edge is drawn.
BoxDecorationBreak
What a block’s decoration does where a page break splits it, from box-decoration-break.
Break
A fragmentation instruction: the value of break-before, break-after and break-inside. recto and verso are the book’s names for right and left.
ColumnSpan
How many columns of a divided page a block is set across, from column-span.
Content
What a page margin box paints, or what a pseudo-element generates.
ContentPiece
One piece of a content value that names another element.
Coord
One coordinate of a shape: a length, or a fraction of the box the shape is read against.
Corner
Which corner a one-cornered property sets.
CounterStyle
How a counter’s value is spelled.
DecorationStyle
How one rule is drawn, from text-decoration-style.
Edge
Which edge a one-sided box property sets.
Family
A font family as a stylesheet names it.
Figures
Which shape the figures take.
FontStyle
Upright or italic.
FontVariantAlternates
Which alternate glyphs a run is set with, from font-variant-alternates.
FontVariantCaps
Which capitals a run is drawn with, from font-variant-caps.
Fractions
How a fraction is set.
Hyphens
Whether words may be broken at syllable boundaries.
Inset
How far one edge of a positioned box sits from the matching edge of the page area, from top, right, bottom and left.
Length
A CSS length, before it is resolved against what it is relative to.
LineHeight
line-height, before the font size it multiplies is known.
ListStyleType
The marker a list item is set with, from list-style-type.
MarginBox
A page margin box, named as CSS names them.
NumericSpacing
How much width each figure takes.
Origin
Where a stylesheet came from. The cascade sorts by this before it sorts by anything else: author CSS overrides the built-in sheet however specific the built-in rule was.
Position
Whether an element sits in the flow or against the page.
ShapeOutside
The contour prose sets around, from shape-outside.
ShapeSource
shape-outside as the sheet wrote it, before the cascade knows the font size its lengths are relative to.
Situation
The situation a page finds itself in, which is what @page selects on beyond the page’s name.
SizeSource
background-size as the sheet wrote it, before the cascade knows the font size its lengths are relative to.
Src
One entry of a @font-face src list.
StringPiece
One piece of a string-set value.
Target
The element a reference names.
TextAlign
How a line’s inline content is distributed across the measure.
TextJustify
What justification opens up to fill the measure.
TextTransform
What a run’s letters are transformed to before they are shaped, from text-transform.
Width
The size a box is asked to take on one axis, from width, height or min-height.
WrapFlow
Which side of an exclusion the prose sets on, from wrap-flow. An exclusion is a box that the text keeps clear of.

Constants§

USER_AGENT_CSS
The defaults, as a stylesheet. There are no style constants in the engine; this file is where the trade paperback lives.

Traits§

FontLoader
Resolves @font-face sources to font bytes.

Functions§

defaults
One book’s styling under the built-in sheet alone.