Remove Google Fonts CDN dependencies

- Update templateDetails.xml to use local font CSS files only
- Add Noto Sans and Fira Sans as local font options
- Remove Google Fonts CDN preconnect links from index.php
- Remove Google Fonts CDN preconnect links from component.php
- Remove Google Fonts CDN preconnect link from offline.php

Co-authored-by: jmiller-moko <230051081+jmiller-moko@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-07 20:43:39 +00:00
parent 6130302312
commit 34057518c8
4 changed files with 5 additions and 12 deletions

View File

@@ -123,8 +123,6 @@ $fontStyles = '';
if ($params_FontScheme) { if ($params_FontScheme) {
if (stripos($params_FontScheme, 'https://') === 0) { if (stripos($params_FontScheme, 'https://') === 0) {
$this->getPreloadManager()->preconnect('https://fonts.googleapis.com/', ['crossorigin' => 'anonymous']);
$this->getPreloadManager()->preconnect('https://fonts.gstatic.com/', ['crossorigin' => 'anonymous']);
$this->getPreloadManager()->preload($params_FontScheme, ['as' => 'style', 'crossorigin' => 'anonymous']); $this->getPreloadManager()->preload($params_FontScheme, ['as' => 'style', 'crossorigin' => 'anonymous']);
$wa->registerAndUseStyle('fontscheme.current', $params_FontScheme, [], [ $wa->registerAndUseStyle('fontscheme.current', $params_FontScheme, [], [
'media' => 'print', 'media' => 'print',

View File

@@ -149,8 +149,6 @@ $fontStyles = '';
if ($params_FontScheme) { if ($params_FontScheme) {
if (stripos($params_FontScheme, 'https://') === 0) { if (stripos($params_FontScheme, 'https://') === 0) {
$this->getPreloadManager()->preconnect('https://fonts.googleapis.com/', ['crossorigin' => 'anonymous']);
$this->getPreloadManager()->preconnect('https://fonts.gstatic.com/', ['crossorigin' => 'anonymous']);
$this->getPreloadManager()->preload($params_FontScheme, ['as' => 'style', 'crossorigin' => 'anonymous']); $this->getPreloadManager()->preload($params_FontScheme, ['as' => 'style', 'crossorigin' => 'anonymous']);
$wa->registerAndUseStyle('fontscheme.current', $params_FontScheme, [], [ $wa->registerAndUseStyle('fontscheme.current', $params_FontScheme, [], [
'media' => 'print', 'media' => 'print',

View File

@@ -135,7 +135,6 @@ if (class_exists('\Joomla\Component\Users\Site\Helper\RouteHelper')) {
<head> <head>
<jdoc:include type="head" /> <jdoc:include type="head" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<?php if ($params_theme_enabled) : ?> <?php if ($params_theme_enabled) : ?>
<script> <script>

View File

@@ -198,17 +198,15 @@
<!-- Typography --> <!-- Typography -->
<field name="theme_sep_typo" type="spacer" label="Typography" hr="false" class="text fw-bold" /> <field name="theme_sep_typo" type="spacer" label="Typography" hr="false" class="text fw-bold" />
<field name="useFontScheme" type="groupedlist" label="TPL_MOKOCASSIOPEIA_FONT_LABEL" description="TPL_MOKOCASSIOPEIA_FONT_LABEL_DESC" default="media/templates/site/mokocassiopeia/css/colors/fonts-local_roboto.css"> <field name="useFontScheme" type="groupedlist" label="TPL_MOKOCASSIOPEIA_FONT_LABEL" description="TPL_MOKOCASSIOPEIA_FONT_LABEL_DESC" default="media/templates/site/mokocassiopeia/css/fonts/roboto.css">
<option value="0">JNONE</option> <option value="0">JNONE</option>
<group label="TPL_MOKOCASSIOPEIA_FONT_GROUP_LOCAL"> <group label="TPL_MOKOCASSIOPEIA_FONT_GROUP_LOCAL">
<option value="media/templates/site/mokocassiopeia/css/colors/fonts-local_roboto.css">Roboto (local)</option> <option value="media/templates/site/mokocassiopeia/css/fonts/roboto.css">Roboto (local)</option>
</group> <option value="media/templates/site/mokocassiopeia/css/fonts/noto-sans.css">Noto Sans (local)</option>
<group label="TPL_MOKOCASSIOPEIA_FONT_GROUP_WEB"> <option value="media/templates/site/mokocassiopeia/css/fonts/fira-sans.css">Fira Sans (local)</option>
<option value="https://fonts.googleapis.com/css2?family=Fira+Sans:wght@100;300;400;700&amp;display=swap">Fira Sans (web)</option>
<option value="https://fonts.googleapis.com/css2?family=Noto+Sans:wght@100;300;400;700&amp;family=Roboto:wght@100;300;400;700&amp;display=swap">Roboto + Noto Sans (web)</option>
</group> </group>
</field> </field>
<field name="noteFontScheme" type="note" description="TPL_MOKOCASSIOPEIA_FONT_NOTE_TEXT" class="alert alert-warning" /> <field name="noteFontScheme" type="note" description="TPL_MOKOCASSIOPEIA_FONT_NOTE_TEXT" class="alert alert-info" />
<!-- Branding & Icons --> <!-- Branding & Icons -->
<field name="theme_sep_brand" type="spacer" label="Branding &amp; Icons" hr="false" class="text fw-bold" /> <field name="theme_sep_brand" type="spacer" label="Branding &amp; Icons" hr="false" class="text fw-bold" />