From 905a53c303f40231903499f89a76cd39a7e68c78 Mon Sep 17 00:00:00 2001 From: Xavier Lozano Carreras Date: Thu, 29 Oct 2026 16:45:10 +0100 Subject: [PATCH] Import @wordpress/base-styles modules directly in packages/publicize The project declares @wordpress/base-styles itself, so the @automattic/jetpack-base-styles/gutenberg-base-styles wrapper adds nothing. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01K4t4VY7ojGc1sr9Cb1z84Z --- .../styles.module.scss | 4 +-- .../connection-toggle/styles.module.scss | 2 -- .../customization-section/styles.module.scss | 13 +++---- .../preview-section/styles.module.scss | 14 ++++---- .../tab-panels/styles.module.scss | 36 ++++++++++--------- .../_inc/components/form/styles.module.scss | 6 ++-- .../link-preview-panel/styles.module.scss | 2 -- .../media-picker/styles.module.scss | 4 +-- .../message-box-control/styles.module.scss | 4 +-- .../styles.module.scss | 4 +-- .../_inc/components/panel/styles.module.scss | 4 +-- .../placeholder-token/styles.module.scss | 6 ++-- .../placeholders-help/styles.module.scss | 4 +-- .../components/services/style.module.scss | 8 ++--- .../template-picker/modal/styles.module.scss | 4 +-- .../edit-template/styles.module.scss | 10 +++--- .../social-post-preview/styles.module.scss | 4 +-- .../unified-modal/styles.module.scss | 7 ++-- .../exports/link-preview/styles.module.scss | 9 ++--- ...te-jetpack-2754-base-styles-direct-imports | 5 +++ 20 files changed, 78 insertions(+), 72 deletions(-) create mode 100644 projects/packages/publicize/changelog/update-jetpack-2754-base-styles-direct-imports diff --git a/projects/packages/publicize/_inc/components/connections-toggle-list/styles.module.scss b/projects/packages/publicize/_inc/components/connections-toggle-list/styles.module.scss index 747d3d01ab1d..a50126aa98ee 100644 --- a/projects/packages/publicize/_inc/components/connections-toggle-list/styles.module.scss +++ b/projects/packages/publicize/_inc/components/connections-toggle-list/styles.module.scss @@ -1,4 +1,4 @@ -@use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb; +@use "@wordpress/base-styles/colors"; .wrapper { @@ -8,7 +8,7 @@ &:not(:last-child) { border-radius: 0; - border-bottom: 1px solid gb.$gray-100; + border-bottom: 1px solid colors.$gray-100; } } diff --git a/projects/packages/publicize/_inc/components/customize-and-preview/connection-toggle/styles.module.scss b/projects/packages/publicize/_inc/components/customize-and-preview/connection-toggle/styles.module.scss index 2fed1ff54313..6b6b7ce7ea71 100644 --- a/projects/packages/publicize/_inc/components/customize-and-preview/connection-toggle/styles.module.scss +++ b/projects/packages/publicize/_inc/components/customize-and-preview/connection-toggle/styles.module.scss @@ -1,5 +1,3 @@ -@use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb; - .connection-toggle { label { diff --git a/projects/packages/publicize/_inc/components/customize-and-preview/customization-section/styles.module.scss b/projects/packages/publicize/_inc/components/customize-and-preview/customization-section/styles.module.scss index cff068fb6d82..3a392169dfaf 100644 --- a/projects/packages/publicize/_inc/components/customize-and-preview/customization-section/styles.module.scss +++ b/projects/packages/publicize/_inc/components/customize-and-preview/customization-section/styles.module.scss @@ -1,4 +1,5 @@ -@use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb; +@use "@wordpress/base-styles/colors"; +@use "@wordpress/base-styles/mixins"; .customization-section { padding: 1rem; @@ -8,12 +9,12 @@ // Allow fieldset to shrink below its content size in grid/flex layouts. min-inline-size: 0; - @include gb.break-medium() { + @include mixins.break-medium() { overflow-y: auto; } legend { - color: gb.$gray-700; + color: colors.$gray-700; // Float fixes the default fieldset/legend border and padding issues. float: inline-start; // Prevents height collapse in flex fieldsets. @@ -31,16 +32,16 @@ // for per-network customization. display: none; - @include gb.break-medium() { + @include mixins.break-medium() { display: block; } } } - @include gb.break-medium() { + @include mixins.break-medium() { &[data-variant="global"] { - border-inline-end: 1px solid gb.$gray-200; + border-inline-end: 1px solid colors.$gray-200; } } } diff --git a/projects/packages/publicize/_inc/components/customize-and-preview/preview-section/styles.module.scss b/projects/packages/publicize/_inc/components/customize-and-preview/preview-section/styles.module.scss index ca4d02c8efc5..b4be1405e1ac 100644 --- a/projects/packages/publicize/_inc/components/customize-and-preview/preview-section/styles.module.scss +++ b/projects/packages/publicize/_inc/components/customize-and-preview/preview-section/styles.module.scss @@ -1,4 +1,4 @@ -@use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb; +@use "@wordpress/base-styles/colors"; @keyframes preview-loading-pulse { @@ -16,7 +16,7 @@ } .preview-section { - background: gb.$gray-100; + background: colors.$gray-100; padding: 1rem; .inactive-preview { @@ -26,10 +26,10 @@ align-items: center; justify-content: center; gap: 0.5rem; - color: gb.$gray-700; + color: colors.$gray-700; svg { - fill: gb.$gray-700; + fill: colors.$gray-700; } } @@ -43,9 +43,9 @@ .preview-skeleton { inline-size: min(100%, 420px); padding: 1rem; - border: 1px solid gb.$gray-200; + border: 1px solid colors.$gray-200; border-radius: 8px; - background: gb.$white; + background: colors.$white; display: flex; flex-direction: column; gap: 0.75rem; @@ -60,7 +60,7 @@ .preview-skeleton-avatar, .preview-skeleton-line, .preview-skeleton-media { - background: gb.$gray-200; + background: colors.$gray-200; animation: preview-loading-pulse 1.5s ease-in-out infinite; } diff --git a/projects/packages/publicize/_inc/components/customize-and-preview/tab-panels/styles.module.scss b/projects/packages/publicize/_inc/components/customize-and-preview/tab-panels/styles.module.scss index 44c7a16bf305..96f0d4eeaf36 100644 --- a/projects/packages/publicize/_inc/components/customize-and-preview/tab-panels/styles.module.scss +++ b/projects/packages/publicize/_inc/components/customize-and-preview/tab-panels/styles.module.scss @@ -1,10 +1,12 @@ -@use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb; +@use "@wordpress/base-styles/colors"; +@use "@wordpress/base-styles/mixins"; +@use "@wordpress/base-styles/variables"; .tab-panel-wrapper { min-height: 0; overflow-y: auto; - @include gb.break-medium() { + @include mixins.break-medium() { display: grid; overflow-y: unset; @@ -14,18 +16,18 @@ } &[data-plan="paid"] { - border-top: 1px solid gb.$gray-200; + border-top: 1px solid colors.$gray-200; - @include gb.break-medium() { + @include mixins.break-medium() { overflow: hidden; } } [role="tablist"] { - padding: gb.$grid-unit-10; // 8px - border-block: 1px solid gb.$gray-200; + padding: variables.$grid-unit-10; // 8px + border-block: 1px solid colors.$gray-200; - @include gb.break-medium() { + @include mixins.break-medium() { border-block-start: none; } } @@ -40,7 +42,7 @@ display: grid; min-height: 0; - @include gb.break-medium() { + @include mixins.break-medium() { grid-template-rows: auto 1fr; height: 100%; } @@ -54,8 +56,8 @@ height: 40px !important; // Core uses !important for tab height. &:global(.is-active) { - background: gb.$gray-900; - border-radius: gb.$radius-medium; + background: colors.$gray-900; + border-radius: variables.$radius-medium; // Hide the default active tab underline. &::after { @@ -74,7 +76,7 @@ width: 12px; height: 12px; border-radius: 50%; - border: 2px solid gb.$white; + border: 2px solid colors.$white; position: absolute; inset-block-start: 0; inset-inline-start: 0; @@ -87,7 +89,7 @@ grid-template-columns: 1fr; height: 100%; - @include gb.break-medium() { + @include mixins.break-medium() { overflow: hidden; } @@ -101,11 +103,11 @@ .connection-toggle-wrapper { order: -1; - background-color: gb.$white; + background-color: colors.$white; } } - @include gb.break-medium() { + @include mixins.break-medium() { // Ensure that it takes full height grid-template-rows: 1fr; @@ -121,7 +123,7 @@ .connection-toggle-wrapper { order: unset; - background: gb.$gray-100; + background: colors.$gray-100; } } } @@ -131,7 +133,7 @@ display: flex; flex-direction: column; - @include gb.break-medium() { + @include mixins.break-medium() { overflow-y: auto; } @@ -142,6 +144,6 @@ } .connection-toggle-wrapper { - background: gb.$gray-100; + background: colors.$gray-100; padding: 1rem; } diff --git a/projects/packages/publicize/_inc/components/form/styles.module.scss b/projects/packages/publicize/_inc/components/form/styles.module.scss index 0979a0b4a2d2..8e2655b937fe 100644 --- a/projects/packages/publicize/_inc/components/form/styles.module.scss +++ b/projects/packages/publicize/_inc/components/form/styles.module.scss @@ -1,5 +1,5 @@ @use "@automattic/jetpack-base-styles/root-variables"; -@use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb; +@use "@wordpress/base-styles/colors"; .more-link { display: inline-block; @@ -59,7 +59,7 @@ .connections-list { border-radius: 2px; - border: 1px solid gb.$gray-200; + border: 1px solid colors.$gray-200; } .empty-state { @@ -95,5 +95,5 @@ } .per-network-customization-notice { - color: gb.$gray-700; + color: colors.$gray-700; } diff --git a/projects/packages/publicize/_inc/components/link-preview-panel/styles.module.scss b/projects/packages/publicize/_inc/components/link-preview-panel/styles.module.scss index 829e60833af3..6ba9151c9dbd 100644 --- a/projects/packages/publicize/_inc/components/link-preview-panel/styles.module.scss +++ b/projects/packages/publicize/_inc/components/link-preview-panel/styles.module.scss @@ -1,5 +1,3 @@ -@use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb; - .social-icons-list { display: flex; justify-content: space-between; diff --git a/projects/packages/publicize/_inc/components/media-picker/styles.module.scss b/projects/packages/publicize/_inc/components/media-picker/styles.module.scss index 5fa8360cff7d..fb2078d29fa8 100644 --- a/projects/packages/publicize/_inc/components/media-picker/styles.module.scss +++ b/projects/packages/publicize/_inc/components/media-picker/styles.module.scss @@ -1,4 +1,4 @@ -@use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb; +@use "@wordpress/base-styles/colors"; .preview-wrapper { position: relative; @@ -56,7 +56,7 @@ } .subtitle { - color: gb.$gray-700; + color: colors.$gray-700; font-size: 12px; font-weight: 400; line-height: 16px; diff --git a/projects/packages/publicize/_inc/components/message-box-control/styles.module.scss b/projects/packages/publicize/_inc/components/message-box-control/styles.module.scss index 2564526c7530..3ac9d8bbe66e 100644 --- a/projects/packages/publicize/_inc/components/message-box-control/styles.module.scss +++ b/projects/packages/publicize/_inc/components/message-box-control/styles.module.scss @@ -1,8 +1,8 @@ -@use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb; +@use "@wordpress/base-styles/colors"; .message-box-control { textarea:disabled { - background-color: gb.$gray-100; + background-color: colors.$gray-100; } } diff --git a/projects/packages/publicize/_inc/components/message-template-editor/styles.module.scss b/projects/packages/publicize/_inc/components/message-template-editor/styles.module.scss index 056d7f1224b3..24f4713b4c01 100644 --- a/projects/packages/publicize/_inc/components/message-template-editor/styles.module.scss +++ b/projects/packages/publicize/_inc/components/message-template-editor/styles.module.scss @@ -1,8 +1,8 @@ -@use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb; +@use "@wordpress/base-styles/colors"; .message-template-editor { textarea:disabled { - background-color: gb.$gray-100; + background-color: colors.$gray-100; } } diff --git a/projects/packages/publicize/_inc/components/panel/styles.module.scss b/projects/packages/publicize/_inc/components/panel/styles.module.scss index fdb9633f359d..42b89006908e 100644 --- a/projects/packages/publicize/_inc/components/panel/styles.module.scss +++ b/projects/packages/publicize/_inc/components/panel/styles.module.scss @@ -1,10 +1,10 @@ -@use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb; +@use "@wordpress/base-styles/colors"; .panel { position: relative; } .description:global(.components-text) { - color: gb.$gray-700; + color: colors.$gray-700; font-size: 0.75rem; } diff --git a/projects/packages/publicize/_inc/components/placeholder-token/styles.module.scss b/projects/packages/publicize/_inc/components/placeholder-token/styles.module.scss index 098b6da22f51..1c8fa54fa985 100644 --- a/projects/packages/publicize/_inc/components/placeholder-token/styles.module.scss +++ b/projects/packages/publicize/_inc/components/placeholder-token/styles.module.scss @@ -1,10 +1,10 @@ -@use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb; +@use "@wordpress/base-styles/colors"; // Set the colors and box so a global `code` rule can't restyle the token. .placeholder-token { padding: 0 4px; border: 0; border-radius: 2px; - background-color: gb.$gray-100; - color: gb.$gray-900; + background-color: colors.$gray-100; + color: colors.$gray-900; } diff --git a/projects/packages/publicize/_inc/components/placeholders-help/styles.module.scss b/projects/packages/publicize/_inc/components/placeholders-help/styles.module.scss index 8d78fc0cdf28..7735b33e9bbd 100644 --- a/projects/packages/publicize/_inc/components/placeholders-help/styles.module.scss +++ b/projects/packages/publicize/_inc/components/placeholders-help/styles.module.scss @@ -1,4 +1,4 @@ -@use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb; +@use "@wordpress/base-styles/colors"; .placeholders-help { @@ -43,7 +43,7 @@ } span { - color: var(--jp-gray-70, gb.$gray-700); + color: var(--jp-gray-70, colors.$gray-700); } } } diff --git a/projects/packages/publicize/_inc/components/services/style.module.scss b/projects/packages/publicize/_inc/components/services/style.module.scss index b1b412981599..458eab932f3c 100644 --- a/projects/packages/publicize/_inc/components/services/style.module.scss +++ b/projects/packages/publicize/_inc/components/services/style.module.scss @@ -1,4 +1,4 @@ -@use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb; +@use "@wordpress/base-styles/mixins"; .services { display: flex; @@ -203,7 +203,7 @@ justify-content: flex-start; } - @include gb.break-medium { + @include mixins.break-medium { flex-direction: row; } } @@ -215,11 +215,11 @@ flex-basis: 100%; min-width: 220px; - @include gb.break-medium { + @include mixins.break-medium { flex-basis: 50%; } - @include gb.break-small { + @include mixins.break-small { button { align-self: start; diff --git a/projects/packages/publicize/_inc/components/social-image-generator/template-picker/modal/styles.module.scss b/projects/packages/publicize/_inc/components/social-image-generator/template-picker/modal/styles.module.scss index e9ce0986af96..4562716fe545 100644 --- a/projects/packages/publicize/_inc/components/social-image-generator/template-picker/modal/styles.module.scss +++ b/projects/packages/publicize/_inc/components/social-image-generator/template-picker/modal/styles.module.scss @@ -1,4 +1,4 @@ -@use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb; +@use "@wordpress/base-styles/mixins"; .footer { margin-top: 2rem; @@ -18,7 +18,7 @@ .modal { - @include gb.break-small { + @include mixins.break-small { max-height: 90%; } } diff --git a/projects/packages/publicize/_inc/components/unified-modal/edit-template/styles.module.scss b/projects/packages/publicize/_inc/components/unified-modal/edit-template/styles.module.scss index 13605bffc7ce..71ddad43fd07 100644 --- a/projects/packages/publicize/_inc/components/unified-modal/edit-template/styles.module.scss +++ b/projects/packages/publicize/_inc/components/unified-modal/edit-template/styles.module.scss @@ -1,4 +1,4 @@ -@use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb; +@use "@wordpress/base-styles/colors"; .sidebar { padding: 1.5rem; @@ -18,13 +18,13 @@ font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; - color: gb.$gray-700; + color: colors.$gray-700; margin-bottom: 12px; } .content { flex: 1; - background-color: gb.$gray-100; + background-color: colors.$gray-100; display: flex; align-items: center; justify-content: center; @@ -42,7 +42,7 @@ width: 100%; max-width: 800px; aspect-ratio: 1200 / 630; // SIG image aspect-ratio - background-color: gb.$white; + background-color: colors.$white; } .previewImage { @@ -62,7 +62,7 @@ .sourceLabel { font-size: 13px; - color: gb.$gray-700; + color: colors.$gray-700; margin: 0; } diff --git a/projects/packages/publicize/_inc/components/unified-modal/social-post-preview/styles.module.scss b/projects/packages/publicize/_inc/components/unified-modal/social-post-preview/styles.module.scss index 469b10515452..c15da3ea3919 100644 --- a/projects/packages/publicize/_inc/components/unified-modal/social-post-preview/styles.module.scss +++ b/projects/packages/publicize/_inc/components/unified-modal/social-post-preview/styles.module.scss @@ -1,4 +1,4 @@ -@use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb; +@use "@wordpress/base-styles/mixins"; .social-post-preview-screen { @@ -20,7 +20,7 @@ min-height: 0; overflow: auto; - @include gb.break-medium() { + @include mixins.break-medium() { overflow: hidden; } } diff --git a/projects/packages/publicize/_inc/components/unified-modal/styles.module.scss b/projects/packages/publicize/_inc/components/unified-modal/styles.module.scss index 67e951ff2d55..7f1a12c940b4 100644 --- a/projects/packages/publicize/_inc/components/unified-modal/styles.module.scss +++ b/projects/packages/publicize/_inc/components/unified-modal/styles.module.scss @@ -1,11 +1,12 @@ -@use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb; +@use "@wordpress/base-styles/breakpoints"; +@use "@wordpress/base-styles/mixins"; .unified-modal { &:global(.components-modal__frame.is-full-screen) { - @include gb.break-medium() { - max-width: gb.$break-wide; + @include mixins.break-medium() { + max-width: breakpoints.$break-wide; max-height: 64rem; } diff --git a/projects/packages/publicize/_inc/exports/link-preview/styles.module.scss b/projects/packages/publicize/_inc/exports/link-preview/styles.module.scss index ad199efa4190..355d72fd76c4 100644 --- a/projects/packages/publicize/_inc/exports/link-preview/styles.module.scss +++ b/projects/packages/publicize/_inc/exports/link-preview/styles.module.scss @@ -1,4 +1,5 @@ -@use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb; +@use "@wordpress/base-styles/breakpoints"; +@use "@wordpress/base-styles/mixins"; .link-preview-modal { @@ -8,8 +9,8 @@ padding-inline: 0; } - @include gb.break-medium() { - max-width: gb.$break-wide; // 1280px + @include mixins.break-medium() { + max-width: breakpoints.$break-wide; // 1280px max-height: 64rem; } } @@ -39,7 +40,7 @@ justify-content: center; > div { - max-width: clamp(gb.$break-mobile, 100%, gb.$break-small); + max-width: clamp(breakpoints.$break-mobile, 100%, breakpoints.$break-small); } } } diff --git a/projects/packages/publicize/changelog/update-jetpack-2754-base-styles-direct-imports b/projects/packages/publicize/changelog/update-jetpack-2754-base-styles-direct-imports new file mode 100644 index 000000000000..379fc714685a --- /dev/null +++ b/projects/packages/publicize/changelog/update-jetpack-2754-base-styles-direct-imports @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Import @wordpress/base-styles modules directly instead of through the jetpack-base-styles wrapper. No change to the built CSS. + +