cancel
Showing results for 
Search instead for 
Did you mean: 

Custom CSS in Magento 2

SOLVED

Custom CSS in Magento 2

Which commands should I run after adding new CSS in Magento 2 ?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Custom CSS in Magento 2

Hi @foysal

 

Yes - when you change anything in CSS and JS file then you required to run this commands !

 

For second question i would suggest you to refer this link - https://magento.stackexchange.com/questions/217131/load-custom-css-after-style-l-css-for-home-page

 

It might helps you for the same !

 

Hope it helps 

if issue solved,Click Kudos & Accept as Solution

View solution in original post

6 REPLIES 6

Re: Custom CSS in Magento 2

Hi @foysal

 

You will required to run below commands in a sequence : 

 

php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento cache:clean
php bin/magento cache:flush

Hope it helps !

if issue solved,Click Kudos & Accept as Solution

Re: Custom CSS in Magento 2

@Manthan DaveShould I run all these commands after every change ?

 

How to load a stylesheet at the end of all stylesheet ?

Re: Custom CSS in Magento 2

Hi @foysal

 

Yes - when you change anything in CSS and JS file then you required to run this commands !

 

For second question i would suggest you to refer this link - https://magento.stackexchange.com/questions/217131/load-custom-css-after-style-l-css-for-home-page

 

It might helps you for the same !

 

Hope it helps 

if issue solved,Click Kudos & Accept as Solution

Re: Custom CSS in Magento 2

@Manthan Dave, What are the benefits of using `developer` mode ?

Re: Custom CSS in Magento 2

Hi @foysal

 

Main benefits of developer mode is - you can able to see ERRORS on the browser.

 

In Default or production mode - errors is logged in the var/log directory and on the browser you will not able to see those errors.

 

In developer mode static view file caching is also disabled and automatic code compilation can be done for the same.

 

For more details refer this link - https://devdocs.magento.com/guides/v2.2/config-guide/bootstrap/magento-modes.html

 

Hope it helps !

if issue solved,Click Kudos & Accept as Solution

Re: Custom CSS in Magento 2

!

if issue solved,Click Kudos & Accept as Solution