Adopt remaining typography token classes (CR-24)
Map exact size/weight/line-height combos onto existing text-* utilities across cards, sections, navigation, modals, controls, and create-flow. Leave unmappable combos hardcoded for design review. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -13,28 +13,28 @@ const SIZE_CLASSES: Record<
|
||||
header:
|
||||
"gap-[var(--spacing-scale-016)] px-[var(--spacing-scale-016)] py-[var(--spacing-scale-020)] items-center",
|
||||
title: "text-[14px] font-medium leading-[18px]",
|
||||
subhead: "text-[12px] leading-[14px]",
|
||||
subhead: "text-x-small-label",
|
||||
},
|
||||
/** Figma: Layout / Accordion — Medium (22135-890258; header gap/px/py + Large/Label 18/24). */
|
||||
m: {
|
||||
header:
|
||||
"gap-[var(--spacing-scale-024)] px-[var(--spacing-scale-016)] py-[var(--spacing-scale-024)] items-center",
|
||||
title: "text-[18px] font-medium leading-6",
|
||||
subhead: "text-[14px] leading-[18px]",
|
||||
title: "text-large-label",
|
||||
subhead: "text-[14px] leading-[18px] font-medium",
|
||||
},
|
||||
l: {
|
||||
header:
|
||||
"gap-[var(--spacing-scale-048)] px-[var(--spacing-scale-016)] py-[var(--spacing-scale-032)] items-center",
|
||||
/** Figma Large: X Large Label 24 Regular, lh 28 (21842-2869). */
|
||||
title: "text-[24px] font-normal leading-7",
|
||||
subhead: "text-[18px] leading-6",
|
||||
title: "text-x-large-label",
|
||||
subhead: "text-large-label",
|
||||
},
|
||||
};
|
||||
|
||||
const PANEL_CLASSES: Record<AccordionSizeValue, string> = {
|
||||
s: "px-[var(--spacing-scale-016)] pb-[var(--spacing-scale-020)] font-inter text-[14px] font-normal leading-5 text-[var(--color-content-default-secondary,#d2d2d2)]",
|
||||
m: "px-[var(--spacing-scale-016)] pb-[var(--spacing-scale-024)] font-inter text-[16px] font-normal leading-6 text-[var(--color-content-default-secondary,#d2d2d2)]",
|
||||
l: "px-[var(--spacing-scale-016)] pb-[var(--spacing-scale-032)] font-inter text-[18px] font-normal leading-[26px] text-[var(--color-content-default-secondary,#d2d2d2)]",
|
||||
s: "px-[var(--spacing-scale-016)] pb-[var(--spacing-scale-020)] text-small-paragraph text-[var(--color-content-default-secondary,#d2d2d2)]",
|
||||
m: "px-[var(--spacing-scale-016)] pb-[var(--spacing-scale-024)] text-medium-paragraph text-[var(--color-content-default-secondary,#d2d2d2)]",
|
||||
l: "px-[var(--spacing-scale-016)] pb-[var(--spacing-scale-032)] text-[18px] font-normal leading-[26px] text-[var(--color-content-default-secondary,#d2d2d2)]",
|
||||
};
|
||||
|
||||
function withLgClasses(base: string, lg: string): string {
|
||||
@@ -124,13 +124,13 @@ function AccordionView({
|
||||
>
|
||||
<span className="flex min-w-0 flex-1 flex-col gap-[var(--spacing-scale-004)]">
|
||||
<span
|
||||
className={`font-inter text-[var(--color-content-default-primary,white)] ${sizeClass.title}`}
|
||||
className={`text-[var(--color-content-default-primary,white)] ${sizeClass.title}`}
|
||||
>
|
||||
{title}
|
||||
</span>
|
||||
{subhead ? (
|
||||
<span
|
||||
className={`font-inter font-medium text-[var(--color-content-default-tertiary,#b4b4b4)] ${sizeClass.subhead}`}
|
||||
className={`font-medium text-[var(--color-content-default-tertiary,#b4b4b4)] ${sizeClass.subhead}`}
|
||||
>
|
||||
{subhead}
|
||||
</span>
|
||||
|
||||
@@ -33,7 +33,7 @@ export const ListItemView = memo(function ListItemView({
|
||||
<Icon name={leadingIcon} size={24} />
|
||||
</span>
|
||||
<span
|
||||
className={`min-w-0 flex-1 text-left font-inter text-[12px] font-normal leading-4 whitespace-normal ${contentTone}`}
|
||||
className={`min-w-0 flex-1 text-left text-x-small-paragraph whitespace-normal ${contentTone}`}
|
||||
>
|
||||
{label}
|
||||
</span>
|
||||
|
||||
@@ -42,18 +42,18 @@ export const listEntrySizeLayout: Record<ListSize, RowLayout> = {
|
||||
shell: `${rowShellBase} min-h-0 gap-1.5 py-[var(--spacing-scale-012)]`,
|
||||
textCol: "flex min-w-0 flex-1 flex-col items-start justify-center",
|
||||
title:
|
||||
"min-w-0 flex-1 font-inter text-sm font-medium leading-[18px] text-[var(--color-content-default-primary)]",
|
||||
"min-w-0 flex-1 text-sm font-medium leading-[18px] text-[var(--color-content-default-primary)]",
|
||||
description:
|
||||
"w-full font-inter text-xs font-normal leading-4 text-[var(--color-content-default-secondary)]",
|
||||
"w-full text-x-small-paragraph text-[var(--color-content-default-secondary)]",
|
||||
rowFigma: FIGMA_LIST_ENTRY_ROW.s,
|
||||
},
|
||||
m: {
|
||||
shell: `${rowShellBase} min-h-16 gap-[var(--spacing-scale-008)] py-[var(--spacing-scale-012)]`,
|
||||
textCol: "flex min-w-0 flex-1 flex-col items-start justify-center",
|
||||
title:
|
||||
"min-w-0 flex-1 font-inter text-lg font-medium leading-6 text-[var(--color-content-default-primary)]",
|
||||
"min-w-0 flex-1 text-large-label text-[var(--color-content-default-primary)]",
|
||||
description:
|
||||
"w-full font-inter text-base font-normal leading-6 text-[var(--color-content-default-secondary)]",
|
||||
"w-full text-medium-paragraph text-[var(--color-content-default-secondary)]",
|
||||
rowFigma: FIGMA_LIST_ENTRY_ROW.m,
|
||||
},
|
||||
l: {
|
||||
@@ -61,9 +61,9 @@ export const listEntrySizeLayout: Record<ListSize, RowLayout> = {
|
||||
textCol:
|
||||
"flex min-w-0 flex-1 flex-col items-start justify-center gap-[var(--spacing-scale-004)]",
|
||||
title:
|
||||
"min-w-0 flex-1 font-inter text-2xl font-normal leading-7 text-[var(--color-content-default-primary)]",
|
||||
"min-w-0 flex-1 text-x-large-label text-[var(--color-content-default-primary)]",
|
||||
description:
|
||||
"w-full font-inter text-lg font-normal leading-[1.3] text-[var(--color-content-default-secondary)]",
|
||||
"w-full text-large-paragraph text-[var(--color-content-default-secondary)]",
|
||||
rowFigma: FIGMA_LIST_ENTRY_ROW.l,
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user