Google Fonts in CSS files
Some templates and extensions load Google Fonts from inside their own CSS files, with an @import rule or with url() in an @font-face rule. With Detect In CSS Files on, the plugin finds these too.
Which CSS files are checked
The plugin checks every CSS file the page links to with a <link> tag whose address ends in .css (a version string after it, such as ?v=3, is fine), when the file is:
- on your own domain, with a full address or a path such as
/templates/mytemplate/css/template.css, and - found on the server's disk.
CSS files on other domains, such as a CDN, are not checked. CSS files that are only loaded by another CSS file with @import, and not linked in the page, are not checked either.
Inside each file, the plugin looks for addresses on fonts.googleapis.com and fonts.gstatic.com, in the same way as Addresses in the HTML.
The _elgf.css copy
When a CSS file contains Google Fonts, the plugin does not change the original. It:
- Downloads the fonts, as described in How it works.
- Saves a copy of the CSS file with the local addresses in the same folder, with
_elgfadded before.css. For exampletemplate.min.cssgets a copytemplate.min_elgf.css. - Changes the link in the page to the copy.
The copy is saved in the same folder as the original so that relative paths inside it, such as images in ../images/, keep working.
CSS files without Google Fonts get no copy, and their links are not changed.
For this, Joomla must be able to write to the folder of the CSS file. If it cannot, the page in 6.0.1 still links to the copy, which does not exist, and the styles of that file are missing. See The template looks broken after enabling the plugin.
When the original CSS file changes
The copy is made once. When the original file changes later, for example after a template update or when you edit the template's CSS, the plugin keeps using the old copy. The Clear button does not delete the copies.
To make the plugin build a new copy, delete the _elgf.css file next to the CSS file you changed. The next page view creates it again from the new original.
Find and remove the copies
The copies are next to the original CSS files, mostly in your template's folders:
media/templates/site/<template>/css/for Joomla 4 and newer templatestemplates/<template>/css/for older templates- the
mediafolders of extensions whose CSS files load Google Fonts
Look for file names that end in _elgf.css, for example with your hosting file manager. You can delete them at any time; while the plugin is enabled with Detect In CSS Files on, they are created again on the next page view.
Turn it off
If your CSS files do not load Google Fonts, you can set Detect In CSS Files to No. The plugin then does not read your CSS files at all. See Plugin options.