I have to add new css file for custom theme in magento 2. will anyone please tell me how to add.
1 Answer
Follow the below steps
Extend your default_head_blocks.xml at
app\design\frontend\Packagename\Themename\Magento_Theme\layout\default_head_blocks.xml
and place<?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="css/custom.css" /> </head> </page>
Add the CSS file at this path:
app\design\frontend\Packagename\Themename\web\css\custom.css
And do a static deploy
php -dmemory_limit=5G bin/magento setup:static-content:deploy
-
there is no layout folder in \app\design\frontend\Packagename\Themename\Magento_Theme\ Aug 29, 2017 at 7:45
-
-
ok thanks.. its working now. now i can add custom css. Thanks you so much Shyam and Manoj. Aug 29, 2017 at 8:31
-