- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Magento 2 - Add custom CSS
I working with a pre-built theme from argentotheme.com. It is the argento-stripes theme. The theme is installed in the /vendor/swissup/theme-frontend-argento-stripes folder. I am trying to add custom CSS. I have been able to add a custom css file under the theme folders. However, I really don't want that in case the theme gets updated, etc. Therefore, I am attempting to add the custom css under the /app folder structure. I created the same folders (/app/design/frontend/Swissup/theme-frontend-argento-stripes/web/css) for the css file and created the same default_head_blocks.html in the (/app/design/frontend/Swissup/theme-frontend-argento-stripes/Magento_Theme/layout) folder to include the css file. However, the css file never gets included on the site.
Any help in figuring out what is wrong would be greatly appreciated.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Magento 2 - Add custom CSS
Hi,
You should include your HTML file(default_head_blocks.html) in the (/app/design/frontend/Swissup/theme-frontend-argento-stripes/Magento_Theme/template) folder to include the css file.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Magento 2 - Add custom CSS
Hello @ubcomputers
The correct approach is always to create your own custom theme which will be child of your purchased theme, put your theme inside app/design/frontend and extend those files with same folder path.
Benefits :
1. your custom work will not mis-match with theme.
2. in-case you want to check or change the actual theme design, you can simply switch to your purchased theme.
Hope it helps !
