+ Only replace instances flagged by the RegExp below if they are values listed
+ in the replacement map for this step (see table below):
+
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?background`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?background`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?borderColor`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?outlineColor`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?borderColor`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?textColor`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?color`,
+ }}
+ />
+
+
+
| Deprecated Token | Replacement Value |
| ------------------ | ----------------- |
| `--p-color-bg-app` | `--p-color-bg` |
-#### Step 3
+
+
+#### Color migration step 3
Manually migrate the following tokens to their hardcoded values:
@@ -523,52 +1766,134 @@ Manually migrate the following tokens to their hardcoded values:
| `--p-color-bg-transparent-primary-experimental` | `rgba(0, 0, 0, 0.62)` |
| `--p-color-bg-transparent-secondary-disabled-experimental` | `rgba(0, 0, 0, 0.08)` |
-After migrating use the following RegExp to check for any additional instances of `color` custom properties across all file types:
-
-```
-(?:--p-color-bg-transparent-primary-experimental|--p-color-bg-transparent-secondary-disabled-experimental)(?![\w-])
-```
-
-Only replace instances flagged by the RegExp below if they are values listed in the replacement map for this step (see above):
-
-```
-\w](?:[^>]|\n)*?background
-```
-
-```
-\w](?:[^>]|\n)*?background
-```
-
-```
-\w](?:[^>]|\n)*?borderColor
-```
-
-```
-\w](?:[^>]|\n)*?outlineColor
-```
-
-```
-\w](?:[^>]|\n)*?borderColor
-```
-
-```
-\w](?:[^>]|\n)*?textColor
-```
-
-```
-\w](?:[^>]|\n)*?color
-```
-
-#### Step 4
-
-`on-color` is being replaced by `on-bg-fill` tokens. These tokens will no longer be the same value but tailored to the bg color the element is sitting on. This gives us greater control over the visual design of the admin. If you want to unblock your migration quickly you can manually hardcode the values using the following replacement map:
+
+ After migrating, use the following RegExp to check for any additional
+ instances of `color` custom properties across all file types:
+
+
+ Only replace instances flagged by the RegExp below if they are values listed
+ in the replacement map for this step (see table above):
+
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?background`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?background`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?borderColor`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?outlineColor`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?borderColor`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?textColor`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?color`,
+ }}
+ />
+
+
+#### Color migration step 4
+
+`on-color` is being replaced by `on-bg-fill` tokens. These tokens will no longer be the same value but tailored to the background color the element is sitting on. This gives us greater control over the visual design of the admin.
+
+If you want to unblock your migration quickly you can manually hardcode the values using the following replacement map:
| Deprecated Token | Replacement Value |
| ------------------------- | ------------------------ |
| `--p-color-icon-on-color` | `rgba(255, 255, 255, 1)` |
| `--p-color-text-on-color` | `rgba(255, 255, 255, 1)` |
-Otherwise, the table below shows which `on-bg-fill` colors to use against their respective `bg-fill` colors. Use the mappings below as a general guide to manually update `text-on-color` and `icon-on-color` tokens based on background color context:
+
+ After migrating, use the following RegExp to check for any additional
+ instances of `color` custom properties across all file types:
+
+
+ Only replace instances flagged by the RegExp below if they are values listed
+ in the replacement map for this step (see table above):
+
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?background`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?background`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?borderColor`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?outlineColor`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?borderColor`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?textColor`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?color`,
+ }}
+ />
+
+
+
| Background color of parent container | Text + Icon color on top of parent container |
| ------------------------------------ | -------------------------------------------------------------------------------------------- |
@@ -582,47 +1907,13 @@ Otherwise, the table below shows which `on-bg-fill` colors to use against their
| `--p-color-bg-fill-inverse` | `--p-color-text-inverse` `--p-color-text-inverse-secondary` `--p-color-icon-inverse` |
| `--p-color-bg-inverse` | `--p-color-text-inverse` `--p-color-text-inverse-secondary` `--p-color-icon-inverse` |
-After migrating use the following RegExp to check for any additional instances of `color` custom properties across all file types:
-
-```
-(?:--p-color-icon-on-color|--p-color-text-on-color)(?![\w-])
-```
-
-Only replace instances flagged by the RegExp below if they are values listed in the replacement map for this step (see above):
-
-```
-\w](?:[^>]|\n)*?background
-```
-
-```
-\w](?:[^>]|\n)*?background
-```
-
-```
-\w](?:[^>]|\n)*?borderColor
-```
-
-```
-\w](?:[^>]|\n)*?outlineColor
-```
-
-```
-\w](?:[^>]|\n)*?borderColor
-```
-
-```
-\w](?:[^>]|\n)*?textColor
-```
-
-```
-\w](?:[^>]|\n)*?color
-```
+
### Font
-#### Migration
+To replace deprecated `font` custom properties, you can run the [v12-styles-replace-custom-property-font](/tools/polaris-migrator#v12-styles-replace-custom-property-font) migration then validate with RegExp. Please reference the [recommended migration workflow](#migration-workflow) section below for additional migration support.
-To replace these deprecated `font` custom properties, you can run the [v12-styles-replace-custom-property-font](https://polaris.shopify.com/tools/polaris-migrator#v12-styles-replace-custom-property-font) migration. Please reference the [recommended token migration workflow](#recommended-token-migration-workflow) section below for additional migration support.
+
```diff
- font-size: var(--p-font-size-75);
@@ -634,21 +1925,33 @@ To replace these deprecated `font` custom properties, you can run the [v12-style
+ line-height: var(--p-font-line-height-400);
```
-**⚠️ Important**: The font migration needs to be run in 4 sequential steps due to overlapping `font-size` token names.
+
-#### Step 1
+**🔔 Stepped migration**: The font migration needs to be run in **4** sequential steps due to overlapping `font-size` token names.
-```sh
-npx @shopify/polaris-migrator v12-styles-replace-custom-property-font --step=1
-```
+#### Font migration step 1
-After migrating use the following RegExp to check for any additional instances of `font` custom properties across all file types:
+ --step=1`,
+ }}
+/>
-```
-(?:--p-font-size-70-experimental|--p-font-size-80-experimental|--p-font-size-100|--p-font-size-700|--p-font-line-height-075-experimental|--p-font-line-height-1|--p-font-line-height-2|--p-font-line-height-3|--p-font-line-height-4|--p-font-line-height-5|--p-font-line-height-6|--p-font-line-height-7)(?![\w-])
-```
+
+ After migrating, use the following RegExp to check for any additional
+ instances of `font` custom properties across all file types:
+
+
-Replacement maps for Step 1:
+
| Deprecated Token | Replacement Value |
| --------------------------------------- | --------------------------- |
@@ -665,99 +1968,155 @@ Replacement maps for Step 1:
| `--p-font-line-height-6` | `--p-font-line-height-1000` |
| `--p-font-line-height-7` | `--p-font-line-height-1200` |
-#### Step 2
+
-```sh
-npx @shopify/polaris-migrator v12-styles-replace-custom-property-font --step=2
-```
+#### Font migration step 2
-After migrating use the following RegExp to check for any additional instances of `font` custom properties across all file types:
+ --step=2`,
+ }}
+/>
-```
-(?:--p-font-size-500|--p-font-size-600)(?![\w-])
-```
+
+ After migrating, use the following RegExp to check for any additional
+ instances of `font` custom properties across all file types:
+
+
-Replacement maps for Step 2:
+
| Deprecated Token | Replacement Value |
| ------------------- | ------------------- |
| `--p-font-size-500` | `--p-font-size-750` |
| `--p-font-size-600` | `--p-font-size-900` |
-#### Step 3
+
-```sh
-npx @shopify/polaris-migrator v12-styles-replace-custom-property-font --step=3
-```
+#### Font migration step 3
-After migrating use the following RegExp to check for any additional instances of `font` custom properties across all file types:
+ --step=3`,
+ }}
+/>
-```
-(?:--p-font-size-300|--p-font-size-400)(?![\w-])
-```
+
+ After migrating, use the following RegExp to check for any additional
+ instances of `font` custom properties across all file types:
+
+
-Replacement maps for Step 3:
+
| Deprecated Token | Replacement Value |
| ------------------- | ------------------- |
| `--p-font-size-300` | `--p-font-size-500` |
| `--p-font-size-400` | `--p-font-size-600` |
-#### Step 4
+
-```sh
-npx @shopify/polaris-migrator v12-styles-replace-custom-property-font --step=4
-```
+#### Font migration step 4
-After migrating use the following RegExp to check for any additional instances of `font` custom properties across all file types:
+ --step=4`,
+ }}
+/>
-```
-(?:--p-font-size-75|--p-font-size-200)(?![\w-])
-```
+
+ After migrating, use the following RegExp to check for any additional
+ instances of `font` custom properties across all file types:
+
+
-Replacement maps for Step 4:
+
| Deprecated Token | Replacement Value |
| ------------------- | ------------------- |
| `--p-font-size-75` | `--p-font-size-300` |
| `--p-font-size-200` | `--p-font-size-400` |
+
+
### Shadow
-#### Migration
+To replace deprecated `shadow` custom properties, you can run the [v12-styles-replace-custom-property-shadow](/tools/polaris-migrator#v12-styles-replace-custom-property-shadow) migration then validate with RegExp. Please reference the [recommended migration workflow](#migration-workflow) section below for additional migration support.
-To replace these deprecated `shadow` custom properties, you can run the [v12-styles-replace-custom-property-shadow](https://polaris.shopify.com/tools/polaris-migrator#v12-styles-replace-custom-property-shadow) migration. Please reference the [recommended token migration workflow](#recommended-token-migration-workflow) section below for additional migration support.
+
```diff
- box-shadow: var(--p-shadow-xs);
+ box-shadow: var(--p-shadow-100);
```
-**⚠️ Important**: The shadow migration needs to be run in 2 sequential steps due to context dependent manual migrations.
-
-#### Step 1
-
-```sh
-npx @shopify/polaris-migrator v12-styles-replace-custom-property-shadow
-```
-
-After migrating use the following RegExp to check for any additional instances of `shadow` custom properties across all file types:
-
-```
-(?:--p-shadow-inset-lg|--p-shadow-inset-md|--p-shadow-inset-sm|--p-shadow-none|--p-shadow-xs|--p-shadow-sm|--p-shadow-md|--p-shadow-lg|--p-shadow-xl|--p-shadow-2xl|--p-shadow-bevel-experimental|--p-shadow-card-sm-experimental|--p-shadow-card-md-experimental|--p-shadow-card-lg-experimental|--p-shadow-button-experimental|--p-shadow-button-hover-experimental|--p-shadow-button-disabled-experimental|--p-shadow-button-primary-strong-experimental|--p-shadow-button-primary-strong-inset-experimental|--p-shadow-button-primary-strong-hover-experimental|--p-shadow-border-inset-experimental)(?![\w-])
-```
-
-Only replace instances flagged by the RegExp below if they are values listed in the replacement map for this step (see below):
-
-```
-\w](?:[^>]|\n)*?shadow
-```
-
-```
-\w](?:[^>]|\n)*?boxShadow
-```
-
-Replacement maps for Step 1:
+
+
+**🔔 Stepped migration**: The font migration needs to be run in **2** sequential steps due to context dependent manual migrations.
+
+#### Shadow migration step 1
+
+`,
+ }}
+/>
+
+
+ After migrating, use the following RegExp to check for any additional
+ instances of `shadow` custom properties across all file types:
+
+
+ Only replace instances flagged by the RegExp below if they are values listed
+ in the replacement map for this step (see table below):
+
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?shadow`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?boxShadow`,
+ }}
+ />
+
+
+
| Deprecated Token | Replacement Value |
| ----------------------------------------------------- | ---------------------------------------- |
@@ -783,7 +2142,9 @@ Replacement maps for Step 1:
| `--p-shadow-button-primary-strong-hover-experimental` | `--p-shadow-button-primary-hover` |
| `--p-shadow-border-inset-experimental` | `--p-shadow-border-inset` |
-#### Step 2
+
+
+#### Shadow migration step 2
The following tokens need to be manually migrated because their values are context dependent:
@@ -793,220 +2154,335 @@ The following tokens need to be manually migrated because their values are conte
| `--p-shadow-button-primary-hover-experimental` | `--p-shadow-button-primary-critical-hover` `--p-shadow-button-primary-success-hover` |
| `--p-shadow-button-inset-experimental` | `--p-shadow-button-primary-critical-inset` `--p-shadow-button-primary-success-inset` |
-After migrating use the following RegExp to check for any additional instances of `shadow` custom properties across all file types:
-
-```
-(?:--p-shadow-button-primary-experimental|--p-shadow-button-primary-hover-experimental|--p-shadow-button-inset-experimental)(?![\w-])
-```
-
-Only replace instances flagged by the RegExp below if they are values listed in the replacement map for this step (see above):
-
-```
-\w](?:[^>]|\n)*?shadow
-```
-
-```
-\w](?:[^>]|\n)*?boxShadow
-```
+
+ After migrating, use the following RegExp to check for any additional
+ instances of `shadow` custom properties across all file types:
+
+
+ Only replace instances flagged by the RegExp below if they are values listed
+ in the replacement map for this step (see table below):
+
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?shadow`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?boxShadow`,
+ }}
+ />
+
### Space
-#### Migration
+To replace deprecated `space` custom properties, you can run the [v12-styles-replace-custom-property-space](/tools/polaris-migrator#v12-styles-replace-custom-property-space) migration then validate with RegExp. Please reference the [recommended migration workflow](#migration-workflow) section below for additional migration support.
-To replace these deprecated `space` custom properties, you can run the [v12-styles-replace-custom-property-space](https://polaris.shopify.com/tools/polaris-migrator#v12-styles-replace-custom-property-space) migration. Please reference the [recommended token migration workflow](#recommended-token-migration-workflow) section below for additional migration support.
+
```diff
- padding: var(--p-space-1);
+ padding: var(--p-space-100);
```
-```sh
-npx @shopify/polaris-migrator v12-styles-replace-custom-property-space
-```
-
-#### Post-migration validation
-
-After migrating use the following RegExp to check for any additional instances of `space` custom properties across all file types:
-
-```
-(?:--p-space-05|--p-space-1|--p-space-1_5-experimental|--p-space-2|--p-space-3|--p-space-4|--p-space-5|--p-space-6|--p-space-8|--p-space-10|--p-space-12|--p-space-16 |--p-space-20 |--p-space-24|--p-space-28 |--p-space-32)(?![\w-])
-```
-
-```
-\w](?:[^>]|\n)*?padding
-```
-
-**⚠️ Important**: The RegExp you use here will depend on if you've run component migrations. If you have not then use `HorizontalGrid` if you have then use `InlineGrid`.
-
-```
-\w](?:[^>]|\n)*?gap
-```
-
-```
-\w](?:[^>]|\n)*?gap
-```
-
-```
-\w](?:[^>]|\n)*?padding
-```
-
-```
-\w](?:[^>]|\n)*?paddingBlockStart
-```
-
-```
-\w](?:[^>]|\n)*?paddingBlockEnd
-```
-
-```
-\w](?:[^>]|\n)*?paddingInlineStart
-```
-
-```
-\w](?:[^>]|\n)*?paddingInlineEnd
-```
-
-```
-\w](?:[^>]|\n)*?insetBlockStart
-```
-
-```
-\w](?:[^>]|\n)*?insetBlockEnd
-```
-
-```
-\w](?:[^>]|\n)*?insetInlineStart
-```
-
-```
-\w](?:[^>]|\n)*?insetInlineEnd
-```
-
-**⚠️ Important**: The RegExp you use here will depend on if you've run component migrations. If you have not then use `VerticalStack` if you have then use `BlockStack`.
-
-```
-\w](?:[^>]|\n)*?gap
-```
-
-```
-\w](?:[^>]|\n)*?gap
-```
-
-**⚠️ Important**: The RegExp you use here will depend on if you've run component migrations. If you have not then use `HorizontalStack` if you have then use `InlineStack`.
-
-```
-\w](?:[^>]|\n)*?gap
-```
-
-```
-\w](?:[^>]|\n)*?gap
-```
-
-```
-\w](?:[^>]|\n)*?bleed
-```
-
-```
-\w](?:[^>]|\n)*?bleedBlockStart
-```
-
-```
-\w](?:[^>]|\n)*?bleedBlockEnd
-```
-
-```
-\w](?:[^>]|\n)*?bleedInlineStart
-```
-
-```
-\w](?:[^>]|\n)*?bleedInlineEnd
-```
-
-```
-\w](?:[^>]|\n)*?bleed
-```
-
-```
-\w](?:[^>]|\n)*?bleedBlockStart
-```
-
-```
-\w](?:[^>]|\n)*?bleedBlockEnd
-```
-
-```
-\w](?:[^>]|\n)*?bleedInlineStart
-```
-
-```
-\w](?:[^>]|\n)*?bleedInlineEnd
-```
-
-```
-\w](?:[^>]|\n)*?bleed
-```
-
-```
-\w](?:[^>]|\n)*?bleedBlockStart
-```
-
-```
-\w](?:[^>]|\n)*?bleedBlockEnd
-```
-
-```
-\w](?:[^>]|\n)*?bleedInlineStart
-```
-
-```
-\w](?:[^>]|\n)*?bleedInlineEnd
-```
-
-```
-\w](?:[^>]|\n)*?gap
-```
-
-```
-\w](?:[^>]|\n)*?gap
-```
-
-```
-\w](?:[^>]|\n)*?gapX
-```
-
-```
-\w](?:[^>]|\n)*?gapY
-```
-
-```
-\w](?:[^>]|\n)*?padding
-```
-
-```
-\w](?:[^>]|\n)*?marginInline
-```
-
-```
-\w](?:[^>]|\n)*?marginBlock
-```
-
-```
-\w](?:[^>]|\n)*?marginBlockStart
-```
-
-```
-\w](?:[^>]|\n)*?marginBlockEnd
-```
-
-```
-\w](?:[^>]|\n)*?marginInlineStart
-```
-
-```
-\w](?:[^>]|\n)*?marginInlineEnd
-```
-
-#### Replacement maps
+
+
+`,
+ }}
+/>
+
+
+ After migrating, use the following RegExp to check for any additional
+ instances of `space` custom properties across all file types:
+
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?padding`,
+ }}
+ />
+
+ **⚠️ Important**: The RegExp you use here will depend on if you've run
+ component migrations. If you have not then use `HorizontalGrid` if you have
+ then use `InlineGrid`.
+
+ **⚠️ Important**: The RegExp you use here will depend on if you've run
+ component migrations. If you have not then use `VerticalStack` if you have
+ then use `BlockStack`.
+
+ **⚠️ Important**: The RegExp you use here will depend on if you've run
+ component migrations. If you have not then use `HorizontalStack` if you have
+ then use `InlineStack`.
+
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?gap`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?gap`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?bleed`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?bleedBlockStart`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?bleedBlockEnd`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?bleedInlineStart`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?bleedInlineEnd`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?bleed`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?bleedBlockStart`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?bleedBlockEnd`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?bleedInlineStart`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?bleedInlineEnd`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?bleed`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?bleedBlockStart`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?bleedBlockEnd`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?bleedInlineStart`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?bleedInlineEnd`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?gap`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?gap`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?gapX`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?gapY`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?padding`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?marginInline`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?marginBlock`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?marginBlockStart`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?marginBlockEnd`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?marginInlineStart`,
+ }}
+ />
+ prop`,
+ code: String.raw`\w](?:[^>]|\n)*?marginInlineEnd`,
+ }}
+ />
+
+
+
| Deprecated Token | Replacement Value |
| ---------------------------- | ----------------- |
@@ -1027,97 +2503,14 @@ After migrating use the following RegExp to check for any additional instances o
| `--p-space-28` | `--p-space-2800` |
| `--p-space-32` | `--p-space-3200` |
-### Recommended token migration workflow
-
-When running token migrations we suggest the following workflow:
-
-- Handle automated migrations
- ```sh
- # Example migration
- npx @shopify/polaris-migrator ...
- # Stage all migrated files
- git add .
- # Format staged files only
- git diff --staged --name-only | xargs npx prettier --write
- # Commit automated migrations
- git commit -m "Migrate X custom properties from Polaris v11 to v12"
- ```
-- Handle manual migrations
- - Search for token RegExps and handle manual migrations
-
-
-```sh
-# Stage all manually migrated files
-git add .
-# Format staged files only
-git diff --staged --name-only | xargs npx prettier --write
-# Commit manual migrations
-git commit -m "Manually migrate X custom properties from Polaris v11 to v12"
-```
-
-- Optionally if you use `stylelint-polaris`, you can check for errors after all custom property migrations are finished
- ```sh
- npx stylelint
- ```
-
-### `@shopify/polaris-tokens` updates
-
-#### Renames
-
-- `getCustomPropertyNames` renamed to `getThemeVarNames`
-- `createVar` renamed to `createVarName`
-
-#### Deprecations
-
-##### Deprecated Utilities
-
-If you are using these utilities, feel free to copy them from v11 into your own codebase.
-
-- `createExact`
-- `createMetadata`
-- `getKeyframeNames`
-- `getUnit`
-- `isKeyOf`
-- `rem`
-- `removeMetadata`
-- `toEm`
-- `tokensToRems`
-
-##### Deprecated Types
-
-- `BreakpointsAliasDirectionMediaConditions`
-- `BreakpointsMediaConditions`
-- `MetaBreakpointsTokenGroup`
-- `Tokens` (replaced by `Theme`)
-
-##### Deprecated all JSON exports
-
-- `@shopify/polaris-tokens/json/border.json`
-- `@shopify/polaris-tokens/json/breakpoints.json`
-- `@shopify/polaris-tokens/json/color.json`
-- `@shopify/polaris-tokens/json/font.json`
-- `@shopify/polaris-tokens/json/height.json`
-- `@shopify/polaris-tokens/json/motion.json`
-- `@shopify/polaris-tokens/json/shadow.json`
-- `@shopify/polaris-tokens/json/space.json`
-- `@shopify/polaris-tokens/json/text.json`
-- `@shopify/polaris-tokens/json/width.json`
-- `@shopify/polaris-tokens/json/zIndex.json`
-
-If you are using these exports, update the implementation to import `themes` and `JSON.stringify` the theme you need.
-
-```diff
-- const color = require('@shopify/polaris-tokens/json/color.json');
-+ const {themes} = require('@shopify/polaris-tokens');
-+ const color = JSON.stringify(themes.light.color);
-```
+
## Manual updates and fixes
### A new web font
The new design language comes with a web font called [Inter via Google Fonts](https://fonts.google.com/specimen/Inter).
-Polaris references this font but doesn't load it. Apps will need to load the font, otherwise it will fallback to to the user's system font.
+Polaris references this font but does not load it. Your app will need to load the font, otherwise it will fallback to the user's system font.
{/* prettier-ignore */}
```html
@@ -1141,7 +2534,7 @@ If you must use a divider, use the [`Divider`](/components/layout-and-structure/
### Buttons beside inputs
Default buttons have decreased in height and no longer match the height of some inputs, namely [`TextField`](/components/selection-and-input/text-field) and [`Select`](/components/selection-and-input/select).
-To get a buttons matching the height of input fields, use the large size by using the `large` size variant of [`Button`](/components/actions/button).
+To update a button's height to match the new height of input fields, use the large size by using the `large` size variant of [`Button`](/components/actions/button).
```diff
- } />
@@ -1152,7 +2545,7 @@ To get a buttons matching the height of input fields, use the large size by usin
#### Heading size
-The [`LegacyCard`](/components/deprecated/legacy-card) now also enforces that `h1` and `h2` content is `headingSm` (`--p-font-size-80-experimental`).
+The [`LegacyCard`](/components/deprecated/legacy-card) now enforces that `h1` and `h2` content uses the `Text` `headingSm` variant (`--p-font-size-325`).
If you want to use custom heading sizes, please refactor [`LegacyCard`](/components/deprecated/legacy-card) to [`Card`](/components/layout-and-structure/card).
#### Spacing and visual hierarchy
@@ -1165,7 +2558,7 @@ You can resolve this in a number of ways:
- Remove any custom content spacing wrappers and use ``, ``, or `` instead.
Issues involving a lack of top or bottom padding on the card is likely caused by this.
- Update all custom content padding using `--p-space-500` to use `--p-space-400`.
- This includes content wrapped in a [`LegacyStack`](/components/deprecated/legacy-stack)
+ This includes content wrapped in a [`LegacyStack`](/components/deprecated/legacy-stack) component.
```diff
- spacing='loose'
+ spacing={undefined}
@@ -1194,4 +2587,55 @@ The following component's children cannot be above the bevel's `z-index` elevati
Custom elements that were styled to look like the previous Polaris design language will need to be updated.
Take the opportunity to put custom styles and components on mainline Polaris using our [components](/components) and [tokens](/tokens/color).
-See a list of new tokens and the mapping our current tokens to our new once below.
+
+### `@shopify/polaris-tokens` updates
+
+#### Renames
+
+- `getCustomPropertyNames` renamed to `getThemeVarNames`
+- `createVar` renamed to `createVarName`
+
+#### Deprecations
+
+##### Deprecated Utilities
+
+If you are using these utilities, feel free to copy them from v11 into your own codebase.
+
+- `createExact`
+- `createMetadata`
+- `getKeyframeNames`
+- `getUnit`
+- `isKeyOf`
+- `rem`
+- `removeMetadata`
+- `toEm`
+- `tokensToRems`
+
+##### Deprecated Types
+
+- `BreakpointsAliasDirectionMediaConditions`
+- `BreakpointsMediaConditions`
+- `MetaBreakpointsTokenGroup`
+- `Tokens` (replaced by `Theme`)
+
+##### Deprecated all JSON exports
+
+- `@shopify/polaris-tokens/json/border.json`
+- `@shopify/polaris-tokens/json/breakpoints.json`
+- `@shopify/polaris-tokens/json/color.json`
+- `@shopify/polaris-tokens/json/font.json`
+- `@shopify/polaris-tokens/json/height.json`
+- `@shopify/polaris-tokens/json/motion.json`
+- `@shopify/polaris-tokens/json/shadow.json`
+- `@shopify/polaris-tokens/json/space.json`
+- `@shopify/polaris-tokens/json/text.json`
+- `@shopify/polaris-tokens/json/width.json`
+- `@shopify/polaris-tokens/json/zIndex.json`
+
+If you are using these exports, update the implementation to import `themes` and `JSON.stringify` the theme you need.
+
+```diff
+- const color = require('@shopify/polaris-tokens/json/color.json');
++ const {themes} = require('@shopify/polaris-tokens');
++ const color = JSON.stringify(themes.light.color);
+```
diff --git a/polaris.shopify.com/content/whats-new/version-12.md b/polaris.shopify.com/content/whats-new/version-12.md
index 2226a11e6be..aaec5af5999 100644
--- a/polaris.shopify.com/content/whats-new/version-12.md
+++ b/polaris.shopify.com/content/whats-new/version-12.md
@@ -68,152 +68,14 @@ Semantic tokens are references to base values that are used in specific contexts
### Component API simplification
-The version 12 breaking component changes aim to simplify inconsistent and complicated component APIs.
-
-Note: the below examples are for illustrative purposes only. For a comprehensive list on all component changes and how to migrate from v11's component APIs, check out the [migration guide](/version-guides/migrating-from-v11-to-v12#component-migrations).
-
-#### Logical properties rename
-
-Directional components now use `Inline` and `Block` which are defined by [CSS logical properties](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_logical_properties_and_values). This is to be consistent with other Polaris component APIs as well as wider web conventions.
-
-```diff
--
-+
--
-+
--
-+
-```
-
-#### Consolidate color changes to `tone`
-
-Renaming color control props to `tone` creates a consistent API across components.
-
-```diff
--
-+
-
--
--
--
-+
-+
-+
-
--
--
-+
-+
-
--
-+
-
--
-+
--
-+
--
-+
--
-+
-
--
-+
-```
-
-#### Consolidate boolean props to `variant`
-
-The logical combinations of boolean props can get confusing. A single `variant` prop is now used to control rendering different component styles.
-
-```diff
--
-+
-
--
-+
-
--
--
--
--
-+
-+
-+
-+
-
--
-+
--
-+
--
-+
--
-+
--
-+
-
--
--
--
-+
-+
-+
-```
-
-#### Rename `spacing` to `gap`
-
-Renaming space control props to `gap` creates a consistent API across components.
-
-```diff
--
-+
-
--
-+
-
--
-+
-```
-
-#### Other prop renames
-
-```diff
--
-+
-
--
--
--
--
--
--
-+
-+
-+
-+
-+
-+
-```
-
-#### Prop deprecations
-
-```diff
--
-+
-+
-+
-
--
-+
-+
-+
-+
-
--
--
-+
-+
-```
+The version 12 breaking component changes aim to simplify inconsistent and complicated component APIs. For a comprehensive list on all component changes and how to migrate from v11's component APIs, check out the [migration guide](/version-guides/migrating-from-v11-to-v12#component-migrations).
+
+**At a high level the API changes aimed to simplify, consolidate, and align by:**
+
+- Renaming directional components to use `Inline` and `Block` which are defined by [CSS logical properties](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_logical_properties_and_values)
+- Renaming border radius properties to align with [CSS border radius constituent properties](https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius#constituent_properties)
+- Renaming various color control props to `tone` and space control props to `gap`. This creates more consistent APIs across components
+- Consolidating boolean props to a single `variant` prop on various components to make logical combinations more intentional
## Resources
diff --git a/polaris.shopify.com/pages/[...slug].tsx b/polaris.shopify.com/pages/[...slug].tsx
index 9304e46b4b6..17453c3cfa6 100644
--- a/polaris.shopify.com/pages/[...slug].tsx
+++ b/polaris.shopify.com/pages/[...slug].tsx
@@ -21,6 +21,7 @@ interface Props {
editPageLinkPath: string;
isContentPage: boolean;
showTOC?: boolean;
+ collapsibleTOC?: boolean;
}
interface SortedRichCardGridProps extends RichCardGridProps {
@@ -89,6 +90,7 @@ const CatchAllTemplate = ({
editPageLinkPath,
isContentPage,
showTOC,
+ collapsibleTOC,
}: InferGetStaticPropsType) => {
const {title, noIndex = false} = mdx.frontmatter;
@@ -97,6 +99,7 @@ const CatchAllTemplate = ({
editPageLinkPath={editPageLinkPath}
isContentPage={isContentPage}
showTOC={showTOC || isContentPage}
+ collapsibleTOC={collapsibleTOC}
>
= async ({
editPageLinkPath,
isContentPage: !pathIsDirectory,
showTOC: mdx.frontmatter.showTOC || false,
+ collapsibleTOC: mdx.frontmatter.collapsibleTOC || false,
};
return {props};
diff --git a/polaris.shopify.com/src/components/Code/Code.module.scss b/polaris.shopify.com/src/components/Code/Code.module.scss
index 010d5f54763..31ec59602d9 100644
--- a/polaris.shopify.com/src/components/Code/Code.module.scss
+++ b/polaris.shopify.com/src/components/Code/Code.module.scss
@@ -7,6 +7,7 @@
background: var(--surface);
color: var(--text-strong);
border: var(--border);
+ margin: 1rem 0;
}
.TopBar {
diff --git a/polaris.shopify.com/src/components/CollapsibleDetails/index.tsx b/polaris.shopify.com/src/components/CollapsibleDetails/index.tsx
new file mode 100644
index 00000000000..c4a9959fd35
--- /dev/null
+++ b/polaris.shopify.com/src/components/CollapsibleDetails/index.tsx
@@ -0,0 +1,51 @@
+import React, {useState} from 'react';
+import {motion, AnimatePresence} from 'framer-motion';
+import Icon from '../Icon';
+import {CaretDownMinor} from '@shopify/polaris-icons';
+
+export interface CollasibleDetailsProps {
+ summary?: string | React.ReactNode;
+}
+export function CollapsibleDetails({
+ children,
+ summary,
+}: React.PropsWithChildren) {
+ const [isOpen, setIsOpen] = useState(false);
+
+ const toggleOpen = () => {
+ setIsOpen(!isOpen);
+ };
+
+ return (
+