diff --git a/.changeset/twenty-chefs-float.md b/.changeset/twenty-chefs-float.md new file mode 100644 index 00000000000..ca8fe89af58 --- /dev/null +++ b/.changeset/twenty-chefs-float.md @@ -0,0 +1,5 @@ +--- +'@shopify/polaris-migrator': patch +--- + +Removed `Text` `heading2xl` and associated tokens from v14 font migration diff --git a/polaris-migrator/src/migrations/v14-styles-replace-custom-property-font/tests/v14-styles-replace-custom-property-font.input.scss b/polaris-migrator/src/migrations/v14-styles-replace-custom-property-font/tests/v14-styles-replace-custom-property-font.input.scss index db0849ebb32..b7fe00d169f 100644 --- a/polaris-migrator/src/migrations/v14-styles-replace-custom-property-font/tests/v14-styles-replace-custom-property-font.input.scss +++ b/polaris-migrator/src/migrations/v14-styles-replace-custom-property-font/tests/v14-styles-replace-custom-property-font.input.scss @@ -1,20 +1,12 @@ .font { - font-size: var(--p-font-size-750); font-size: var(--p-font-size-800); font-size: var(--p-font-size-900); font-size: var(--p-font-size-1000); - font-size: var(--p-text-heading-2xl-font-size); font-size: var(--p-text-heading-3xl-font-size); - letter-spacing: var(--p-font-letter-spacing-denser); letter-spacing: var(--p-font-letter-spacing-densest); - letter-spacing: var(--p-text-heading-2xl-font-letter-spacing); letter-spacing: var(--p-text-heading-3xl-font-letter-spacing); - line-height: var(--p-font-line-height-1000); line-height: var(--p-font-line-height-1200); - line-height: var(--p-text-heading-2xl-font-line-height); line-height: var(--p-text-heading-3xl-font-line-height); - font-family: var(--p-text-heading-2xl-font-family); font-family: var(--p-text-heading-3xl-font-family); - font-weight: var(--p-text-heading-2xl-font-weight); font-weight: var(--p-text-heading-3xl-font-weight); } diff --git a/polaris-migrator/src/migrations/v14-styles-replace-custom-property-font/tests/v14-styles-replace-custom-property-font.output.scss b/polaris-migrator/src/migrations/v14-styles-replace-custom-property-font/tests/v14-styles-replace-custom-property-font.output.scss index adba971ea78..ea3ce491042 100644 --- a/polaris-migrator/src/migrations/v14-styles-replace-custom-property-font/tests/v14-styles-replace-custom-property-font.output.scss +++ b/polaris-migrator/src/migrations/v14-styles-replace-custom-property-font/tests/v14-styles-replace-custom-property-font.output.scss @@ -1,20 +1,12 @@ .font { - font-size: var(--p-font-size-600); - font-size: var(--p-font-size-600); - font-size: var(--p-font-size-600); - font-size: var(--p-font-size-600); - font-size: var(--p-text-heading-xl-font-size); - font-size: var(--p-text-heading-xl-font-size); - letter-spacing: var(--p-font-letter-spacing-dense); - letter-spacing: var(--p-font-letter-spacing-dense); - letter-spacing: var(--p-text-heading-xl-font-letter-spacing); - letter-spacing: var(--p-text-heading-xl-font-letter-spacing); - line-height: var(--p-font-line-height-800); - line-height: var(--p-font-line-height-800); - line-height: var(--p-text-heading-xl-font-line-height); - line-height: var(--p-text-heading-xl-font-line-height); - font-family: var(--p-text-heading-xl-font-family); - font-family: var(--p-text-heading-xl-font-family); - font-weight: var(--p-text-heading-xl-font-weight); - font-weight: var(--p-text-heading-xl-font-weight); + font-size: var(--p-font-size-750); + font-size: var(--p-font-size-750); + font-size: var(--p-font-size-750); + font-size: var(--p-text-heading-2xl-font-size); + letter-spacing: var(--p-font-letter-spacing-denser); + letter-spacing: var(--p-text-heading-2xl-font-letter-spacing); + line-height: var(--p-font-line-height-1000); + line-height: var(--p-text-heading-2xl-font-line-height); + font-family: var(--p-text-heading-2xl-font-family); + font-weight: var(--p-text-heading-2xl-font-weight); } diff --git a/polaris-migrator/src/migrations/v14-styles-replace-custom-property-font/transform.ts b/polaris-migrator/src/migrations/v14-styles-replace-custom-property-font/transform.ts index 1e5eea07ee8..03d28630ac9 100644 --- a/polaris-migrator/src/migrations/v14-styles-replace-custom-property-font/transform.ts +++ b/polaris-migrator/src/migrations/v14-styles-replace-custom-property-font/transform.ts @@ -8,27 +8,17 @@ export default function transformer(fileInfo: FileInfo, _: API) { const replacementMaps = { '/.+/': { - '--p-font-size-750': '--p-font-size-600', - '--p-font-size-800': '--p-font-size-600', - '--p-font-size-900': '--p-font-size-600', - '--p-font-size-1000': '--p-font-size-600', - '--p-font-letter-spacing-denser': '--p-font-letter-spacing-dense', - '--p-font-letter-spacing-densest': '--p-font-letter-spacing-dense', - '--p-font-line-height-1000': '--p-font-line-height-800', - '--p-font-line-height-1200': '--p-font-line-height-800', - '--p-text-heading-3xl-font-family': '--p-text-heading-xl-font-family', - '--p-text-heading-3xl-font-size': '--p-text-heading-xl-font-size', - '--p-text-heading-3xl-font-weight': '--p-text-heading-xl-font-weight', + '--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-xl-font-letter-spacing', + '--p-text-heading-2xl-font-letter-spacing', '--p-text-heading-3xl-font-line-height': - '--p-text-heading-xl-font-line-height', - '--p-text-heading-2xl-font-family': '--p-text-heading-xl-font-family', - '--p-text-heading-2xl-font-size': '--p-text-heading-xl-font-size', - '--p-text-heading-2xl-font-weight': '--p-text-heading-xl-font-weight', - '--p-text-heading-2xl-font-letter-spacing': - '--p-text-heading-xl-font-letter-spacing', - '--p-text-heading-2xl-font-line-height': - '--p-text-heading-xl-font-line-height', + '--p-text-heading-2xl-font-line-height', }, };