Magento 2 : Menambahkan Custom File CSS

Menambahkan file-file css yang kita buat sendiri pada Magento 2.

Buat file namafilecss.css, misalkan andhiirawan.css

di  

app / design / frontend / [vendor] / [theme] / web / css / andhiirawan.css

kemudian tambahkan file tersebut pada head block :

app / design / frontend / [vendor] / [theme] / Magento_Theme / layout / default_head_blocks.xml

contoh

<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. 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>
        <meta name="viewport" content="width=device-width, initial-scale=1"/>
        <font src="fonts/sfuidisplay/light/sf-ui-display-light.woff2"/>
        <font src="fonts/sfuidisplay/medium/sf-ui-display-medium.woff2"/>
        <font src="fonts/sfuidisplay/semibold/sf-ui-display-semibold.woff2"/>
        <font src="fonts/sfuidisplay/bold/sf-ui-display-bold.woff2"/>
        <font src="fonts/apl-icons/fonts/apl.woff2"/>
        <remove src="fonts/opensans/light/opensans-300.woff2"/>
        <remove src="fonts/opensans/regular/opensans-400.woff2"/>
        <remove src="fonts/opensans/semibold/opensans-600.woff2"/>
        <remove src="fonts/opensans/bold/opensans-700.woff2"/>
        <remove src="fonts/Luma-Icons.woff2"/>
        <css src="css/andhiirawan.css" />
    </head>
</page>

jalankan static deploy :

php bin/magento setup:static-content:deploy

 

About air

Leave a Reply

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