From 49172ad21f172a0ab96951a1ccd2129a43b12352 Mon Sep 17 00:00:00 2001 From: Laura Griffee Date: Wed, 3 Apr 2024 12:18:28 -0600 Subject: [PATCH 1/3] Add migration guidance for replacing v14 text custom properties --- .../migrating-from-v12-to-v13.mdx | 117 ++++++++++++++++-- 1 file changed, 104 insertions(+), 13 deletions(-) diff --git a/polaris.shopify.com/content/version-guides/migrating-from-v12-to-v13.mdx b/polaris.shopify.com/content/version-guides/migrating-from-v12-to-v13.mdx index e516cbd80ff..326fdbbfdad 100644 --- a/polaris.shopify.com/content/version-guides/migrating-from-v12-to-v13.mdx +++ b/polaris.shopify.com/content/version-guides/migrating-from-v12-to-v13.mdx @@ -195,25 +195,116 @@ To replace deprecated `font` custom properties, you can run the [v13-styles-repl code={{ title: 'Check RegExp for hardcoded font custom properties across all file types', - code: String.raw`(?:--p-font-size-800|--p-font-size-900|--p-font-size-1000|--p-font-letter-spacing-densest|--p-font-line-height-1200|--p-text-heading-3xl-font-family|--p-text-heading-3xl-font-size|--p-text-heading-3xl-font-weight|--p-text-heading-3xl-font-letter-spacing|--p-text-heading-3xl-font-line-height(?![\w-])`, + code: String.raw`(?:--p-font-size-800|--p-font-size-900|--p-font-size-1000|--p-font-letter-spacing-densest|--p-font-line-height-1200(?![\w-])`, }} /> -| Deprecated Token | Replacement Value | -| ------------------------------------------ | ------------------------------------------ | -| `--p-font-size-800` | `--p-font-size-750` | -| `--p-font-size-900` | `--p-font-size-750` | -| `--p-font-size-1000` | `--p-font-size-750` | -| `--p-font-letter-spacing-densest` | `--p-font-letter-spacing-denser` | -| `--p-font-line-height-1200` | `--p-font-line-height-1000` | -| `--p-text-heading-3xl-font-family` | `--p-text-heading-2xl-font-family` | -| `--p-text-heading-3xl-font-size` | `--p-text-heading-2xl-font-size` | -| `--p-text-heading-3xl-font-weight` | `--p-text-heading-2xl-font-weight` | -| `--p-text-heading-3xl-font-letter-spacing` | `--p-text-heading-2xl-font-letter-spacing` | -| `--p-text-heading-3xl-font-line-height` | `--p-text-heading-2xl-font-line-height` | +| Deprecated Token | Replacement Value | +| --------------------------------- | -------------------------------- | +| `--p-font-size-800` | `--p-font-size-750` | +| `--p-font-size-900` | `--p-font-size-750` | +| `--p-font-size-1000` | `--p-font-size-750` | +| `--p-font-letter-spacing-densest` | `--p-font-letter-spacing-denser` | +| `--p-font-line-height-1200` | `--p-font-line-height-1000` | + + + +### Text + +To replace deprecated `text` custom properties, you can run the [v14-styles-replace-custom-property-text](/tools/polaris-migrator#v14-styles-replace-custom-property-text) migration then validate with RegExp. Please reference the [recommended migration workflow](#migration-workflow) section below for additional migration support. + + + +```diff +- font-size: var(--p-text-heading-xl-font-size); ++ font-size: var(--p-font-size-600); +``` + + + + + + + After migrating, use the following RegExp to check for any additional + instances of `text` custom properties across all file types: + + + + + +| Deprecated Token | Replacement Value | +| ------------------------------------------ | -------------------------------- | +| `--p-text-heading-3xl-font-family` | `--p-font-family-sans` | +| `--p-text-heading-3xl-font-size` | `--p-font-size-750` | +| `--p-text-heading-3xl-font-weight` | `--p-font-weight-bold` | +| `--p-text-heading-3xl-font-letter-spacing` | `--p-font-letter-spacing-denser` | +| `--p-text-heading-3xl-font-line-height` | `--p-font-line-height-1000` | +| `--p-text-heading-2xl-font-family` | `--p-font-family-sans` | +| `--p-text-heading-2xl-font-size` | `--p-font-size-750` | +| `--p-text-heading-2xl-font-weight` | `--p-font-weight-bold` | +| `--p-text-heading-2xl-font-letter-spacing` | `--p-font-letter-spacing-denser` | +| `--p-text-heading-2xl-font-line-height` | `--p-font-line-height-1000` | +| `--p-text-heading-xl-font-family` | `--p-font-family-sans` | +| `--p-text-heading-xl-font-size` | `--p-font-size-600` | +| `--p-text-heading-xl-font-weight` | `--p-font-weight-bold` | +| `--p-text-heading-xl-font-letter-spacing` | `--p-font-letter-spacing-dense` | +| `--p-text-heading-xl-font-line-height` | `--p-font-line-height-800` | +| `--p-text-heading-lg-font-family` | `--p-font-family-sans` | +| `--p-text-heading-lg-font-size` | `--p-font-size-500` | +| `--p-text-heading-lg-font-weight` | `--p-font-weight-semibold` | +| `--p-text-heading-lg-font-letter-spacing` | `--p-font-letter-spacing-dense` | +| `--p-text-heading-lg-font-line-height` | `--p-font-line-height-600` | +| `--p-text-heading-md-font-family` | `--p-font-family-sans` | +| `--p-text-heading-md-font-size` | `--p-font-size-350` | +| `--p-text-heading-md-font-weight` | `--p-font-weight-semibold` | +| `--p-text-heading-md-font-letter-spacing` | `--p-font-letter-spacing-normal` | +| `--p-text-heading-md-font-line-height` | `--p-font-line-height-500` | +| `--p-text-heading-sm-font-family` | `--p-font-family-sans` | +| `--p-text-heading-sm-font-size` | `--p-font-size-325` | +| `--p-text-heading-sm-font-weight` | `--p-font-weight-semibold` | +| `--p-text-heading-sm-font-letter-spacing` | `--p-font-letter-spacing-normal` | +| `--p-text-heading-sm-font-line-height` | `--p-font-line-height-500` | +| `--p-text-heading-xs-font-family` | `--p-font-family-sans` | +| `--p-text-heading-xs-font-size` | `--p-font-size-300` | +| `--p-text-heading-xs-font-weight` | `--p-font-weight-semibold` | +| `--p-text-heading-xs-font-letter-spacing` | `--p-font-letter-spacing-normal` | +| `--p-text-heading-xs-font-line-height` | `--p-font-line-height-400` | +| `--p-text-body-lg-font-family` | `--p-font-family-sans` | +| `--p-text-body-lg-font-size` | `--p-font-size-350` | +| `--p-text-body-lg-font-weight` | `--p-font-weight-regular` | +| `--p-text-body-lg-font-letter-spacing` | `--p-font-letter-spacing-normal` | +| `--p-text-body-lg-font-line-height` | `--p-font-line-height-500` | +| `--p-text-body-md-font-family` | `--p-font-family-sans` | +| `--p-text-body-md-font-size` | `--p-font-size-325` | +| `--p-text-body-md-font-weight` | `--p-font-weight-regular` | +| `--p-text-body-md-font-letter-spacing` | `--p-font-letter-spacing-normal` | +| `--p-text-body-md-font-line-height` | `--p-font-line-height-500` | +| `--p-text-body-sm-font-family` | `--p-font-family-sans` | +| `--p-text-body-sm-font-size` | `--p-font-size-300` | +| `--p-text-body-sm-font-weight` | `--p-font-weight-regular` | +| `--p-text-body-sm-font-letter-spacing` | `--p-font-letter-spacing-normal` | +| `--p-text-body-sm-font-line-height` | `--p-font-line-height-400` | +| `--p-text-body-xs-font-family` | `--p-font-family-sans` | +| `--p-text-body-xs-font-size` | `--p-font-size-275` | +| `--p-text-body-xs-font-weight` | `--p-font-weight-regular` | +| `--p-text-body-xs-font-letter-spacing` | `--p-font-letter-spacing-normal` | +| `--p-text-body-xs-font-line-height` | `--p-font-line-height-300` | From 53d9e96308f55152c11187f4b7cb16f83f519cb5 Mon Sep 17 00:00:00 2001 From: Laura Griffee Date: Fri, 5 Apr 2024 12:06:57 -0600 Subject: [PATCH 2/3] Update polaris.shopify.com/content/version-guides/migrating-from-v12-to-v13.mdx --- .../content/version-guides/migrating-from-v12-to-v13.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polaris.shopify.com/content/version-guides/migrating-from-v12-to-v13.mdx b/polaris.shopify.com/content/version-guides/migrating-from-v12-to-v13.mdx index 326fdbbfdad..de1134b1088 100644 --- a/polaris.shopify.com/content/version-guides/migrating-from-v12-to-v13.mdx +++ b/polaris.shopify.com/content/version-guides/migrating-from-v12-to-v13.mdx @@ -195,7 +195,7 @@ To replace deprecated `font` custom properties, you can run the [v13-styles-repl code={{ title: 'Check RegExp for hardcoded font custom properties across all file types', - code: String.raw`(?:--p-font-size-800|--p-font-size-900|--p-font-size-1000|--p-font-letter-spacing-densest|--p-font-line-height-1200(?![\w-])`, + code: String.raw`(?:--p-font-size-800|--p-font-size-900|--p-font-size-1000|--p-font-letter-spacing-densest|--p-font-line-height-1200)(?![\w-])`, }} /> From 452fc9e67351c62c6a16bea7d499eab664d79312 Mon Sep 17 00:00:00 2001 From: Laura Griffee Date: Fri, 5 Apr 2024 12:07:07 -0600 Subject: [PATCH 3/3] Update polaris.shopify.com/content/version-guides/migrating-from-v12-to-v13.mdx --- .../content/version-guides/migrating-from-v12-to-v13.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polaris.shopify.com/content/version-guides/migrating-from-v12-to-v13.mdx b/polaris.shopify.com/content/version-guides/migrating-from-v12-to-v13.mdx index de1134b1088..61c41903f17 100644 --- a/polaris.shopify.com/content/version-guides/migrating-from-v12-to-v13.mdx +++ b/polaris.shopify.com/content/version-guides/migrating-from-v12-to-v13.mdx @@ -241,7 +241,7 @@ To replace deprecated `text` custom properties, you can run the [v14-styles-repl code={{ title: 'Check RegExp for hardcoded text custom properties across all file types', - code: String.raw`(?:--p-text-heading-3xl-font-family|--p-text-heading-3xl-font-size|--p-text-heading-3xl-font-weight| --p-text-heading-3xl-font-letter-spacing|--p-text-heading-3xl-font-line-height|--p-text-heading-2xl-font-family|--p-text-heading-2xl-font-size|--p-text-heading-2xl-font-weight| --p-text-heading-2xl-font-letter-spacing|--p-text-heading-2xl-font-line-height| --p-text-heading-xl-font-family|--p-text-heading-xl-font-size|--p-text-heading-xl-font-weight| --p-text-heading-xl-font-letter-spacing|--p-text-heading-xl-font-line-height|--p-text-heading-lg-font-family|--p-text-heading-lg-font-size|--p-text-heading-lg-font-weight|--p-text-heading-lg-font-letter-spacing|--p-text-heading-lg-font-line-height|--p-text-heading-md-font-family|--p-text-heading-md-font-size|--p-text-heading-md-font-weight|--p-text-heading-md-font-letter-spacing|--p-text-heading-md-font-line-height|--p-text-heading-sm-font-family|--p-text-heading-sm-font-size|--p-text-heading-sm-font-weight|--p-text-heading-sm-font-letter-spacing|--p-text-heading-sm-font-line-height|--p-text-heading-xs-font-family|--p-text-heading-xs-font-size|--p-text-heading-xs-font-weight|--p-text-heading-xs-font-letter-spacing|--p-text-heading-xs-font-line-height|--p-text-body-lg-font-family|--p-text-body-lg-font-size|--p-text-body-lg-font-weight|--p-text-body-lg-font-letter-spacing|--p-text-body-lg-font-line-height|--p-text-body-md-font-family|--p-text-body-md-font-size|--p-text-body-md-font-weight|--p-text-body-md-font-letter-spacing|--p-text-body-md-font-line-height|--p-text-body-sm-font-family|--p-text-body-sm-font-size|--p-text-body-sm-font-weight|--p-text-body-sm-font-letter-spacing|--p-text-body-sm-font-line-height|--p-text-body-xs-font-family|--p-text-body-xs-font-size|--p-text-body-xs-font-weight|--p-text-body-xs-font-letter-spacing|--p-text-body-xs-font-line-height(?![\w-])`, + code: String.raw`(?:--p-text-heading-3xl-font-family|--p-text-heading-3xl-font-size|--p-text-heading-3xl-font-weight| --p-text-heading-3xl-font-letter-spacing|--p-text-heading-3xl-font-line-height|--p-text-heading-2xl-font-family|--p-text-heading-2xl-font-size|--p-text-heading-2xl-font-weight| --p-text-heading-2xl-font-letter-spacing|--p-text-heading-2xl-font-line-height| --p-text-heading-xl-font-family|--p-text-heading-xl-font-size|--p-text-heading-xl-font-weight| --p-text-heading-xl-font-letter-spacing|--p-text-heading-xl-font-line-height|--p-text-heading-lg-font-family|--p-text-heading-lg-font-size|--p-text-heading-lg-font-weight|--p-text-heading-lg-font-letter-spacing|--p-text-heading-lg-font-line-height|--p-text-heading-md-font-family|--p-text-heading-md-font-size|--p-text-heading-md-font-weight|--p-text-heading-md-font-letter-spacing|--p-text-heading-md-font-line-height|--p-text-heading-sm-font-family|--p-text-heading-sm-font-size|--p-text-heading-sm-font-weight|--p-text-heading-sm-font-letter-spacing|--p-text-heading-sm-font-line-height|--p-text-heading-xs-font-family|--p-text-heading-xs-font-size|--p-text-heading-xs-font-weight|--p-text-heading-xs-font-letter-spacing|--p-text-heading-xs-font-line-height|--p-text-body-lg-font-family|--p-text-body-lg-font-size|--p-text-body-lg-font-weight|--p-text-body-lg-font-letter-spacing|--p-text-body-lg-font-line-height|--p-text-body-md-font-family|--p-text-body-md-font-size|--p-text-body-md-font-weight|--p-text-body-md-font-letter-spacing|--p-text-body-md-font-line-height|--p-text-body-sm-font-family|--p-text-body-sm-font-size|--p-text-body-sm-font-weight|--p-text-body-sm-font-letter-spacing|--p-text-body-sm-font-line-height|--p-text-body-xs-font-family|--p-text-body-xs-font-size|--p-text-body-xs-font-weight|--p-text-body-xs-font-letter-spacing|--p-text-body-xs-font-line-height)(?![\w-])`, }} />