AstryxTypographyConfig class

A theme's typography configuration.

scale drives the geometric size scale; body, heading and code declare fonts, fallbacks and weights per role. heading inherits its family and fallbacks from body when it does not name its own.

{@tool snippet}

const AstryxTypographyConfig(
  scale: AstryxTypeScaleSpec(base: 14, ratio: 1.2),
  body: AstryxTypographyRole(
    family: 'Geist',
    fallbacks: '-apple-system, sans-serif',
  ),
  heading: AstryxTypographyRole(weight: AstryxFontWeight.semibold),
);

{@end-tool}

Annotations

Constructors

AstryxTypographyConfig({AstryxTypeScaleSpec? scale, AstryxTypographyRole? body, AstryxTypographyRole? heading, AstryxTypographyRole? code})
Creates a typography configuration.
const

Properties

body AstryxTypographyRole?
Body text configuration.
final
code AstryxTypographyRole?
Code and monospace configuration.
final
hashCode int
The hash code for this object.
no setteroverride
heading AstryxTypographyRole?
Heading configuration. Inherits family and fallbacks from body.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scale AstryxTypeScaleSpec?
The type scale. When null, no typography tokens are generated.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override