Skip to content

Commit 87981ac

Browse files
authored
Update Text component to support legend element (#7430)
### WHY are these changes introduced? Added `legend` as supported element for `Text` component so that text styles can be easily applied in cases when `legend` is the semantically correct markup.
1 parent 85c0220 commit 87981ac

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

.changeset/seven-cobras-breathe.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/polaris': minor
3+
---
4+
5+
Added `legend` as supported element for `Text` component

polaris-react/src/components/Text/Text.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,16 @@ import {classNames} from '../../utilities/css';
44

55
import styles from './Text.scss';
66

7-
type Element = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span';
7+
type Element =
8+
| 'h1'
9+
| 'h2'
10+
| 'h3'
11+
| 'h4'
12+
| 'h5'
13+
| 'h6'
14+
| 'p'
15+
| 'span'
16+
| 'legend';
817

918
type Variant =
1019
| 'headingXs'

0 commit comments

Comments
 (0)