Skip to content

Commit 6561a2e

Browse files
committed
CIAB: Add configurable font styles for partner branding
Extends the partner branding system to support custom font styles on login/signup pages. Partners can now specify a fontStyle in their config to override the default heading font.
1 parent 000b595 commit 6561a2e

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

client/layout/logged-out.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import {
3030
isAndroidOAuth2Client,
3131
isIosOAuth2Client,
3232
} from 'calypso/lib/oauth2-clients';
33+
import { usePartnerBranding } from 'calypso/lib/partner-branding';
3334
import { createAccountUrl } from 'calypso/lib/paths';
3435
import isReaderTagEmbedPage from 'calypso/lib/reader/is-reader-tag-embed-page';
3536
import { getOnboardingUrl as getPatternLibraryOnboardingUrl } from 'calypso/my-sites/patterns/paths';
@@ -90,6 +91,7 @@ const LayoutLoggedOut = ( {
9091
const isLoggedIn = useSelector( isUserLoggedIn );
9192
const currentRoute = useSelector( getCurrentRoute );
9293
const loggedInAction = useSelector( getLastActionRequiresLogin );
94+
const { ciabConfig } = usePartnerBranding();
9395

9496
const stepContainerV2Context = useMemo( () => {
9597
// Detect CIAB dashboard for Woo branding.
@@ -166,6 +168,7 @@ const LayoutLoggedOut = ( {
166168
'is-wpcom-magic-login': isWpcomMagicLogin,
167169
'is-woo-passwordless': isWoo,
168170
'is-blaze-pro': isBlazePro,
171+
'is-ciab-font-system': ciabConfig?.fontStyle === 'system',
169172
'two-factor-auth-enabled': twoFactorEnabled,
170173
'is-woo-com-oauth': isWooOAuth2Client( oauth2Client ),
171174
woo: isWoo,

client/lib/partner-branding.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ export interface CiabPartnerConfig {
3333
compactLogo?: LogoConfig;
3434
/** SSO providers to show (in order). Others will be hidden. */
3535
ssoProviders: string[];
36+
/** Font style identifier for login/signup headings */
37+
fontStyle?: 'system';
3638
}
3739

3840
/**
@@ -61,6 +63,7 @@ export const CIAB_PARTNERS: Record< string, CiabPartnerConfig > = {
6163
height: 24,
6264
},
6365
ssoProviders: [ 'paypal', 'google', 'apple', 'magic-login' ],
66+
fontStyle: 'system',
6467
},
6568
};
6669

client/login/wp-login/style.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ body.is-section-login {
5656
}
5757
}
5858
/* End: Jetpack Cloud font styles for login page */
59+
60+
/* Start: CIAB partner branding font styles for login page */
61+
&.is-ciab-font-system {
62+
.wp-login__one-login-layout-heading-text {
63+
font-family: $default-font;
64+
}
65+
}
66+
/* End: CIAB partner branding font styles for login page */
5967
}
6068

6169
.wp-login__main {

0 commit comments

Comments
 (0)