Skip to content

zdenekzahor/webfontloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

WebFontLoader

composer require zdenekzahor/webfontloader
extensions:
    webFontLoader: ZdenekZahor\WebFontLoader\DI\WebFontLoaderExtension

webFontLoader:
    cookieName: wfont
    families:
        -
            name: Play
            weights:
                - 400
                - 700
            subsets:
                - latin
                - latin-ext
use ZdenekZahor\WebFontLoader\IWebFontLoaderFactory;
use ZdenekZahor\WebFontLoader\WebFontLoader;

/**
 * @var IWebFontLoaderFactory
 * @inject
 */
public $webFontLoaderFactory;

protected function createComponentWebFontLoader(): WebFontLoader
{
    return $this->webFontLoaderFactory->create();
}
<!DOCTYPE html>
<html class="{control webFontLoader:htmlClass}">
<head>
    {control webFontLoader:head}
</head>
html {
    font-family: sans-serif;
}

html.wf-active {
    font-family: 'Play', sans-serif;
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published