cancel
Showing results for 
Search instead for 
Did you mean: 

Why can't I make CSS changes?

Why can't I make CSS changes?

Hi everyone,

 

I am running Magento 2.2.6 on 'default' mode and have created a child theme of Luma and have been trying to make various changes with CSS but I can't seem to get the file to save and compile the change. What am I doing wrong?

 

I have two CSS files in 'app/design/frontend/JMC/luma_child/web/css/source/' called: _extends.less and _theme.less. The change I am trying to make is:

 

header {
	&.page-header {
		background-color: #000000;
	}
}

I added the above CSS to the bottom of the _extends.less file, save it and then click "Flush Static Files Cache" but nothing happens? Please help!

 

Kind regards,

Dan

 

4 REPLIES 4

Re: Why can't I make CSS changes?

Hello @DAWS96 

 

I suggest you to run these commands in the Magento root directory.

 

sudo rm -Rf pub/static/frontend/* pub/static/_requirejs/*
sudo php bin/magento setup:static-content:deploy -f
sudo php bin/magento cache:clean
sudo php bin/magento cache:flush
sudo chmod -R 777 var/ pub/ generated/

I hope it will help you.

 

Thanks

--
If my answer is useful, please Accept as Solution & give Kudos

Re: Why can't I make CSS changes?

Hello @DAWS96 ,

 

Can you please make developer mode setup on server? If not then please run below command

php bin/magento deploy:mode:set developer

After setup developer mode, Please run below static content deploy command

rm -rf pub/static/frontend/* pub/static/adminhtml/* var/cache/ var/generation/ var/page_cache/ var/view_preprocessed/ var/composer_home generated/
php -dmemory_limit=6G bin/magento setup:static-content:deploy -f
chmod -Rf 777 pub/ var/ generated/

Let me know if you still getting issue.

 

 


--
If my answer is useful, please Accept as Solution & give Kudos

 

Re: Why can't I make CSS changes?

Hi,

 

You need to set the deploy mode to developer(even you already have developer mode) , run the following commands:

php bin/magento deploy:mode:set developer
php bin/magento setup:upgrade
php bin/magento cache:flush

If my answer is useful, please Accept as Solution & give Kudos

Re: Why can't I make CSS changes?

Hi @gelanivishal,

 

I executed both commands and now I have the following errors on my website:

Capture.PNG

Please help.

 

Thanks,

Dan