$95 GRAYBYTE WORDPRESS FILE MANAGER $50

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.217.254 | ADMIN IP 216.73.216.157
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/home/bravrvjk/dantho.rw/wp-content/plugins/extendify/src/Launch/lib/

HOME
Current File : /home/bravrvjk/dantho.rw/wp-content/plugins/extendify/src/Launch/lib//preview-helpers.js
const FONT_VAR_PREFIX = '--wp--preset--font-family';
const HEADING_FONT_VAR_KEY = '--wp--preset--font-family--heading';
const BODY_FONT_VAR_KEY = '--wp--preset--font-family--body';

// Generates font links and styles from custom variations to override fonts in `theme-processed.json`
export const getFontOverrides = (variation) => {
	let customFontLinks = '';
	let fontOverrides = '';

	if (!variation?.title) {
		return { customFontLinks, fontOverrides };
	}

	// These values look like `var(--wp--preset--font-family--${fontFamilySlug})`
	const headingFontVarValue =
		variation.styles?.elements?.heading?.typography?.fontFamily;
	const bodyFontVarValue = variation.styles?.typography?.fontFamily;
	const customFonts =
		variation.settings?.typography?.fontFamilies?.custom ?? [];

	if (headingFontVarValue) {
		fontOverrides += `:root { ${HEADING_FONT_VAR_KEY}: ${headingFontVarValue}; }`;
		fontOverrides += `h1, h2, h3, h4, h5, h6 { font-family: ${headingFontVarValue} !important; }`;
	}

	if (bodyFontVarValue) {
		fontOverrides += `:root { ${BODY_FONT_VAR_KEY}: ${bodyFontVarValue}; }`;
		fontOverrides += `body { font-family: ${bodyFontVarValue} !important; }`;
	}

	for (const font of customFonts) {
		const customFontLink = `<link id="ext-custom-font-${font.slug}" rel="stylesheet" href="${font.css}">`;
		if (!customFontLinks.includes(customFontLink)) {
			customFontLinks += customFontLink;
		}

		const fontOverride = `:root { ${FONT_VAR_PREFIX}--${font.slug}: "${font.fontFamily}"; }`;
		if (!fontOverrides.includes(fontOverride)) {
			fontOverrides += fontOverride;
		}
	}

	return { customFontLinks, fontOverrides };
};


Current_dir [ WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
6 Nov 2025 10.43 AM
bravrvjk / bravrvjk
0755
__tests__
--
6 Nov 2025 10.43 AM
bravrvjk / bravrvjk
0755
blocks.js
0.15 KB
27 Aug 2025 5.47 PM
bravrvjk / bravrvjk
0644
fonts-helpers.js
1.906 KB
4 Aug 2025 7.41 PM
bravrvjk / bravrvjk
0644
linkPages.js
6.398 KB
12 May 2025 4.42 PM
bravrvjk / bravrvjk
0644
logo.js
1.3 KB
12 May 2025 4.42 PM
bravrvjk / bravrvjk
0644
pages.js
2.228 KB
16 Jul 2025 7.39 PM
bravrvjk / bravrvjk
0644
preview-helpers.js
1.598 KB
4 Feb 2025 12.18 AM
bravrvjk / bravrvjk
0644
util.js
1.805 KB
12 May 2025 4.42 PM
bravrvjk / bravrvjk
0644
wp.js
10.427 KB
15 Sep 2025 11.30 PM
bravrvjk / bravrvjk
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF