Skip to content

Commit 82f2dcf

Browse files
rafaelgallaniJessBoctor
authored andcommitted
Domains: Fix discrepancy between onboarding and domain-only search (Automattic#102021)
* Fix smaller viewport * Add more alignment fixes * Many more fixes * More fixes * Manage large viewport from parent component * Restrict search bar fix to onboarding * Fix wrong gap prop * Fix smaller viewports * Fix different price order * Fix wrong margin for desktop breakpoint * Fix small bug to load initial viewport * Organize styles + general cleanup * AI take on cleanup/simplifying the style * Fix bottom style for explanation image in smaller viewports * Add balance to text-wrap to avoid orphan words in last line * Move anti-aliasing to a more suitable location * Sync example prompt styles * Fix search element weird border radius * Remove outdated style... (2019... 🥶)
1 parent a164c24 commit 82f2dcf

File tree

4 files changed

+190
-21
lines changed

4 files changed

+190
-21
lines changed

client/components/domains/register-domain-step/style.scss

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
margin-bottom: 12px;
138138
}
139139

140-
.register-domain-step__example-prompt {
140+
.domains__step-content.domains__step-content-domain-step .register-domain-step.register-domain-step__signup .register-domain-step__example-prompt {
141141
font-size: 0.875rem;
142142
line-height: 20px;
143143
color: var(--studio-gray-40);
@@ -149,14 +149,10 @@
149149
margin: 0 20px;
150150
}
151151

152-
svg {
152+
svg:first-child {
153153
fill: #a7aaad;
154154
margin-right: 13px;
155155
}
156-
157-
@include break-xlarge {
158-
margin: 0;
159-
}
160156
}
161157

162158
.register-domain-step__placeholder.empty-content {

client/components/domains/side-explainer/style.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
/* stylelint-disable-next-line declaration-property-unit-allowed-list */
3131
line-height: 1.625rem;
3232
color: var(--studio-gray-90);
33+
text-wrap: balance;
3334
}
3435

3536
.side-explainer__subtitle {

client/signup/steps/domains/index.jsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
Step,
1212
} from '@automattic/onboarding';
1313
import { withShoppingCart } from '@automattic/shopping-cart';
14+
import { subscribeIsWithinBreakpoint, isWithinBreakpoint } from '@automattic/viewport';
1415
import { getQueryArg } from '@wordpress/url';
1516
import clsx from 'clsx';
1617
import { localize } from 'i18n-calypso';
@@ -171,6 +172,7 @@ export class RenderDomainsStep extends Component {
171172
checkDomainAvailabilityPromises: [],
172173
removeDomainTimeout: 0,
173174
addDomainTimeout: 0,
175+
isDesktopViewport: false,
174176
};
175177
}
176178

@@ -187,6 +189,7 @@ export class RenderDomainsStep extends Component {
187189
// This call is expensive, so we only do it if the mini-cart hasDomainRegistration.
188190
this.props.shoppingCartManager.addProductsToCart( [ this.props.multiDomainDefaultPlan ] );
189191
}
192+
this.subscribeToViewPortChanges();
190193
}
191194

192195
componentDidUpdate( prevProps ) {
@@ -202,6 +205,20 @@ export class RenderDomainsStep extends Component {
202205
}
203206
}
204207

208+
subscribeToViewPortChanges() {
209+
this.unsubscribeToViewPortChanges = subscribeIsWithinBreakpoint(
210+
'>=960px',
211+
( isDesktopViewport ) => this.setState( { isDesktopViewport } )
212+
);
213+
if ( isWithinBreakpoint( '>=960px' ) ) {
214+
this.setState( { isDesktopViewport: true } );
215+
}
216+
}
217+
218+
componentWillUnmount() {
219+
this.unsubscribeToViewPortChanges?.();
220+
}
221+
205222
getLocale() {
206223
return ! this.props.userLoggedIn ? this.props.locale : '';
207224
}
@@ -1438,6 +1455,7 @@ export class RenderDomainsStep extends Component {
14381455

14391456
return (
14401457
<Step.TwoColumnLayout
1458+
isLargeViewport={ this.state.isDesktopViewport }
14411459
firstColumnWidth={ 7 }
14421460
secondColumnWidth={ 3 }
14431461
topBar={ <Step.TopBar leftElement={ ! hideBack && backButton } /> }

client/signup/steps/domains/style.scss

Lines changed: 169 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
@import "@wordpress/base-styles/breakpoints";
22
@import "@wordpress/base-styles/mixins";
33
@import "@wordpress/base-styles/variables";
4+
@import "@wordpress/base-styles/colors.native";
45

6+
body {
7+
.is-section-signup, .is-section-stepper {
8+
text-rendering: optimizelegibility;
9+
-webkit-font-smoothing: antialiased;
10+
}
11+
}
512
.domains__step-section-wrapper {
613
margin: 0 auto;
714
width: 100%;
@@ -66,10 +73,6 @@ body.is-section-stepper .domains__step-content,
6673
border-radius: 0 2px 2px 0;
6774
}
6875

69-
.search-filters__dropdown-filters.search-filters__dropdown-filters--is-open {
70-
box-shadow: 0 0 0 3px var(--color-accent-light);
71-
}
72-
7376
@include breakpoint-deprecated( "<660px" ) {
7477
.register-domain-step__search-card,
7578
.search-component.is-open.has-focus {
@@ -339,6 +342,7 @@ body.is-section-signup {
339342
border-color: #646970;
340343
background: var(--color-surface);
341344
box-shadow: none;
345+
border-radius: 4px;
342346

343347
.search-component__input {
344348
background: var(--color-surface);
@@ -519,27 +523,67 @@ body.is-section-signup {
519523
.step-route.onboarding.domains:has(.step-container-v2) {
520524
padding: 0;
521525

522-
.register-domain-step__search-card {
523-
margin: 0;
526+
.register-domain-step {
527+
&__search-card {
528+
@media (min-width: 600px) {
529+
margin: 20px 20px 0;
530+
}
531+
532+
@media (min-width: 960px) {
533+
margin: 0;
534+
}
535+
}
536+
537+
&__example-prompt {
538+
margin: 0;
539+
540+
@media (min-width: 600px) {
541+
margin: 0 20px;
542+
}
543+
}
524544
}
525545

526546
.featured-domain-suggestions,
527547
.domain-suggestion {
528548
margin-inline: 0;
529-
}
530549

531-
.register-domain-step__domain-side-content-container-domain-explanation-image {
532-
max-width: 100%;
533-
margin-bottom: 0;
550+
@media (min-width: 600px) {
551+
margin-inline: 20px;
552+
553+
@media (min-width: 960px) {
554+
margin: 0;
555+
}
556+
}
534557
}
535558

536-
.register-domain-step__example-prompt {
537-
margin: 0;
559+
.featured-domain-suggestions {
560+
border-top: none;
561+
562+
@media (min-width: 600px) {
563+
margin: 0 20px;
564+
565+
@media (min-width: 960px) {
566+
margin: 0;
567+
}
568+
}
569+
570+
.featured-domain-suggestion {
571+
margin: 0;
572+
margin-bottom: 12px;
573+
}
538574
}
539575

540576
.domains__domain-side-content-container {
541577
display: flex;
542-
margin-top: 0;
578+
justify-content: center;
579+
width: 80%;
580+
align-items: center;
581+
margin: 20px auto 0;
582+
583+
@media (min-width: ($break-large)) {
584+
width: unset;
585+
margin-top: 0;
586+
}
543587
}
544588

545589
.domains__domain-side-content {
@@ -550,9 +594,119 @@ body.is-section-signup {
550594
@include break-large {
551595
max-width: 290px;
552596
}
597+
598+
@include break-large {
599+
margin-left: 40px;
600+
}
601+
602+
@include break-huge {
603+
margin-left: 60px;
604+
}
605+
606+
&.fade-out {
607+
display: none;
608+
}
553609
}
554610

555-
.domains__domain-side-content.fade-out {
556-
display: none;
611+
.step-container-v2__heading {
612+
h1:not(.small) {
613+
letter-spacing: -0.4px;
614+
/* stylelint-disable-next-line declaration-property-unit-allowed-list */
615+
line-height: 1.2em;
616+
}
617+
618+
> p {
619+
color: $gray-60;
620+
font-size: 1rem;
621+
}
622+
}
623+
}
624+
625+
.step-container-v2 {
626+
&__content.step-container-v2__content--two-column-layout.domains__step-content.domains__step-content-domain-step {
627+
gap: 0;
628+
max-width: 1280px;
629+
}
630+
631+
&__content-wrapper.padding {
632+
padding: 0 12px;
633+
gap: 0;
634+
}
635+
636+
&__heading {
637+
margin-top: 0;
638+
}
639+
}
640+
641+
.domains__step-content-domain-step > div {
642+
&:nth-child(1) {
643+
flex: 1 !important;
644+
}
645+
646+
&:nth-child(2) {
647+
display: flex;
648+
flex-basis: auto !important;
649+
flex-direction: column;
650+
flex-grow: 0 !important;
651+
flex-shrink: 1 !important;
652+
flex-wrap: nowrap;
653+
}
654+
}
655+
656+
.domain-product-price {
657+
&.domain-product-single-price.domain-product-price__domain-step-signup-flow {
658+
align-self: center;
659+
}
660+
661+
@include breakpoint-deprecated( "<660px" ) {
662+
&.domain-product-price__domain-step-signup-flow {
663+
flex-direction: column;
664+
}
665+
}
666+
}
667+
668+
.domain-suggestion__content.domain-suggestion__content-domain {
669+
align-items: unset;
670+
}
671+
672+
body.is-section-stepper {
673+
.featured-domain-suggestion.card .domain-product-price {
674+
align-items: flex-start;
675+
margin-top: 12px;
676+
}
677+
678+
.formatted-header .formatted-header__title {
679+
@media (min-width: 1080px) {
680+
font-size: 2.75rem !important;
681+
}
682+
}
683+
684+
.register-domain-step__search.register-domain-step__search-domain-step:not(.is-sticky) {
685+
@media (min-width: 661px) {
686+
padding-top: 18px;
687+
}
688+
}
689+
690+
.onboarding:not(.is-onboarding-2023-pricing-grid) .step-container-v2__heading {
691+
margin: calc(48px + 24px - var(--step-container-v2-top-bar-height)) 20px 24px 20px;
692+
display: flex;
693+
flex-wrap: wrap;
694+
justify-content: space-between;
695+
width: unset;
696+
align-items: center;
697+
flex-direction: column;
698+
699+
@media (min-width: 960px) {
700+
margin-top: calc(48px + 48px - var(--step-container-v2-top-bar-height));
701+
margin-bottom: 36px;
702+
}
703+
704+
> h1 {
705+
font-size: 2.25rem;
706+
707+
@media (min-width: 1080px) {
708+
font-size: 2.75rem;
709+
}
710+
}
557711
}
558712
}

0 commit comments

Comments
 (0)