Typography

Overview of the typography system and text tokens in Apsara.

Apsara provides a comprehensive typography system with carefully crafted font families, sizes, weights, and spacing to ensure readable and consistent text across your application.

Font Families

Apsara includes three font family categories for different use cases.

TokenDefault ValueUse Case
--rs-font-titleInter, sans-serifHeadings and titles
--rs-font-bodyInter, sans-serifBody text and paragraphs
--rs-font-monoMenlo, JetBrains Mono, monospaceCode and technical content

Available Fonts

TokenFont
--rs-font-interInter
--rs-font-loraLora
--rs-font-josefin-sansJosefin Sans
--rs-font-jetbrains-monoJetBrains Mono
--rs-font-menloMenlo

Font Weights

TokenValueUse Case
--rs-font-weight-regular400Body text, descriptions
--rs-font-weight-medium500Headings, labels, emphasis

Body Text

Font sizes, line heights, and letter spacing for body content.

Font Sizes

TokenSizeUse Case
--rs-font-size-micro10pxFine print, timestamps
--rs-font-size-mini11pxCaptions, badges
--rs-font-size-small12pxSecondary text, labels
--rs-font-size-regular14pxDefault body text
--rs-font-size-large16pxLarge body text, introductions

Line Heights

TokenValue
--rs-line-height-micro12px
--rs-line-height-mini16px
--rs-line-height-small16px
--rs-line-height-regular20px
--rs-line-height-large24px

Letter Spacing

TokenValue
--rs-letter-spacing-micro0.5px
--rs-letter-spacing-mini0.5px
--rs-letter-spacing-small0.4px
--rs-letter-spacing-regular0.25px
--rs-letter-spacing-large0.5px

Title Text

Font sizes, line heights, and letter spacing for headings and titles.

Font Sizes

TokenSizeUse Case
--rs-font-size-t120pxSmall headings (h4)
--rs-font-size-t224pxSection headings (h3)
--rs-font-size-t328pxPage headings (h2)
--rs-font-size-t432pxMain titles (h1)

Line Heights

TokenValue
--rs-line-height-t124px
--rs-line-height-t232px
--rs-line-height-t336px
--rs-line-height-t440px

Letter Spacing

TokenValue
--rs-letter-spacing-t10
--rs-letter-spacing-t20
--rs-letter-spacing-t30
--rs-letter-spacing-t40

Monospace Text

Font sizes, line heights, and letter spacing for code and technical content.

Font Sizes

TokenSize
--rs-font-size-mono-mini11px
--rs-font-size-mono-small12px
--rs-font-size-mono-regular14px
--rs-font-size-mono-large16px

Line Heights

TokenValue
--rs-line-height-mono-mini16px
--rs-line-height-mono-small16px
--rs-line-height-mono-regular20px
--rs-line-height-mono-large24px

Letter Spacing

TokenValue
--rs-letter-spacing-mono-mini0px
--rs-letter-spacing-mono-small0px
--rs-letter-spacing-mono-regular0px
--rs-letter-spacing-mono-large0px

Style Variants

Apsara supports different style variants that change typography to match your design preference.

Traditional Style

When using data-style="traditional", the font families change to:

TokenTraditional Value
--rs-font-titleLora, serif
--rs-font-bodyJosefin Sans, sans-serif

Usage

1/* Body text */
2.paragraph {
3 font-family: var(--rs-font-body);
4 font-size: var(--rs-font-size-regular);
5 font-weight: var(--rs-font-weight-regular);
6 line-height: var(--rs-line-height-regular);
7 letter-spacing: var(--rs-letter-spacing-regular);
8}
9
10/* Headings */
11.heading {
12 font-family: var(--rs-font-title);
13 font-size: var(--rs-font-size-t2);
14 font-weight: var(--rs-font-weight-medium);
15 line-height: var(--rs-line-height-t2);
16}
17
18/* Code */
19.code {
20 font-family: var(--rs-font-mono);
21 font-size: var(--rs-font-size-mono-small);
22 line-height: var(--rs-line-height-mono-small);
23}
24
25/* Small text */
26.caption {
27 font-size: var(--rs-font-size-small);
28 line-height: var(--rs-line-height-small);
29 letter-spacing: var(--rs-letter-spacing-small);
30}

Best Practices

  • Use semantic sizing - Match font sizes to their intended purpose (body, titles, code)
  • Pair sizes with line heights - Always use the corresponding line height token for each font size
  • Maintain hierarchy - Use font weights and sizes to establish clear visual hierarchy
  • Consider readability - Use appropriate letter spacing for different text sizes