Skip to content
Merged
Show file tree
Hide file tree
Changes from 84 commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
3c6d4d7
Create README.md
chazdean Jul 21, 2022
6213bdb
Add new Text component page
chazdean Jul 21, 2022
a766c83
Add Text component examples
chazdean Jul 21, 2022
f28e2b2
Add changeset
chazdean Jul 21, 2022
6a1df86
Use existing changeset
chazdean Jul 21, 2022
94d112f
Update Syntax
chazdean Jul 21, 2022
436d617
[Typography foundations] Update `<InlineCode>` styling for accessibil…
laurkim Jul 21, 2022
9bf69f2
[Typography foundations] Add fontweight to Text variants (#6698)
laurkim Jul 21, 2022
602fa58
Update polaris-readme-loader.js
chazdean Jul 22, 2022
5fcbf33
Update README.md
chazdean Jul 22, 2022
8548b86
Update text.md
chazdean Jul 22, 2022
d94efa7
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
8564b96
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
9446b0f
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
35b288c
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
7640389
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
5d51de8
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
220db37
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
6aebe0c
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
9afe6ca
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
0a9f134
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
3e4b4fc
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
e535ca8
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
a01b149
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
fc6f257
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
c7e1873
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
08688e6
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
5a146f3
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
56b86eb
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
d0ca2f9
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
f1f802f
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
d2d5bea
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
1bc5c59
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
7441d9f
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
adb290d
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
8a7481d
Update polaris.shopify.com/src/data/components.json
chazdean Jul 22, 2022
789fc04
Update component example titles
chazdean Jul 22, 2022
ca8e7e7
Update component example file names
chazdean Jul 22, 2022
7fd3fee
[Typography foundations] Refactor `display` variants to `heading2xl-4…
laurkim Jul 22, 2022
30e0fba
Create README.md
chazdean Jul 21, 2022
bbc4ea6
Add new Text component page
chazdean Jul 21, 2022
40883ad
Add Text component examples
chazdean Jul 21, 2022
2584d13
Add changeset
chazdean Jul 21, 2022
58ff72e
Use existing changeset
chazdean Jul 21, 2022
ebb07f8
Update Syntax
chazdean Jul 21, 2022
a8cb429
Update polaris-readme-loader.js
chazdean Jul 22, 2022
bcd48bd
Update README.md
chazdean Jul 22, 2022
f0ebfe4
Update text.md
chazdean Jul 22, 2022
142e00d
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
4ba615f
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
9099152
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
5d476e6
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
cee5c07
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
021b084
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
9594328
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
6504600
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
a0e2917
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
6af619f
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
c89e3fa
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
e9841ac
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
9238a21
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
06a8fc8
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
5a24d7b
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
360f5ac
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
9ead05d
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
15eebd7
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
cd495c0
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
4b7cf2b
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
bd0af6e
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
64ca7a3
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
b5e6792
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
677aee0
Update polaris-react/src/components/Text/README.md
chazdean Jul 22, 2022
c0aad00
Update polaris.shopify.com/src/data/components.json
chazdean Jul 22, 2022
104c391
Update component example titles
chazdean Jul 22, 2022
7863d57
Update component example file names
chazdean Jul 22, 2022
0f9033a
Refactor `display` variants to `heading2xl-4xl`
chazdean Jul 22, 2022
d425b36
Merge branch 'chaz/add-text-component-readme' of https://github.com/S…
chazdean Jul 22, 2022
79edf7e
Update polaris.shopify.com/src/pages/examples/text-heading-4xl.tsx
chazdean Jul 22, 2022
5bc6d29
Update polaris.shopify.com/src/pages/examples/text-heading-3xl.tsx
chazdean Jul 22, 2022
42a578b
Update polaris.shopify.com/src/pages/examples/text-heading-2xl.tsx
chazdean Jul 22, 2022
a9dfc80
Update polaris.shopify.com/src/pages/examples/text-heading-extra-larg…
chazdean Jul 22, 2022
56dfa77
Update polaris.shopify.com/src/pages/examples/text-heading-large.tsx
chazdean Jul 22, 2022
088fcc7
Update polaris.shopify.com/src/pages/examples/text-heading-medium.tsx
chazdean Jul 22, 2022
2e46ff0
Update polaris.shopify.com/src/pages/examples/text-heading-small.tsx
chazdean Jul 22, 2022
5fb16af
Remove Text Display examples
chazdean Jul 25, 2022
c9d1608
Merge branch 'chaz/add-text-component-readme' of https://github.com/S…
chazdean Jul 25, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .changeset/curly-llamas-bathe.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
'polaris.shopify.com': major
---

Added new `Text` and `InlineCode` components, update `typography` token references in styleguide, and updated `/tokens/typography` page in styleguide to `/tokens/font`
Added new `Text` and `InlineCode` components, updated `typography` token references in styleguide, updated `/tokens/typography` page in styleguide to `/tokens/font`, add docs and examples for `Text` component
1 change: 1 addition & 0 deletions polaris-react/.storybook/polaris-readme-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ import {
Subheading,
Tabs,
Tag,
Text,
TextContainer,
TextField,
TextStyle,
Expand Down
10 changes: 5 additions & 5 deletions polaris-react/src/components/InlineCode/InlineCode.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.Code {
background-color: var(--p-surface-subdued);
border-radius: var(--p-border-radius-base);
border: var(--p-border-base);
background-color: var(--p-surface-neutral);
border-radius: var(--p-border-radius-05);
font-family: var(--p-font-family-mono);
font-size: 0.9em;
padding: 0 var(--p-space-1);
font-size: 0.85em;
font-weight: var(--p-font-weight-medium);
padding: var(--p-space-025) var(--p-space-1);
Comment on lines 1 to +7
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these changes be in this PR or should we just have changes for the site?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels like they shouldn't be 🤔 What do you think @laurkim?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes shouldn't be, I believe they are part of #6700
Not sure why they snuck in here.

}
272 changes: 272 additions & 0 deletions polaris-react/src/components/Text/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,272 @@
---
name: Text
category: Titles and text
keywords:
- titles
- text
- typographic
- spacing
- display
- heading
- body
- success
- critical
- warning
- subdued
- regular
- medium
- semibold
- bold
- list
status:
value: Alpha
message: This component is in development. There could be breaking changes made to it in a non-major release of Polaris. Please use with caution.
---

# Text

Typography helps establish hierarchy and communicate important content by creating clear visual patterns.

---

## Examples

### Heading small

Use to create a small heading text.

```jsx
<Text variant="headingSm" as="h6">
Online store dashboard
</Text>
```

### Heading medium

Use to create a medium heading text.

```jsx
<Text variant="headingMd" as="h6">
Online store dashboard
</Text>
```

### Heading large

Use to create a large heading text.

```jsx
<Text variant="headingLg" as="h5">
Online store dashboard
</Text>
```

### Heading extra large

Use to create an extra large heading text.

```jsx
<Text variant="headingXl" as="h4">
Online store dashboard
</Text>
```

### Heading 2xl

Use to create a 2xl heading text.

```jsx
<Text variant="heading2xl" as="h3">
Online store dashboard
</Text>
```

### Heading 3xl

Use to create a 3xl heading text.

```jsx
<Text variant="heading3xl" as="h2">
Online store dashboard
</Text>
```

### Heading 4xl

Use to create a 4xl heading text.

```jsx
<Text variant="heading4xl" as="h1">
Online store dashboard
</Text>
```

### Body small

Use to create a small body text.

```jsx
<Text variant="bodySm" as="p">
Shopify POS is the easiest way to sell your products in person. Available for
iPad, iPhone, and Android.
</Text>
```

### Body medium

Use to create a medium body text.

```jsx
<Text variant="bodyMd" as="p">
Shopify POS is the easiest way to sell your products in person. Available for
iPad, iPhone, and Android.
</Text>
```

### Body large

Use to create a large body text.

```jsx
<Text variant="bodyLg" as="p">
Shopify POS is the easiest way to sell your products in person. Available for
iPad, iPhone, and Android.
</Text>
```

### With align inherit

Use to inherit parent alignment.

```jsx
<Text variant="bodyLg" as="p" alignment="inherit">
Manage your Shopify store on-the-go with real-time notifications, access to
your dashboard, and order management, all from your smartphone.
</Text>
```

### With align start

Use to align text at start of horizontal line.

```jsx
<Text variant="bodyLg" as="p" alignment="start">
Manage your Shopify store on-the-go with real-time notifications, access to
your dashboard, and order management, all from your smartphone.
</Text>
```

### With align center

Use to align text at center of horizontal line.

```jsx
<Text variant="bodyLg" as="p" alignment="center">
Manage your Shopify store on-the-go with real-time notifications, access to
your dashboard, and order management, all from your smartphone.
</Text>
```

### With align end

Use to align text at end of horizontal line.

```jsx
<Text variant="bodyLg" as="p" alignment="end">
Manage your Shopify store on-the-go with real-time notifications, access to
your dashboard, and order management, all from your smartphone.
</Text>
```

### With align justify

Use to align text on a vertical line.

```jsx
<Text variant="bodyLg" as="p" alignment="justify">
Manage your Shopify store on-the-go with real-time notifications, access to
your dashboard, and order management, all from your smartphone.
</Text>
```

### With font weight regular

Use to give text a regular font weight.

```jsx
<Text variant="bodyMd" as="p" fontWeight="regular">
Sales this year
</Text>
```

### With font weight medium

Use to give text a medium font weight.

```jsx
<Text variant="bodyMd" as="p" fontWeight="medium">
Sales this year
</Text>
```

### With font weight semibold

Use to give text a semibold font weight.

```jsx
<Text variant="bodyMd" as="p" fontWeight="semibold">
Sales this year
</Text>
```

### With font weight bold

Use to give text a bold font weight.

```jsx
<Text variant="bodyMd" as="p" fontWeight="bold">
Sales this year
</Text>
```

### With color success

Use in combination with a symbol showing an increasing value to indicate an upward trend.

```jsx
<Text variant="bodyMd" as="p" color="success">
Orders increased
</Text>
```

### With color critical

Use in combination with a symbol showing a decreasing value to indicate a downward trend.

```jsx
<Text variant="bodyMd" as="p" color="critical">
Orders decreased
</Text>
```

### With color warning

Use to denote something that needs attention, or that merchants need to take action on.

```jsx
<Text variant="bodyMd" as="p" color="warning">
Scheduled maintenance
</Text>
```

### With color subdued

Use to de-emphasize a piece of text that is less important to merchants than other nearby text. May also be used to indicate when normal content is absent, for example, “No supplier listed”. Don’t use only for aesthetic effect.

```jsx
<Text variant="bodyMd" as="p" color="subdued">
No supplier listed
</Text>
```

---
31 changes: 15 additions & 16 deletions polaris-react/src/components/Text/Text.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,6 @@
font-weight: var(--p-font-weight-bold);
}

.displaySm {
font-size: var(--p-font-size-75);
line-height: var(--p-font-line-height-5);
}

.displayMd {
font-size: var(--p-font-size-600);
line-height: var(--p-font-line-height-6);
}

.displayLg {
font-size: var(--p-font-size-700);
font-weight: var(--p-font-weight-semibold);
line-height: var(--p-font-line-height-7);
}

.headingSm {
font-size: var(--p-font-size-75);
line-height: var(--p-font-line-height-1);
Expand All @@ -103,6 +87,21 @@
line-height: var(--p-font-line-height-3);
}

.heading2xl {
font-size: var(--p-font-size-500);
line-height: var(--p-font-line-height-5);
}

.heading3xl {
font-size: var(--p-font-size-600);
line-height: var(--p-font-line-height-6);
}

.heading4xl {
font-size: var(--p-font-size-700);
line-height: var(--p-font-line-height-7);
}

.bodySm {
font-size: var(--p-font-size-75);
line-height: var(--p-font-line-height-1);
Expand Down
Loading