Predefined typography compositions that bundle font size, weight, letter spacing, and line height into a single textStyle property.
Large text for hero sections and prominent headings. All display styles use bold weight with tight line height and negative letter spacing.
---
import { css } from "@pindoba/styled-system/css";
import { stack } from "@pindoba/styled-system/patterns";
// Common styles using css.raw()
const containerStyle = stack({ gap: "lg" });
const sectionStackStyle = stack({
gap: "2xs",
});
const baseTextContainerStyle = css.raw({
backgroundColor: { base: "white", _dark: "neutral.surface" },
padding: "md",
borderRadius: "md",
border: "1px solid",
borderColor: { base: "neutral.border.muted", _dark: "neutral.border.muted" },
});
// Static text styles using css.raw()
const textStyles = {
"display.sm": css.raw({ textStyle: "display.sm" }),
"display.md": css.raw({ textStyle: "display.md" }),
"display.lg": css.raw({ textStyle: "display.lg" }),
"display.xl": css.raw({ textStyle: "display.xl" }),
} as const;
// Text style data
const textStyleExamples = [
{
title: "Small Display",
styleKey: "display.sm" as keyof typeof textStyles,
},
{
title: "Medium Display",
styleKey: "display.md" as keyof typeof textStyles,
},
{
title: "Large Display",
styleKey: "display.lg" as keyof typeof textStyles,
},
{
title: "Extra Large Display",
styleKey: "display.xl" as keyof typeof textStyles,
},
];
const sampleText = "The quick brown fox jumps over the lazy dog";
---
<div class={containerStyle}>
{
textStyleExamples.map((example) => (
<div class={sectionStackStyle}>
<h3>{example.title}</h3>
<div class={css(baseTextContainerStyle, textStyles[example.styleKey])}>
{sampleText}
</div>
</div>
))
}
</div>| Style | Font Size | Weight | Line Height | Letter Spacing |
|---|---|---|---|---|
display.sm | 2xl (3.2rem) | bold | tight | -0.02em |
display.md | 3xl (4.0rem) | bold | tight | -0.02em |
display.lg | 4xl (4.8rem) | bold | tight | -0.02em |
display.xl | 5xl (6.4rem) | bold | tight | -0.02em |
Hierarchical headings for section structure.
---
import { css } from "@pindoba/styled-system/css";
import { stack } from "@pindoba/styled-system/patterns";
// Common styles using css.raw()
const containerStyle = stack({ gap: "lg" });
const sectionStackStyle = stack({
gap: "2xs",
});
const baseTextContainerStyle = css.raw({
backgroundColor: { base: "white", _dark: "neutral.surface" },
padding: "md",
borderRadius: "md",
border: "1px solid",
borderColor: { base: "neutral.border.muted", _dark: "neutral.border.muted" },
});
// Static text styles using css.raw()
const textStyles = {
"heading.xl": css.raw({ textStyle: "heading.xl" }),
"heading.lg": css.raw({ textStyle: "heading.lg" }),
"heading.md": css.raw({ textStyle: "heading.md" }),
"heading.sm": css.raw({ textStyle: "heading.sm" }),
} as const;
// Text style data
const textStyleExamples = [
{
title: "Extra Large Heading",
styleKey: "heading.xl" as keyof typeof textStyles,
},
{
title: "Large Heading",
styleKey: "heading.lg" as keyof typeof textStyles,
},
{
title: "Medium Heading",
styleKey: "heading.md" as keyof typeof textStyles,
},
{
title: "Small Heading",
styleKey: "heading.sm" as keyof typeof textStyles,
},
];
const sampleText = "The quick brown fox jumps over the lazy dog";
---
<div class={containerStyle}>
{
textStyleExamples.map((example) => (
<div class={sectionStackStyle}>
<h3>{example.title}</h3>
<div class={css(baseTextContainerStyle, textStyles[example.styleKey])}>
{sampleText}
</div>
</div>
))
}
</div>| Style | Font Size | Weight | Line Height | Letter Spacing |
|---|---|---|---|---|
heading.xl | 2xl (3.2rem) | bold | snug | -0.01em |
heading.lg | xl (2.4rem) | bold | snug | — |
heading.md | lg (2.0rem) | 600 | snug | — |
heading.sm | md (1.6rem) | 600 | snug | — |
Standard paragraph text in three sizes.
---
import { css } from "@pindoba/styled-system/css";
import { stack } from "@pindoba/styled-system/patterns";
// Common styles using css.raw()
const containerStyle = stack({ gap: "lg" });
const sectionStackStyle = stack({
gap: "2xs",
});
const baseTextContainerStyle = css.raw({
backgroundColor: { base: "white", _dark: "neutral.surface" },
padding: "md",
borderRadius: "md",
border: "1px solid",
borderColor: { base: "neutral.border.muted", _dark: "neutral.border.muted" },
});
// Static text styles using css.raw()
const textStyles = {
"body.lg": css.raw({ textStyle: "body.lg" }),
"body.md": css.raw({ textStyle: "body.md" }),
"body.sm": css.raw({ textStyle: "body.sm" }),
} as const;
// Text style data
const textStyleExamples = [
{
title: "Large Body",
styleKey: "body.lg" as keyof typeof textStyles,
},
{
title: "Medium Body",
styleKey: "body.md" as keyof typeof textStyles,
},
{
title: "Small Body",
styleKey: "body.sm" as keyof typeof textStyles,
},
];
const sampleText = "The quick brown fox jumps over the lazy dog";
---
<div class={containerStyle}>
{
textStyleExamples.map((example) => (
<div class={sectionStackStyle}>
<h3>{example.title}</h3>
<div class={css(baseTextContainerStyle, textStyles[example.styleKey])}>
{sampleText}
</div>
</div>
))
}
</div>| Style | Font Size | Weight | Line Height |
|---|---|---|---|
body.lg | lg (2.0rem) | 400 | normal |
body.md | md (1.6rem) | 400 | normal |
body.sm | sm (1.4rem) | 400 | normal |
UI labels for form fields and controls.
---
import { css } from "@pindoba/styled-system/css";
import { stack } from "@pindoba/styled-system/patterns";
// Common styles using css.raw()
const containerStyle = stack({ gap: "lg" });
const sectionStackStyle = stack({
gap: "2xs",
});
const baseTextContainerStyle = css.raw({
backgroundColor: { base: "white", _dark: "neutral.surface" },
padding: "md",
borderRadius: "md",
border: "1px solid",
borderColor: { base: "neutral.border.muted", _dark: "neutral.border.muted" },
});
// Static text styles using css.raw()
const textStyles = {
"label.lg": css.raw({ textStyle: "label.lg" }),
"label.md": css.raw({ textStyle: "label.md" }),
"label.sm": css.raw({ textStyle: "label.sm" }),
} as const;
// Text style data
const textStyleExamples = [
{
title: "Large Label",
styleKey: "label.lg" as keyof typeof textStyles,
},
{
title: "Medium Label",
styleKey: "label.md" as keyof typeof textStyles,
},
{
title: "Small Label",
styleKey: "label.sm" as keyof typeof textStyles,
},
];
const sampleText = "The quick brown fox jumps over the lazy dog";
---
<div class={containerStyle}>
{
textStyleExamples.map((example) => (
<div class={sectionStackStyle}>
<h3>{example.title}</h3>
<div class={css(baseTextContainerStyle, textStyles[example.styleKey])}>
{sampleText}
</div>
</div>
))
}
</div>| Style | Font Size | Weight | Line Height |
|---|---|---|---|
label.lg | md (1.6rem) | bold | snug |
label.md | sm (1.4rem) | bold | snug |
label.sm | xs (1.2rem) | bold | snug |
---
import { css } from "@pindoba/styled-system/css";
import { stack } from "@pindoba/styled-system/patterns";
// Common styles using css.raw()
const containerStyle = stack({ gap: "lg" });
const sectionStackStyle = stack({
gap: "2xs",
});
const baseTextContainerStyle = css.raw({
backgroundColor: { base: "white", _dark: "neutral.surface" },
padding: "md",
borderRadius: "md",
border: "1px solid",
borderColor: { base: "neutral.border.muted", _dark: "neutral.border.muted" },
});
// Static text styles using css.raw()
const textStyles = {
caption: css.raw({ textStyle: "caption" }),
code: css.raw({ textStyle: "code" }),
} as const;
// Text style data
const textStyleExamples = [
{
title: "Caption",
styleKey: "caption" as keyof typeof textStyles,
text: "The quick brown fox jumps over the lazy dog",
},
{
title: "Code",
styleKey: "code" as keyof typeof textStyles,
text: 'const quickBrownFox = "jumps over the lazy dog";',
},
];
---
<div class={containerStyle}>
{
textStyleExamples.map((example) => (
<div class={sectionStackStyle}>
<h3>{example.title}</h3>
<div class={css(baseTextContainerStyle, textStyles[example.styleKey])}>
{example.text}
</div>
</div>
))
}
</div>| Style | Font Size | Family | Weight | Line Height |
|---|---|---|---|---|
caption | xs (1.2rem) | sans | 400 | normal |
code | sm (1.4rem) | mono | 400 | snug |
import { css } from "@pindoba/styled-system/css";
<h1 className={css({ textStyle: "display.lg" })}>Hero Heading</h1>
<h2 className={css({ textStyle: "heading.xl" })}>Section Title</h2>
<p className={css({ textStyle: "body.md" })}>Paragraph text</p>
<label className={css({ textStyle: "label.md" })}>Form Label</label>
<code className={css({ textStyle: "code" })}>npm install</code>
<h1 className={css({
textStyle: { base: "heading.md", md: "heading.xl", lg: "display.sm" },
})}>
Responsive heading
</h1>
textStyle instead of setting fontSize, fontWeight, and lineHeight individually