From fedaf5b6c2901b744cc626e8728678494efe59d5 Mon Sep 17 00:00:00 2001 From: Xavier Lozano Carreras Date: Thu, 29 Oct 2026 16:44:09 +0100 Subject: [PATCH] Import @wordpress/base-styles modules directly in packages/forms 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 --- ...ate-jetpack-2754-base-styles-direct-imports | 5 +++++ .../forms/src/blocks/contact-form/editor.scss | 18 ++++++++++-------- .../forms/src/blocks/field-hidden/editor.scss | 4 ++-- .../src/blocks/field-image-select/style.scss | 4 ++-- .../forms/src/blocks/form-step/editor.scss | 11 ++++++----- .../src/contact-form/css/phone-field.scss | 6 +++--- .../form-editor/plugins/header-actions.scss | 4 ++-- .../src/form-editor/welcome-guide/style.scss | 4 ++-- 8 files changed, 32 insertions(+), 24 deletions(-) create mode 100644 projects/packages/forms/changelog/update-jetpack-2754-base-styles-direct-imports diff --git a/projects/packages/forms/changelog/update-jetpack-2754-base-styles-direct-imports b/projects/packages/forms/changelog/update-jetpack-2754-base-styles-direct-imports new file mode 100644 index 000000000000..379fc714685a --- /dev/null +++ b/projects/packages/forms/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. + + diff --git a/projects/packages/forms/src/blocks/contact-form/editor.scss b/projects/packages/forms/src/blocks/contact-form/editor.scss index bb2e5337e22b..6982c56bb83f 100644 --- a/projects/packages/forms/src/blocks/contact-form/editor.scss +++ b/projects/packages/forms/src/blocks/contact-form/editor.scss @@ -1,4 +1,6 @@ -@use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb; +@use "@wordpress/base-styles/breakpoints"; +@use "@wordpress/base-styles/mixins"; +@use "@wordpress/base-styles/variables"; @use "../shared/styles/field-hints" as *; :where(.jetpack-contact-form) { @@ -174,7 +176,7 @@ flex: 1 1 0; } - @media (max-width: #{ (gb.$break-mobile) }) { + @media (max-width: #{ (breakpoints.$break-mobile) }) { &[class*="jetpack-field__width-"] { flex-basis: 100%; @@ -311,16 +313,16 @@ .form-placeholder__patterns-modal { max-width: 1200px; - @include gb.break-small() { - width: calc(100% - #{ gb.$grid-unit-20 * 2 }); - height: calc(100% - #{ gb.$header-height * 2 }); + @include mixins.break-small() { + width: calc(100% - #{ variables.$grid-unit-20 * 2 }); + height: calc(100% - #{ variables.$header-height * 2 }); } - @include gb.break-medium() { - width: gb.$break-medium - gb.$grid-unit-20 * 2; + @include mixins.break-medium() { + width: breakpoints.$break-medium - variables.$grid-unit-20 * 2; } - @include gb.break-large() { + @include mixins.break-large() { height: 80%; width: 80%; max-height: none; diff --git a/projects/packages/forms/src/blocks/field-hidden/editor.scss b/projects/packages/forms/src/blocks/field-hidden/editor.scss index 447cf6633145..1fa2ff836f66 100644 --- a/projects/packages/forms/src/blocks/field-hidden/editor.scss +++ b/projects/packages/forms/src/blocks/field-hidden/editor.scss @@ -1,10 +1,10 @@ -@use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb; +@use "@wordpress/base-styles/breakpoints"; .jetpack-form-hidden-field-inputs { text-wrap: pretty; } -@media (max-width: #{ (gb.$break-mobile) }) { +@media (max-width: #{ (breakpoints.$break-mobile) }) { .jetpack-form-hidden-field-inputs { flex-wrap: wrap; diff --git a/projects/packages/forms/src/blocks/field-image-select/style.scss b/projects/packages/forms/src/blocks/field-image-select/style.scss index ac6c4a999f62..347dd1299969 100644 --- a/projects/packages/forms/src/blocks/field-image-select/style.scss +++ b/projects/packages/forms/src/blocks/field-image-select/style.scss @@ -1,4 +1,4 @@ -@use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb; +@use "@wordpress/base-styles/breakpoints"; @use "../shared/styles/visually-hidden" as *; @use "../shared/styles/empty_image_option" as *; @@ -6,7 +6,7 @@ width: calc(( 1 / var(--row-options-count) ) * 100% - var(--jetpack-field-image-options-gap) * ( (var(--row-options-count) - 1) / var(--row-options-count) )); // Mobile adjustments for number of options per row - @media (max-width: #{ (gb.$break-mobile) }) { + @media (max-width: #{ (breakpoints.$break-mobile) }) { &.is-supersized { --row-options-count: 1 !important; diff --git a/projects/packages/forms/src/blocks/form-step/editor.scss b/projects/packages/forms/src/blocks/form-step/editor.scss index 194a343759bc..12768b77937b 100644 --- a/projects/packages/forms/src/blocks/form-step/editor.scss +++ b/projects/packages/forms/src/blocks/form-step/editor.scss @@ -1,7 +1,8 @@ /** * Editor styles for the form-step block */ -@use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb; +@use "@wordpress/base-styles/colors"; +@use "@wordpress/base-styles/variables"; .jetpack-form-step__break { display: flex; @@ -20,15 +21,15 @@ } .jetpack-form-step__label { - background-color: var(--wp-components-color-background, gb.$white); - color: var(--wp-components-color-foreground, gb.$gray-900); + background-color: var(--wp-components-color-background, colors.$white); + color: var(--wp-components-color-foreground, colors.$gray-900); font-size: var(--wp--preset--font-size--normal, 16px); padding: 0 calc(var(--wp--style--block-gap, 1.5rem) * 0.5); - border-radius: var(--wp--preset--spacing--20, gb.$radius-medium); + border-radius: var(--wp--preset--spacing--20, variables.$radius-medium); font-weight: var(--wpds-typography-font-weight-emphasis); white-space: nowrap; margin: 0 8px; - font-family: gb.$default-font; + font-family: variables.$default-font; } } diff --git a/projects/packages/forms/src/contact-form/css/phone-field.scss b/projects/packages/forms/src/contact-form/css/phone-field.scss index 2eeaca1e6c2a..eef637b87ab0 100644 --- a/projects/packages/forms/src/contact-form/css/phone-field.scss +++ b/projects/packages/forms/src/contact-form/css/phone-field.scss @@ -1,4 +1,4 @@ -@use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb; +@use "@wordpress/base-styles/breakpoints"; // grunion-field-wrap is a backwards compat class, //need to remove this generic classes // *-wrap classes are helpers added by backend @@ -36,9 +36,9 @@ text-overflow: ellipsis; white-space: nowrap; - @media (max-width: #{ (gb.$break-mobile) }) { + @media (max-width: #{ (breakpoints.$break-mobile) }) { - max-width: calc(gb.$break-mobile / 3); + max-width: calc(breakpoints.$break-mobile / 3); } } } diff --git a/projects/packages/forms/src/form-editor/plugins/header-actions.scss b/projects/packages/forms/src/form-editor/plugins/header-actions.scss index a2d38658a45e..c6212e1fe096 100644 --- a/projects/packages/forms/src/form-editor/plugins/header-actions.scss +++ b/projects/packages/forms/src/form-editor/plugins/header-actions.scss @@ -1,4 +1,4 @@ -@use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb; +@use "@wordpress/base-styles/mixins"; /* * `@wordpress/interface` hides pinned items on narrow viewports so the list @@ -10,7 +10,7 @@ .jetpack-form-header-actions__view-responses { display: none; - @include gb.break-small() { + @include mixins.break-small() { display: inline-flex; } } diff --git a/projects/packages/forms/src/form-editor/welcome-guide/style.scss b/projects/packages/forms/src/form-editor/welcome-guide/style.scss index e0b246e2f699..038e8a8be00a 100644 --- a/projects/packages/forms/src/form-editor/welcome-guide/style.scss +++ b/projects/packages/forms/src/form-editor/welcome-guide/style.scss @@ -1,4 +1,4 @@ -@use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb; +@use "@wordpress/base-styles/mixins"; // Wider than the core block editor welcome guide's 312px, to give the // artwork more room. Core caps the frame at `calc(100vw - 32px)` below @@ -18,7 +18,7 @@ // against an auto-height parent, so it resolves to nothing. Scoped to // break-small and up, matching where core applies the guide's own // min-height, so narrow screens can still shrink to fit. - @include gb.break-small() { + @include mixins.break-small() { .components-guide__container { min-block-size: 496px;