Skip to content

sass: Use @wordpress/base-styles as a module #43607

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

sass: Remove unnecessary `@import` of `@wordpress/base-styles`.
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@import "@wordpress/base-styles/colors";

.ai-assistant-feedback {

&__selection {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: changed

sass: Convert `@automattic/jetpack-base-styles/gutenberg-base-styles` to modules format.
12 changes: 6 additions & 6 deletions projects/js-packages/base-styles/gutenberg-base-styles.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import '@wordpress/base-styles/z-index';
@import '@wordpress/base-styles/colors';
@import '@wordpress/base-styles/variables';
@import '@wordpress/base-styles/breakpoints';
@import '@wordpress/base-styles/mixins';
@import '@wordpress/base-styles/animations';
@forward '@wordpress/base-styles/z-index';
@forward '@wordpress/base-styles/colors';
@forward '@wordpress/base-styles/variables';
@forward '@wordpress/base-styles/breakpoints';
@forward '@wordpress/base-styles/mixins';
@forward '@wordpress/base-styles/animations';
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

sass: `@use` rather than `@import` for `@automattic/jetpack-base-styles/gutenberg-base-styles`.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '@automattic/jetpack-base-styles/gutenberg-base-styles';
@use '@automattic/jetpack-base-styles/gutenberg-base-styles' as gb;
@import '@automattic/jetpack-base-styles/root-variables';

.dot-pager {
Expand All @@ -13,7 +13,7 @@
opacity: 1;
visibility: visible;

@include reduce-motion( "transition" );
@include gb.reduce-motion( "transition" );
}

.dot-pager__controls {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '@automattic/jetpack-base-styles/gutenberg-base-styles';
@use '@automattic/jetpack-base-styles/gutenberg-base-styles' as gb;

.global-notices {

Expand All @@ -10,14 +10,14 @@
// Modals have 100000, so this needs to be above them
z-index: 100001;

@include break-small {
@include gb.break-small {
width: auto;
inset-inline: unset; // left and right
inset-block-start: 4rem;
inset-inline-end: 1rem;
}

@include break-medium {
@include gb.break-medium {
inset-block-start: 3rem;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '@automattic/jetpack-base-styles/gutenberg-base-styles';
@use '@automattic/jetpack-base-styles/gutenberg-base-styles' as gb;

.star-icon {
fill: #000;
Expand All @@ -10,7 +10,7 @@
}

.socialIcon {
fill: $gray-700;
fill: gb.$gray-700;

&.bluesky {
fill: var( --color-bluesky );
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '@automattic/jetpack-base-styles/gutenberg-base-styles';
@use '@automattic/jetpack-base-styles/gutenberg-base-styles' as gb;

.swipeable__container {
width: 100%;
Expand All @@ -19,7 +19,7 @@
transition: all 0.5s ease-in-out;
transition-property: transform, height;

@include reduce-motion( "transition" );
@include gb.reduce-motion( "transition" );
}

.swipeable__page {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

sass: `@use` rather than `@import` for `@wordpress/base-styles`.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@import '@wordpress/base-styles/breakpoints';
@import '@wordpress/base-styles/mixins';
@use '@wordpress/base-styles/breakpoints';

.jp-connection__connect-screen {
--spacing-base: 8px;
Expand Down Expand Up @@ -33,7 +32,7 @@
color: hsla( 0, 0%, 100%, 0.4 );
}

@media ( max-width: $break-medium ) {
@media ( max-width: breakpoints.$break-medium ) {
max-width: none;
width: 100%;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@import '@wordpress/base-styles/breakpoints';
@import '@wordpress/base-styles/mixins';
@use '@wordpress/base-styles/mixins';
@import '@automattic/jetpack-base-styles/style';

.jp-connection__connect-screen-layout {
Expand All @@ -18,7 +17,7 @@
&__left {
padding: calc(var(--spacing-base) * 3);

@include break-small {
@include mixins.break-small {
padding: 64px 96px;
}

Expand Down Expand Up @@ -106,7 +105,7 @@
flex-grow: 1;
flex-basis: 100%;

@include break-xlarge {
@include mixins.break-xlarge {
flex-basis: 52%;
}
}
Expand All @@ -117,7 +116,7 @@
background: #F9F9F6;
display: none;

@include break-xlarge {
@include mixins.break-xlarge {
display: block;
}
}
Expand All @@ -140,7 +139,7 @@
margin-top: 24px;
}

@include break-small {
@include mixins.break-small {
padding: 4rem 6rem 4rem 4rem;
}
}
Expand All @@ -151,7 +150,7 @@
* and mirror 96px horizontal padding seen in
* .jp-connection__connect-screen-layout__left
*/
@include break-xlarge {
@include mixins.break-xlarge {
position: absolute;
top: calc(var(--spacing-base) * 9.25);
right: calc(var(--spacing-base) * -45);
Expand All @@ -166,7 +165,7 @@
margin-top: 0.625rem;
}

@include break-large {
@include mixins.break-large {
padding: 3rem;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@import '@wordpress/base-styles/breakpoints';
@import '@wordpress/base-styles/mixins';
@use '@wordpress/base-styles/mixins';

.jp-connection__connect-screen-layout__left {

Expand All @@ -8,14 +7,14 @@
* then account for a 384px pricing card that floats to the right;
* finally give 32px of padding between content and the pricing card
*/
@include break-xlarge {
@include mixins.break-xlarge {
width: calc(100% - 384px - var(--spacing-base) * 4);
}
}

.jp-connection__connect-screen-required-plan {

@include break-xlarge {
@include mixins.break-xlarge {
position: relative;
background: linear-gradient(to right, #fff 70%, #f9f9f6 30%);
}
Expand All @@ -38,7 +37,7 @@
* and mirror 96px horizontal padding seen in
* .jp-connection__connect-screen-layout__left
*/
@include break-xlarge {
@include mixins.break-xlarge {
position: absolute;
top: calc(var(--spacing-base) * 8);
right: calc(var(--spacing-base) * 12);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

sass: `@use` rather than `@import` for `@wordpress/base-styles`.
7 changes: 3 additions & 4 deletions projects/js-packages/idc/components/idc-screen/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@import '@wordpress/base-styles/breakpoints';
@import '@wordpress/base-styles/mixins';
@use '@wordpress/base-styles/mixins';

.jp-idc__idc-screen {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
Expand All @@ -16,7 +15,7 @@
border-color: #069e08;
}

@include break-small {
@include mixins.break-small {
padding: 48px;
}

Expand Down Expand Up @@ -101,7 +100,7 @@
margin: 24px 0;
box-sizing: border-box;

@include break-small {
@include mixins.break-small {
padding: 24px;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

sass: `@use` rather than `@import` for `@wordpress/base-styles`.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@import '@wordpress/base-styles/breakpoints';
@import '@wordpress/base-styles/mixins';
@use '@wordpress/base-styles/mixins';
@import '@automattic/jetpack-base-styles/style';

.jetpack-redeem-partner-coupon-post-connection {
Expand All @@ -21,7 +20,7 @@

&__layout {

@include break-medium {
@include mixins.break-medium {
display: grid;
grid-template-columns: auto 34%;
grid-template-areas:
Expand All @@ -33,22 +32,22 @@
&__content {
padding: 32px 24px 24px 24px;

@include break-medium {
@include mixins.break-medium {
padding: 48px 48px 0 48px;
}
}

&__subcontent {
padding: 24px;

@include break-medium {
@include mixins.break-medium {
padding: 0 48px 48px 48px;
}

> p:first-child {
margin-top: 0;

@include break-medium {
@include mixins.break-medium {
margin-top: 1em;
}
}
Expand All @@ -63,15 +62,15 @@
background-size: cover;
background-position: center;

@include break-medium {
@include mixins.break-medium {
grid-area: aside;
padding: 0;
}

img {
width: 90px;

@include break-medium {
@include mixins.break-medium {
width: auto;
}
}
Expand All @@ -87,7 +86,7 @@
> * + * {
margin-left: 8px;

@include break-mobile {
@include mixins.break-mobile {
margin-left: 16px;
}
}
Expand Down Expand Up @@ -128,7 +127,7 @@
button {
width: 100%;

@include break-medium {
@include mixins.break-medium {
width: auto;
}
}
Expand All @@ -141,23 +140,23 @@
align-items: center;
margin-top: 32px;

@include break-medium {
@include mixins.break-medium {
justify-content: left;
}

@include break-xlarge {
@include mixins.break-xlarge {
flex-wrap: nowrap;
}

> div {
flex: 1 0 100%;
text-align: center;

@include break-medium {
@include mixins.break-medium {
text-align: left;
}

@include break-xlarge {
@include mixins.break-xlarge {
flex: 0 0 auto;
}
}
Expand All @@ -178,7 +177,7 @@
text-decoration: none;
}

@include break-xlarge {
@include mixins.break-xlarge {
margin: 0 0 0 24px;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

sass: `@use` rather than `@import` for `@automattic/jetpack-base-styles/gutenberg-base-styles`.
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@import '@automattic/jetpack-base-styles/gutenberg-base-styles';

.wrapper {
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -131,4 +129,4 @@
flex-direction: column;
gap: 0.5rem;
flex: 1;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '@automattic/jetpack-base-styles/gutenberg-base-styles';
@use '@automattic/jetpack-base-styles/gutenberg-base-styles' as gb;

.components-connection-toggle {
position: relative;
Expand All @@ -14,7 +14,7 @@
}

.jetpack-publicize-gutenberg-social-icon {
fill: $gray-600;
fill: gb.$gray-600;
filter: saturate(0);
}
}
Expand Down
Loading
Loading