TransWikia.com

Magento2 How to use custom fonts in Homepage

Magento Asked by Sanjay Shiyal on December 14, 2021

Does anyone suggest me how i can use custom fonts in my magento website ?
I want to use "Red Rose" Google Fonts.

i already download that font family and upload to my theme file

"app/design/frontend/Vendor/Theme/fonts/"

Folder

now which steps i need to follow ?

One Answer

1.Add font files to your local theme directory. For example, app/design/frontend/<your_vendor_name>/<your_theme_name>/web/fonts.

2.If you build a theme using the Magento UI library, declare the font by adding the .lib-font-face mixin to the app/design/frontend/<your_vendor_name>/<your_theme_name>/web/css/source/_typography.less file:

.lib-font-face(
    @family-name:'<any_font_name>',
    @font-path: '@{baseDir}fonts/<path_to_font_file>',
    @font-weight: <font_weight>,
    @font-style: <font_style>
    @font-display: <auto|block|fallback|option|swap>
);

You should get detailed steps here https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/css-topics/using-fonts.html

Answered by Sejal Shah on December 14, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP