Magento 2 Using Google Fonts

In your theme folder> Magento_Theme > layout > default_head_blocks.xml

Make it look like the following replacing your Google Fonts link

<?xml version=”1.0″?>
<!–
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
–>
<page xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:framework:View/Layout/etc/page_configuration.xsd”>
<head>
<link src=”http://fonts.googleapis.com/css?family=Montserrat” src_type=”url” rel=”stylesheet” type=”text/css” />
</head>
</page>

 

Then in your web > source > _typography.less file update it to be the following

 

@import url(‘http://fonts.googleapis.com/css?family=Montserrat’);
@font-family-name__base:’Montserrat';
@font-family__base: @font-family-name__base, @font-family__sans-serif;

 

You should now have your Google font across your website

Magento | | No Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

«