-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Typography foundations] Add README for new Text component
#6715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
chazdean
merged 86 commits into
typography-foundations-text-component
from
chaz/add-text-component-readme
Jul 25, 2022
Merged
Changes from 84 commits
Commits
Show all changes
86 commits
Select commit
Hold shift + click to select a range
3c6d4d7
Create README.md
chazdean 6213bdb
Add new Text component page
chazdean a766c83
Add Text component examples
chazdean f28e2b2
Add changeset
chazdean 6a1df86
Use existing changeset
chazdean 94d112f
Update Syntax
chazdean 436d617
[Typography foundations] Update `<InlineCode>` styling for accessibil…
laurkim 9bf69f2
[Typography foundations] Add fontweight to Text variants (#6698)
laurkim 602fa58
Update polaris-readme-loader.js
chazdean 5fcbf33
Update README.md
chazdean 8548b86
Update text.md
chazdean d94efa7
Update polaris-react/src/components/Text/README.md
chazdean 8564b96
Update polaris-react/src/components/Text/README.md
chazdean 9446b0f
Update polaris-react/src/components/Text/README.md
chazdean 35b288c
Update polaris-react/src/components/Text/README.md
chazdean 7640389
Update polaris-react/src/components/Text/README.md
chazdean 5d51de8
Update polaris-react/src/components/Text/README.md
chazdean 220db37
Update polaris-react/src/components/Text/README.md
chazdean 6aebe0c
Update polaris-react/src/components/Text/README.md
chazdean 9afe6ca
Update polaris-react/src/components/Text/README.md
chazdean 0a9f134
Update polaris-react/src/components/Text/README.md
chazdean 3e4b4fc
Update polaris-react/src/components/Text/README.md
chazdean e535ca8
Update polaris-react/src/components/Text/README.md
chazdean a01b149
Update polaris-react/src/components/Text/README.md
chazdean fc6f257
Update polaris-react/src/components/Text/README.md
chazdean c7e1873
Update polaris-react/src/components/Text/README.md
chazdean 08688e6
Update polaris-react/src/components/Text/README.md
chazdean 5a146f3
Update polaris-react/src/components/Text/README.md
chazdean 56b86eb
Update polaris-react/src/components/Text/README.md
chazdean d0ca2f9
Update polaris-react/src/components/Text/README.md
chazdean f1f802f
Update polaris-react/src/components/Text/README.md
chazdean d2d5bea
Update polaris-react/src/components/Text/README.md
chazdean 1bc5c59
Update polaris-react/src/components/Text/README.md
chazdean 7441d9f
Update polaris-react/src/components/Text/README.md
chazdean adb290d
Update polaris-react/src/components/Text/README.md
chazdean 8a7481d
Update polaris.shopify.com/src/data/components.json
chazdean 789fc04
Update component example titles
chazdean ca8e7e7
Update component example file names
chazdean 7fd3fee
[Typography foundations] Refactor `display` variants to `heading2xl-4…
laurkim 30e0fba
Create README.md
chazdean bbc4ea6
Add new Text component page
chazdean 40883ad
Add Text component examples
chazdean 2584d13
Add changeset
chazdean 58ff72e
Use existing changeset
chazdean ebb07f8
Update Syntax
chazdean a8cb429
Update polaris-readme-loader.js
chazdean bcd48bd
Update README.md
chazdean f0ebfe4
Update text.md
chazdean 142e00d
Update polaris-react/src/components/Text/README.md
chazdean 4ba615f
Update polaris-react/src/components/Text/README.md
chazdean 9099152
Update polaris-react/src/components/Text/README.md
chazdean 5d476e6
Update polaris-react/src/components/Text/README.md
chazdean cee5c07
Update polaris-react/src/components/Text/README.md
chazdean 021b084
Update polaris-react/src/components/Text/README.md
chazdean 9594328
Update polaris-react/src/components/Text/README.md
chazdean 6504600
Update polaris-react/src/components/Text/README.md
chazdean a0e2917
Update polaris-react/src/components/Text/README.md
chazdean 6af619f
Update polaris-react/src/components/Text/README.md
chazdean c89e3fa
Update polaris-react/src/components/Text/README.md
chazdean e9841ac
Update polaris-react/src/components/Text/README.md
chazdean 9238a21
Update polaris-react/src/components/Text/README.md
chazdean 06a8fc8
Update polaris-react/src/components/Text/README.md
chazdean 5a24d7b
Update polaris-react/src/components/Text/README.md
chazdean 360f5ac
Update polaris-react/src/components/Text/README.md
chazdean 9ead05d
Update polaris-react/src/components/Text/README.md
chazdean 15eebd7
Update polaris-react/src/components/Text/README.md
chazdean cd495c0
Update polaris-react/src/components/Text/README.md
chazdean 4b7cf2b
Update polaris-react/src/components/Text/README.md
chazdean bd0af6e
Update polaris-react/src/components/Text/README.md
chazdean 64ca7a3
Update polaris-react/src/components/Text/README.md
chazdean b5e6792
Update polaris-react/src/components/Text/README.md
chazdean 677aee0
Update polaris-react/src/components/Text/README.md
chazdean c0aad00
Update polaris.shopify.com/src/data/components.json
chazdean 104c391
Update component example titles
chazdean 7863d57
Update component example file names
chazdean 0f9033a
Refactor `display` variants to `heading2xl-4xl`
chazdean d425b36
Merge branch 'chaz/add-text-component-readme' of https://github.com/S…
chazdean 79edf7e
Update polaris.shopify.com/src/pages/examples/text-heading-4xl.tsx
chazdean 5bc6d29
Update polaris.shopify.com/src/pages/examples/text-heading-3xl.tsx
chazdean 42a578b
Update polaris.shopify.com/src/pages/examples/text-heading-2xl.tsx
chazdean a9dfc80
Update polaris.shopify.com/src/pages/examples/text-heading-extra-larg…
chazdean 56dfa77
Update polaris.shopify.com/src/pages/examples/text-heading-large.tsx
chazdean 088fcc7
Update polaris.shopify.com/src/pages/examples/text-heading-medium.tsx
chazdean 2e46ff0
Update polaris.shopify.com/src/pages/examples/text-heading-small.tsx
chazdean 5fb16af
Remove Text Display examples
chazdean c9d1608
Merge branch 'chaz/add-text-component-readme' of https://github.com/S…
chazdean File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -142,6 +142,7 @@ import { | |
| Subheading, | ||
| Tabs, | ||
| Tag, | ||
| Text, | ||
| TextContainer, | ||
| TextField, | ||
| TextStyle, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> | ||
| ``` | ||
|
|
||
| --- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.