From 458c5d0e634b24a7fec22647101705fe08a76422 Mon Sep 17 00:00:00 2001 From: Talisson Costa Date: Fri, 27 Nov 2026 11:31:32 -0300 Subject: [PATCH] feat(BodyText): Add a large 16px size Adds the body-lg font size token and BodyText size='lg', for larger text such as touch-sized rows on phones. Co-Authored-By: Claude Opus 5.5 --- frontend/common/theme/tokens.json | 1 + frontend/common/theme/tokens.ts | 5 +++++ .../documentation/TokenReference.generated.stories.tsx | 9 +++++++++ frontend/documentation/components/BodyText.stories.tsx | 6 +++++- .../components/base/typography/BodyText/BodyText.scss | 3 +++ .../web/components/base/typography/BodyText/BodyText.tsx | 2 +- frontend/web/styles/_tokens.scss | 1 + 7 files changed, 25 insertions(+), 2 deletions(-) diff --git a/frontend/common/theme/tokens.json b/frontend/common/theme/tokens.json index 2b0de9e2c9bf..54a47e69ea0b 100644 --- a/frontend/common/theme/tokens.json +++ b/frontend/common/theme/tokens.json @@ -230,6 +230,7 @@ "heading-lg": { "cssVar": "--font-size-heading-lg", "value": "24px", "description": "Level 1 headings. Page titles." }, "heading-md": { "cssVar": "--font-size-heading-md", "value": "18px", "description": "Level 2 headings. Sections." }, "heading-sm": { "cssVar": "--font-size-heading-sm", "value": "16px", "description": "Level 3 to 6 headings. Cards, subsections." }, + "body-lg": { "cssVar": "--font-size-body-lg", "value": "16px", "description": "Large body text. Touch-sized rows on phones." }, "body-md": { "cssVar": "--font-size-body-md", "value": "14px", "description": "Default body text." }, "body-sm": { "cssVar": "--font-size-body-sm", "value": "13px", "description": "Small body text. Secondary details." }, "body-xs": { "cssVar": "--font-size-body-xs", "value": "12px", "description": "Extra small body text. Captions, labels." } diff --git a/frontend/common/theme/tokens.ts b/frontend/common/theme/tokens.ts index ba0d30c6c44b..edc4e8a55f2b 100644 --- a/frontend/common/theme/tokens.ts +++ b/frontend/common/theme/tokens.ts @@ -127,6 +127,10 @@ export const fontWeight: Record = { } // Font-size export const fontSize: Record = { + 'body-lg': { + description: 'Large body text. Touch-sized rows on phones.', + value: 'var(--font-size-body-lg, 16px)', + }, 'body-md': { description: 'Default body text.', value: 'var(--font-size-body-md, 14px)', @@ -346,6 +350,7 @@ export const fontWeightRegular = 'var(--font-weight-regular, 400)' export const fontWeightSemibold = 'var(--font-weight-semibold, 600)' // Font-size +export const fontSizeBodyLg = 'var(--font-size-body-lg, 16px)' export const fontSizeBodyMd = 'var(--font-size-body-md, 14px)' export const fontSizeBodySm = 'var(--font-size-body-sm, 13px)' export const fontSizeBodyXs = 'var(--font-size-body-xs, 12px)' diff --git a/frontend/documentation/TokenReference.generated.stories.tsx b/frontend/documentation/TokenReference.generated.stories.tsx index e67b04b1b3d6..ab5b5d9dc4f5 100644 --- a/frontend/documentation/TokenReference.generated.stories.tsx +++ b/frontend/documentation/TokenReference.generated.stories.tsx @@ -1188,6 +1188,15 @@ export const AllTokens: StoryObj = { Level 3 to 6 headings. Cards, subsections. + + + --font-size-body-lg + + + 16px + + Large body text. Touch-sized rows on phones. + --font-size-body-md diff --git a/frontend/documentation/components/BodyText.stories.tsx b/frontend/documentation/components/BodyText.stories.tsx index 6187d1fa34f8..c1fdedb8008f 100644 --- a/frontend/documentation/components/BodyText.stories.tsx +++ b/frontend/documentation/components/BodyText.stories.tsx @@ -11,7 +11,7 @@ const meta: Meta = { docs: { description: { component: - 'Body text, a `

` by default and a `` with `inline`. The default is 14px regular; `size` is `sm` (13px) or `xs` (12px) and `weight` is `semibold`. `muted` uses the secondary text colour. Other colours come from the `text-*` utilities.', + 'Body text, a `

` by default and a `` with `inline`. The default is 14px regular; `size` is `lg` (16px), `sm` (13px) or `xs` (12px) and `weight` is `semibold`. `muted` uses the secondary text colour. Other colours come from the `text-*` utilities.', }, }, }, @@ -23,6 +23,10 @@ type Story = StoryObj export const Default: Story = {} +export const Large: Story = { + args: { size: 'lg' }, +} + export const Small: Story = { args: { size: 'sm' }, } diff --git a/frontend/web/components/base/typography/BodyText/BodyText.scss b/frontend/web/components/base/typography/BodyText/BodyText.scss index 382644ca3de4..29796fcba352 100644 --- a/frontend/web/components/base/typography/BodyText/BodyText.scss +++ b/frontend/web/components/base/typography/BodyText/BodyText.scss @@ -5,6 +5,9 @@ font-weight: var(--font-weight-regular); line-height: var(--line-height-body); + &--lg { + font-size: var(--font-size-body-lg); + } &--sm { font-size: var(--font-size-body-sm); } diff --git a/frontend/web/components/base/typography/BodyText/BodyText.tsx b/frontend/web/components/base/typography/BodyText/BodyText.tsx index 595e8102cce2..8eaf9239c4d3 100644 --- a/frontend/web/components/base/typography/BodyText/BodyText.tsx +++ b/frontend/web/components/base/typography/BodyText/BodyText.tsx @@ -2,7 +2,7 @@ import { FC, HTMLAttributes } from 'react' import cn from 'classnames' import './BodyText.scss' -export type BodyTextSize = 'sm' | 'xs' +export type BodyTextSize = 'lg' | 'sm' | 'xs' export type BodyTextWeight = 'semibold' export type BodyTextProps = HTMLAttributes & { diff --git a/frontend/web/styles/_tokens.scss b/frontend/web/styles/_tokens.scss index 01066fdfc394..c9ef2821bb3e 100644 --- a/frontend/web/styles/_tokens.scss +++ b/frontend/web/styles/_tokens.scss @@ -230,6 +230,7 @@ --font-weight-semibold: 600; // Font-size + --font-size-body-lg: 16px; --font-size-body-md: 14px; --font-size-body-sm: 13px; --font-size-body-xs: 12px;