magento2 - how do I show css updates in production mode?












1














I've spent a few days reading complex questions and answers on this topic. I'm looking for clear instructions regarding how to make simple edits like changes to css in my magento2 site. Is it possible to do so in production mode?
At the moment, I'm unable to see changes to the css in BOTH development and production mode. I've tried editing both the style.css file in my theme, and the .less file in the theme web/css/source folder.
Running commands like



php bin/magento setup:static-content:deploy



isn't doing anything.










share|improve this question














bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • if you chnage css in development mode you d'ont need to redeploy onlye clear the cache magento and your navigator cache
    – Mohamed El Mrabet
    Nov 26 '17 at 21:00










  • checkout here magento.stackexchange.com/a/187029/54588
    – Manoj Deswal
    Nov 27 '17 at 3:48
















1














I've spent a few days reading complex questions and answers on this topic. I'm looking for clear instructions regarding how to make simple edits like changes to css in my magento2 site. Is it possible to do so in production mode?
At the moment, I'm unable to see changes to the css in BOTH development and production mode. I've tried editing both the style.css file in my theme, and the .less file in the theme web/css/source folder.
Running commands like



php bin/magento setup:static-content:deploy



isn't doing anything.










share|improve this question














bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • if you chnage css in development mode you d'ont need to redeploy onlye clear the cache magento and your navigator cache
    – Mohamed El Mrabet
    Nov 26 '17 at 21:00










  • checkout here magento.stackexchange.com/a/187029/54588
    – Manoj Deswal
    Nov 27 '17 at 3:48














1












1








1


1





I've spent a few days reading complex questions and answers on this topic. I'm looking for clear instructions regarding how to make simple edits like changes to css in my magento2 site. Is it possible to do so in production mode?
At the moment, I'm unable to see changes to the css in BOTH development and production mode. I've tried editing both the style.css file in my theme, and the .less file in the theme web/css/source folder.
Running commands like



php bin/magento setup:static-content:deploy



isn't doing anything.










share|improve this question













I've spent a few days reading complex questions and answers on this topic. I'm looking for clear instructions regarding how to make simple edits like changes to css in my magento2 site. Is it possible to do so in production mode?
At the moment, I'm unable to see changes to the css in BOTH development and production mode. I've tried editing both the style.css file in my theme, and the .less file in the theme web/css/source folder.
Running commands like



php bin/magento setup:static-content:deploy



isn't doing anything.







magento2 css






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 26 '17 at 20:47









helefa

166




166





bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.














  • if you chnage css in development mode you d'ont need to redeploy onlye clear the cache magento and your navigator cache
    – Mohamed El Mrabet
    Nov 26 '17 at 21:00










  • checkout here magento.stackexchange.com/a/187029/54588
    – Manoj Deswal
    Nov 27 '17 at 3:48


















  • if you chnage css in development mode you d'ont need to redeploy onlye clear the cache magento and your navigator cache
    – Mohamed El Mrabet
    Nov 26 '17 at 21:00










  • checkout here magento.stackexchange.com/a/187029/54588
    – Manoj Deswal
    Nov 27 '17 at 3:48
















if you chnage css in development mode you d'ont need to redeploy onlye clear the cache magento and your navigator cache
– Mohamed El Mrabet
Nov 26 '17 at 21:00




if you chnage css in development mode you d'ont need to redeploy onlye clear the cache magento and your navigator cache
– Mohamed El Mrabet
Nov 26 '17 at 21:00












checkout here magento.stackexchange.com/a/187029/54588
– Manoj Deswal
Nov 27 '17 at 3:48




checkout here magento.stackexchange.com/a/187029/54588
– Manoj Deswal
Nov 27 '17 at 3:48










5 Answers
5






active

oldest

votes


















0














Make sure you are editing the correct css/less files that are located in app/design/frontend/{vendor}/{theme}/web/css and not the ones in pub/static.



After you make changes, first flush the static files cache and refresh the page cache in Magento admin.



This works in developer mode.



enter image description here






share|improve this answer























  • is there a command to flush static file cache in production mode or do I have to manually delete the files?
    – helefa
    Nov 26 '17 at 21:13










  • @helefa I suggest doing it from admin (see edit)
    – Lez
    Nov 26 '17 at 21:17










  • according to this devdocs.magento.com/guides/v2.0/howdoi/clean_static_cache.html, it's only available in dev mode...
    – helefa
    Nov 26 '17 at 21:20










  • @helafa You are right. In my opinon you should be in developer mode if you're still making changes to your site. But if you're in production, then use rm -R pub/static/* and rm -R var/view_preprocessed/* from CLI
    – Lez
    Nov 26 '17 at 21:28





















0














You can use grunt to manage Magento tasks
http://devdocs.magento.com/guides/v2.2/frontend-dev-guide/tools/using_grunt.html



http://devdocs.magento.com/guides/v2.2/frontend-dev-guide/css-topics/css_debug.html



Then use grunt clean - this command will clean all statics file






share|improve this answer





























    0














    maybe its the client side. Your browser may cached the static files



    if you are using browser like chrome, right click, select inspect, select network, and tick checkbox disable cache



    hit refresh F5 without closing the inspect






    share|improve this answer































      0














      I recently had an issue exactly the same. I suggest you try what worked for me and Clear var/view_preprocessed directory and then redeploy using the below commands



      php bin/magento setup:static-content:deploy --language en_GB

      php bin/magento cache:clean

      php bin/magento cache:flush





      share|improve this answer































        0














        In a production mode you can use the sequence of commands below to regenerate the css files. Specially if you're using less files.



        It's not required in developer and default modes.



        rm var/view_preprocessed/* pub/static/frontend/* 
        && php bin/magento setup:static-content:deploy en_AU en_US





        share|improve this answer





















          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "479"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f203259%2fmagento2-how-do-i-show-css-updates-in-production-mode%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          5 Answers
          5






          active

          oldest

          votes








          5 Answers
          5






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Make sure you are editing the correct css/less files that are located in app/design/frontend/{vendor}/{theme}/web/css and not the ones in pub/static.



          After you make changes, first flush the static files cache and refresh the page cache in Magento admin.



          This works in developer mode.



          enter image description here






          share|improve this answer























          • is there a command to flush static file cache in production mode or do I have to manually delete the files?
            – helefa
            Nov 26 '17 at 21:13










          • @helefa I suggest doing it from admin (see edit)
            – Lez
            Nov 26 '17 at 21:17










          • according to this devdocs.magento.com/guides/v2.0/howdoi/clean_static_cache.html, it's only available in dev mode...
            – helefa
            Nov 26 '17 at 21:20










          • @helafa You are right. In my opinon you should be in developer mode if you're still making changes to your site. But if you're in production, then use rm -R pub/static/* and rm -R var/view_preprocessed/* from CLI
            – Lez
            Nov 26 '17 at 21:28


















          0














          Make sure you are editing the correct css/less files that are located in app/design/frontend/{vendor}/{theme}/web/css and not the ones in pub/static.



          After you make changes, first flush the static files cache and refresh the page cache in Magento admin.



          This works in developer mode.



          enter image description here






          share|improve this answer























          • is there a command to flush static file cache in production mode or do I have to manually delete the files?
            – helefa
            Nov 26 '17 at 21:13










          • @helefa I suggest doing it from admin (see edit)
            – Lez
            Nov 26 '17 at 21:17










          • according to this devdocs.magento.com/guides/v2.0/howdoi/clean_static_cache.html, it's only available in dev mode...
            – helefa
            Nov 26 '17 at 21:20










          • @helafa You are right. In my opinon you should be in developer mode if you're still making changes to your site. But if you're in production, then use rm -R pub/static/* and rm -R var/view_preprocessed/* from CLI
            – Lez
            Nov 26 '17 at 21:28
















          0












          0








          0






          Make sure you are editing the correct css/less files that are located in app/design/frontend/{vendor}/{theme}/web/css and not the ones in pub/static.



          After you make changes, first flush the static files cache and refresh the page cache in Magento admin.



          This works in developer mode.



          enter image description here






          share|improve this answer














          Make sure you are editing the correct css/less files that are located in app/design/frontend/{vendor}/{theme}/web/css and not the ones in pub/static.



          After you make changes, first flush the static files cache and refresh the page cache in Magento admin.



          This works in developer mode.



          enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 26 '17 at 21:29

























          answered Nov 26 '17 at 21:09









          Lez

          1,220529




          1,220529












          • is there a command to flush static file cache in production mode or do I have to manually delete the files?
            – helefa
            Nov 26 '17 at 21:13










          • @helefa I suggest doing it from admin (see edit)
            – Lez
            Nov 26 '17 at 21:17










          • according to this devdocs.magento.com/guides/v2.0/howdoi/clean_static_cache.html, it's only available in dev mode...
            – helefa
            Nov 26 '17 at 21:20










          • @helafa You are right. In my opinon you should be in developer mode if you're still making changes to your site. But if you're in production, then use rm -R pub/static/* and rm -R var/view_preprocessed/* from CLI
            – Lez
            Nov 26 '17 at 21:28




















          • is there a command to flush static file cache in production mode or do I have to manually delete the files?
            – helefa
            Nov 26 '17 at 21:13










          • @helefa I suggest doing it from admin (see edit)
            – Lez
            Nov 26 '17 at 21:17










          • according to this devdocs.magento.com/guides/v2.0/howdoi/clean_static_cache.html, it's only available in dev mode...
            – helefa
            Nov 26 '17 at 21:20










          • @helafa You are right. In my opinon you should be in developer mode if you're still making changes to your site. But if you're in production, then use rm -R pub/static/* and rm -R var/view_preprocessed/* from CLI
            – Lez
            Nov 26 '17 at 21:28


















          is there a command to flush static file cache in production mode or do I have to manually delete the files?
          – helefa
          Nov 26 '17 at 21:13




          is there a command to flush static file cache in production mode or do I have to manually delete the files?
          – helefa
          Nov 26 '17 at 21:13












          @helefa I suggest doing it from admin (see edit)
          – Lez
          Nov 26 '17 at 21:17




          @helefa I suggest doing it from admin (see edit)
          – Lez
          Nov 26 '17 at 21:17












          according to this devdocs.magento.com/guides/v2.0/howdoi/clean_static_cache.html, it's only available in dev mode...
          – helefa
          Nov 26 '17 at 21:20




          according to this devdocs.magento.com/guides/v2.0/howdoi/clean_static_cache.html, it's only available in dev mode...
          – helefa
          Nov 26 '17 at 21:20












          @helafa You are right. In my opinon you should be in developer mode if you're still making changes to your site. But if you're in production, then use rm -R pub/static/* and rm -R var/view_preprocessed/* from CLI
          – Lez
          Nov 26 '17 at 21:28






          @helafa You are right. In my opinon you should be in developer mode if you're still making changes to your site. But if you're in production, then use rm -R pub/static/* and rm -R var/view_preprocessed/* from CLI
          – Lez
          Nov 26 '17 at 21:28















          0














          You can use grunt to manage Magento tasks
          http://devdocs.magento.com/guides/v2.2/frontend-dev-guide/tools/using_grunt.html



          http://devdocs.magento.com/guides/v2.2/frontend-dev-guide/css-topics/css_debug.html



          Then use grunt clean - this command will clean all statics file






          share|improve this answer


























            0














            You can use grunt to manage Magento tasks
            http://devdocs.magento.com/guides/v2.2/frontend-dev-guide/tools/using_grunt.html



            http://devdocs.magento.com/guides/v2.2/frontend-dev-guide/css-topics/css_debug.html



            Then use grunt clean - this command will clean all statics file






            share|improve this answer
























              0












              0








              0






              You can use grunt to manage Magento tasks
              http://devdocs.magento.com/guides/v2.2/frontend-dev-guide/tools/using_grunt.html



              http://devdocs.magento.com/guides/v2.2/frontend-dev-guide/css-topics/css_debug.html



              Then use grunt clean - this command will clean all statics file






              share|improve this answer












              You can use grunt to manage Magento tasks
              http://devdocs.magento.com/guides/v2.2/frontend-dev-guide/tools/using_grunt.html



              http://devdocs.magento.com/guides/v2.2/frontend-dev-guide/css-topics/css_debug.html



              Then use grunt clean - this command will clean all statics file







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Nov 27 '17 at 3:07









              Typo

              1113




              1113























                  0














                  maybe its the client side. Your browser may cached the static files



                  if you are using browser like chrome, right click, select inspect, select network, and tick checkbox disable cache



                  hit refresh F5 without closing the inspect






                  share|improve this answer




























                    0














                    maybe its the client side. Your browser may cached the static files



                    if you are using browser like chrome, right click, select inspect, select network, and tick checkbox disable cache



                    hit refresh F5 without closing the inspect






                    share|improve this answer


























                      0












                      0








                      0






                      maybe its the client side. Your browser may cached the static files



                      if you are using browser like chrome, right click, select inspect, select network, and tick checkbox disable cache



                      hit refresh F5 without closing the inspect






                      share|improve this answer














                      maybe its the client side. Your browser may cached the static files



                      if you are using browser like chrome, right click, select inspect, select network, and tick checkbox disable cache



                      hit refresh F5 without closing the inspect







                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Nov 27 '17 at 21:57

























                      answered Nov 27 '17 at 21:44









                      Afham

                      12616




                      12616























                          0














                          I recently had an issue exactly the same. I suggest you try what worked for me and Clear var/view_preprocessed directory and then redeploy using the below commands



                          php bin/magento setup:static-content:deploy --language en_GB

                          php bin/magento cache:clean

                          php bin/magento cache:flush





                          share|improve this answer




























                            0














                            I recently had an issue exactly the same. I suggest you try what worked for me and Clear var/view_preprocessed directory and then redeploy using the below commands



                            php bin/magento setup:static-content:deploy --language en_GB

                            php bin/magento cache:clean

                            php bin/magento cache:flush





                            share|improve this answer


























                              0












                              0








                              0






                              I recently had an issue exactly the same. I suggest you try what worked for me and Clear var/view_preprocessed directory and then redeploy using the below commands



                              php bin/magento setup:static-content:deploy --language en_GB

                              php bin/magento cache:clean

                              php bin/magento cache:flush





                              share|improve this answer














                              I recently had an issue exactly the same. I suggest you try what worked for me and Clear var/view_preprocessed directory and then redeploy using the below commands



                              php bin/magento setup:static-content:deploy --language en_GB

                              php bin/magento cache:clean

                              php bin/magento cache:flush






                              share|improve this answer














                              share|improve this answer



                              share|improve this answer








                              edited Nov 27 '17 at 23:44









                              Abhishek Panchal

                              3,4122829




                              3,4122829










                              answered Nov 26 '17 at 22:07









                              Will Lifestyle

                              1




                              1























                                  0














                                  In a production mode you can use the sequence of commands below to regenerate the css files. Specially if you're using less files.



                                  It's not required in developer and default modes.



                                  rm var/view_preprocessed/* pub/static/frontend/* 
                                  && php bin/magento setup:static-content:deploy en_AU en_US





                                  share|improve this answer


























                                    0














                                    In a production mode you can use the sequence of commands below to regenerate the css files. Specially if you're using less files.



                                    It's not required in developer and default modes.



                                    rm var/view_preprocessed/* pub/static/frontend/* 
                                    && php bin/magento setup:static-content:deploy en_AU en_US





                                    share|improve this answer
























                                      0












                                      0








                                      0






                                      In a production mode you can use the sequence of commands below to regenerate the css files. Specially if you're using less files.



                                      It's not required in developer and default modes.



                                      rm var/view_preprocessed/* pub/static/frontend/* 
                                      && php bin/magento setup:static-content:deploy en_AU en_US





                                      share|improve this answer












                                      In a production mode you can use the sequence of commands below to regenerate the css files. Specially if you're using less files.



                                      It's not required in developer and default modes.



                                      rm var/view_preprocessed/* pub/static/frontend/* 
                                      && php bin/magento setup:static-content:deploy en_AU en_US






                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Aug 2 '18 at 0:53









                                      medina

                                      28528




                                      28528






























                                          draft saved

                                          draft discarded




















































                                          Thanks for contributing an answer to Magento Stack Exchange!


                                          • Please be sure to answer the question. Provide details and share your research!

                                          But avoid



                                          • Asking for help, clarification, or responding to other answers.

                                          • Making statements based on opinion; back them up with references or personal experience.


                                          To learn more, see our tips on writing great answers.





                                          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                          Please pay close attention to the following guidance:


                                          • Please be sure to answer the question. Provide details and share your research!

                                          But avoid



                                          • Asking for help, clarification, or responding to other answers.

                                          • Making statements based on opinion; back them up with references or personal experience.


                                          To learn more, see our tips on writing great answers.




                                          draft saved


                                          draft discarded














                                          StackExchange.ready(
                                          function () {
                                          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f203259%2fmagento2-how-do-i-show-css-updates-in-production-mode%23new-answer', 'question_page');
                                          }
                                          );

                                          Post as a guest















                                          Required, but never shown





















































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown

































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown







                                          Popular posts from this blog

                                          1300-talet

                                          1300-talet

                                          Display a custom attribute below product name in the front-end Magento 1.9.3.8