-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Render tokens pages in main nav using standard markdown renderer
- Loading branch information
1 parent
6837806
commit a08634e
Showing
31 changed files
with
412 additions
and
446 deletions.
There are no files selected for viewing
This file contains 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,19 @@ | ||
--- | ||
title: Border | ||
showTOC: false | ||
--- | ||
|
||
# Tokens → {frontmatter.title} | ||
|
||
<TokensNav selected="border" /> | ||
|
||
<TokenList> | ||
{tokens.border | ||
.map((token) => ( | ||
<TokenList.Item | ||
key={token.name} | ||
category="border" | ||
token={token} | ||
/> | ||
))} | ||
</TokenList> |
This file contains 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,68 @@ | ||
--- | ||
title: Breakpoints | ||
showTOC: false | ||
--- | ||
|
||
# Tokens → {frontmatter.title} | ||
|
||
<TokensNav selected="breakpoints" /> | ||
|
||
<TokenList> | ||
{tokens.breakpoints | ||
.map((token) => ( | ||
<TokenList.Item | ||
key={token.name} | ||
category="breakpoints" | ||
token={token} | ||
/> | ||
))} | ||
</TokenList> | ||
|
||
<p id="usage" role="heading" aria-level="2">Usage in Media Queries</p> | ||
|
||
### Sass variables | ||
|
||
A transform takes the above values and generates Sass variables (which can be | ||
used in media conditions) for each breakpoint in \`up\`, \`down\`, and \`only\` directions. | ||
While we currently support \`down\` media conditions, we encourage developers to | ||
adopt a mobile first strategy and use \`up\` wherever possible. | ||
|
||
Example of generated output for \`breakpoints-md\`: | ||
```scss | ||
@media #{$p-breakpoints-md-up} {/*...*/} | ||
@media #{$p-breakpoints-md-down} {/*...*/} | ||
@media #{$p-breakpoints-md-only} {/*...*/} | ||
``` | ||
|
||
To use these Sass variables you will need to import the \`media-queries.scss\` | ||
file from \`@shopify/polaris-tokens\` in your project: | ||
|
||
```scss | ||
@import 'path/to/node_modules/@shopify/polaris-tokens/dist/scss/media-queries'; | ||
``` | ||
|
||
### Media query variables | ||
|
||
A collection of all Sass variables for applying responsive styles at a given breakpoint alias. | ||
|
||
```scss | ||
$p-breakpoints-xs-up: '(min-width: 0em)'; | ||
$p-breakpoints-xs-down: '(max-width: -0.0025em)'; | ||
$p-breakpoints-xs-only: '(min-width: 0em) and (max-width: 30.6225em)'; | ||
|
||
$p-breakpoints-sm-up: '(min-width: 30.625em)'; | ||
$p-breakpoints-sm-down: '(max-width: 30.6225em)'; | ||
$p-breakpoints-sm-only: '(min-width: 30.625em) and (max-width: 47.9975em)'; | ||
|
||
$p-breakpoints-md-up: '(min-width: 48em)'; | ||
$p-breakpoints-md-down: '(max-width: 47.9975em)'; | ||
$p-breakpoints-md-only: '(min-width: 48em) and (max-width: 64.9975em)'; | ||
|
||
$p-breakpoints-lg-up: '(min-width: 65em)'; | ||
$p-breakpoints-lg-down: '(max-width: 64.9975em)'; | ||
$p-breakpoints-lg-only: '(min-width: 65em) and (max-width: 89.9975em)'; | ||
|
||
$p-breakpoints-xl-up: '(min-width: 90em)'; | ||
$p-breakpoints-xl-down: '(max-width: 89.9975em)'; | ||
$p-breakpoints-xl-only: '(min-width: 90em)'; | ||
``` |
This file contains 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,19 @@ | ||
--- | ||
title: Color | ||
showTOC: false | ||
--- | ||
|
||
# Tokens → {frontmatter.title} | ||
|
||
<TokensNav selected="color" /> | ||
|
||
<TokenList> | ||
{tokens.color | ||
.map((token) => ( | ||
<TokenList.Item | ||
key={token.name} | ||
category="color" | ||
token={token} | ||
/> | ||
))} | ||
</TokenList> |
This file contains 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,19 @@ | ||
--- | ||
title: Font | ||
showTOC: false | ||
--- | ||
|
||
# Tokens → {frontmatter.title} | ||
|
||
<TokensNav selected="font" /> | ||
|
||
<TokenList> | ||
{tokens.font | ||
.map((token) => ( | ||
<TokenList.Item | ||
key={token.name} | ||
category="font" | ||
token={token} | ||
/> | ||
))} | ||
</TokenList> |
This file contains 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,19 @@ | ||
--- | ||
title: Height | ||
showTOC: false | ||
--- | ||
|
||
# Tokens → {frontmatter.title} | ||
|
||
<TokensNav selected="height" /> | ||
|
||
<TokenList> | ||
{tokens.height | ||
.map((token) => ( | ||
<TokenList.Item | ||
key={token.name} | ||
category="height" | ||
token={token} | ||
/> | ||
))} | ||
</TokenList> |
This file contains 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,31 @@ | ||
--- | ||
title: Motion | ||
showTOC: false | ||
--- | ||
|
||
# Tokens → {frontmatter.title} | ||
|
||
<TokensNav selected="motion" /> | ||
|
||
<TokenList> | ||
{tokens.motion | ||
.sort((token) => | ||
token.name.includes('ease') || token.name.includes('linear') | ||
? -1 | ||
: 1, | ||
) | ||
.map((token) => ( | ||
<TokenList.Item | ||
key={token.name} | ||
category="motion" | ||
token={token} | ||
/> | ||
))} | ||
</TokenList> | ||
|
||
<style> | ||
{tokens.motion | ||
.filter(({name}) => name.includes('keyframes')) | ||
.map(({name, value}) => `@keyframes ${name} ${value}`) | ||
.join('\n')} | ||
</style> |
This file contains 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,19 @@ | ||
--- | ||
title: Shadow | ||
showTOC: false | ||
--- | ||
|
||
# Tokens → {frontmatter.title} | ||
|
||
<TokensNav selected="shadow" /> | ||
|
||
<TokenList> | ||
{tokens.shadow | ||
.map((token) => ( | ||
<TokenList.Item | ||
key={token.name} | ||
category="shadow" | ||
token={token} | ||
/> | ||
))} | ||
</TokenList> |
This file contains 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,19 @@ | ||
--- | ||
title: Space | ||
showTOC: false | ||
--- | ||
|
||
# Tokens → {frontmatter.title} | ||
|
||
<TokensNav selected="space" /> | ||
|
||
<TokenList> | ||
{tokens.space | ||
.map((token) => ( | ||
<TokenList.Item | ||
key={token.name} | ||
category="space" | ||
token={token} | ||
/> | ||
))} | ||
</TokenList> |
This file contains 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,19 @@ | ||
--- | ||
title: Text | ||
showTOC: false | ||
--- | ||
|
||
# Tokens → {frontmatter.title} | ||
|
||
<TokensNav selected="text" /> | ||
|
||
<TokenList> | ||
{tokens.text | ||
.map((token) => ( | ||
<TokenList.Item | ||
key={token.name} | ||
category="text" | ||
token={token} | ||
/> | ||
))} | ||
</TokenList> |
This file contains 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,19 @@ | ||
--- | ||
title: Width | ||
showTOC: false | ||
--- | ||
|
||
# Tokens → {frontmatter.title} | ||
|
||
<TokensNav selected="width" /> | ||
|
||
<TokenList> | ||
{tokens.width | ||
.map((token) => ( | ||
<TokenList.Item | ||
key={token.name} | ||
category="width" | ||
token={token} | ||
/> | ||
))} | ||
</TokenList> |
This file contains 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,19 @@ | ||
--- | ||
title: Z-Index | ||
showTOC: false | ||
--- | ||
|
||
# Tokens → {frontmatter.title} | ||
|
||
<TokensNav selected="z-index" /> | ||
|
||
<TokenList> | ||
{tokens['zIndex'] | ||
.map((token) => ( | ||
<TokenList.Item | ||
key={token.name} | ||
category="z-index" | ||
token={token} | ||
/> | ||
))} | ||
</TokenList> |
This file contains 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 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 was deleted.
Oops, something went wrong.
Oops, something went wrong.