-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add new token group "space" to replace spacing in v11 #9016
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
Merged
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
244c643
Add new token group "space" to replace spacing in v11
alex-page 61c6e49
Merge branch 'main' of https://github.com/Shopify/polaris into rename…
lgriffee aa1c2ce
Add additional spacing updates
lgriffee 556afad
Revert tmp commits
alex-page b79a3c8
Create fluffy-rice-try.md
alex-page a70f284
Update polaris.shopify.com/content/tools/stylelint-polaris/rules/spac…
alex-page 739d13a
Add redirect for new space page
lgriffee 0bce57f
Add redirects for new stylelint-polaris pages
lgriffee 2861768
Add new redirect groups and remove anchor redirect
lgriffee 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@shopify/polaris-tokens': minor | ||
| --- | ||
|
|
||
| Add new Space tokens and types to replace spacing in v11 | ||
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
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
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
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
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
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 |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| import type {MetadataProperties} from '../types'; | ||
|
|
||
| export type SpaceScale = | ||
| | '0' | ||
| | '025' | ||
| | '05' | ||
| | '1' | ||
| | '2' | ||
| | '3' | ||
| | '4' | ||
| | '5' | ||
| | '6' | ||
| | '8' | ||
| | '10' | ||
| | '12' | ||
| | '16' | ||
| | '20' | ||
| | '24' | ||
| | '28' | ||
| | '32'; | ||
|
|
||
| export type SpaceTokenName = `space-${SpaceScale}`; | ||
|
|
||
| export type SpaceTokenGroup = { | ||
| [TokenName in SpaceTokenName]: string; | ||
| }; | ||
|
|
||
| export const space: { | ||
| [TokenName in SpaceTokenName]: MetadataProperties; | ||
| } = { | ||
| 'space-0': { | ||
| value: '0', | ||
| }, | ||
| 'space-025': { | ||
| value: '1px', | ||
| }, | ||
| 'space-05': { | ||
| value: '2px', | ||
| }, | ||
| 'space-1': { | ||
| value: '4px', | ||
| }, | ||
| 'space-2': { | ||
| value: '8px', | ||
| }, | ||
| 'space-3': { | ||
| value: '12px', | ||
| }, | ||
| 'space-4': { | ||
| value: '16px', | ||
| }, | ||
| 'space-5': { | ||
| value: '20px', | ||
| }, | ||
| 'space-6': { | ||
| value: '24px', | ||
| }, | ||
| 'space-8': { | ||
| value: '32px', | ||
| }, | ||
| 'space-10': { | ||
| value: '40px', | ||
| }, | ||
| 'space-12': { | ||
| value: '48px', | ||
| }, | ||
| 'space-16': { | ||
| value: '64px', | ||
| }, | ||
| 'space-20': { | ||
| value: '80px', | ||
| }, | ||
| 'space-24': { | ||
| value: '96px', | ||
| }, | ||
| 'space-28': { | ||
| value: '112px', | ||
| }, | ||
| 'space-32': { | ||
| value: '128px', | ||
| }, | ||
| }; |
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
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
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
15 changes: 15 additions & 0 deletions
15
.../content/tools/stylelint-polaris/rules/space-custom-property-disallowed-list.md
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,15 @@ | ||
| --- | ||
| title: space/custom-property-disallowed-list | ||
| description: Disallows use of legacy space custom properties. | ||
| keywords: | ||
| - stylelint | ||
| - space | ||
| - space rules | ||
| --- | ||
|
|
||
| ```diff | ||
| // Do | ||
| + margin-bottom: var(--p-space-025); | ||
| // Don't | ||
| - margin-bottom: var(--p-choice-margin); | ||
| ``` |
6 changes: 3 additions & 3 deletions
6
...laration-property-unit-disallowed-list.md → ...laration-property-unit-disallowed-list.md
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
15 changes: 15 additions & 0 deletions
15
...ify.com/content/tools/stylelint-polaris/rules/space-function-disallowed-list.md
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,15 @@ | ||
| --- | ||
| title: space/function-disallowed-list | ||
| description: Disallows use of legacy Sass space functions. | ||
| keywords: | ||
| - stylelint | ||
| - space | ||
| - space rules | ||
| --- | ||
|
|
||
| ```diff | ||
| // Do | ||
| + padding: var(--p-space-1); | ||
| // Don't | ||
| - padding: rem(4px); | ||
| ``` |
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.
Uh oh!
There was an error while loading. Please reload this page.