Magento 2: How to add Custom CSS/JS that will load last among other CSS/JS filesHow to add a custom CSS file in Magento 2Magento 2 Wamp installation CSS/JS files return 404 error - multi storeOverride Magento 2 JS file via requirejs-config.js not workingRefused to apply style “because its MIME type ('text/html') is not a supported stylesheet MIME type”Error: Exception #0 (InvalidArgumentException): Unable to serialize value - Produced by custom ThemeMagento 2 : Refuse to apply style.less file not complied in .css file in magneto2Magento 2 checkout page keeps on loading.In console,$.event.props is undefined in jquery.mobile.custom.js:44:2.How to clear that?Css not loading after theme installationLocation of confirm.jsI am getting jquery error while adding custom field in payment method in magento 2?

How does metta sutra develop loving kindness

Inverse-quotes-quine

Is a single radon-daughter atom in air a solid?

Why cruise at 7000' in an A319?

How is hair tissue mineral analysis performed?

Hand soldering SMD 1206 components

Can ADFS connect to other SSO services?

What was the Shuttle Carrier Aircraft escape tunnel?

How to make clear to people I don't want to answer their "Where are you from?" question?

Find the probability that the 8th woman to appear is in 17th position.

Can humans ever directly see a few photons at a time? Can a human see a single photon?

What does "play with your toy’s toys" mean?

I am completely new to Tales from the Floating Vagabond, how do I get started?

Sci fi short story, robot city that nags people about health

Why change the size when print a object

Why did pressing the joystick button spit out keypresses?

Wifi dongle speed is slower than advertised

Can any NP-Complete Problem be solved using at most polynomial space (but while using exponential time?)

Hot coffee brewing solutions for deep woods camping

How dangerous are set-size assumptions?

Tantum religio potuit suadere malorum – Lucretius

If I wouldn't want to read the story, is writing it still a good idea?

How would modern naval warfare have to have developed differently for battleships to still be relevant in the 21st century?

Can we put equal sign after aggregate functions in sql?



Magento 2: How to add Custom CSS/JS that will load last among other CSS/JS files


How to add a custom CSS file in Magento 2Magento 2 Wamp installation CSS/JS files return 404 error - multi storeOverride Magento 2 JS file via requirejs-config.js not workingRefused to apply style “because its MIME type ('text/html') is not a supported stylesheet MIME type”Error: Exception #0 (InvalidArgumentException): Unable to serialize value - Produced by custom ThemeMagento 2 : Refuse to apply style.less file not complied in .css file in magneto2Magento 2 checkout page keeps on loading.In console,$.event.props is undefined in jquery.mobile.custom.js:44:2.How to clear that?Css not loading after theme installationLocation of confirm.jsI am getting jquery error while adding custom field in payment method in magento 2?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








4















I need to override CSS/JS that will override the styling and I need it to load the last part among other CSS files link like:



<head>
<title>Home page</title>

<link rel="stylesheet" type="text/css" media="all" href="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/mage/calendar.css" />
<link rel="stylesheet" type="text/css" media="all" href="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/css/styles-m.css" />
<link rel="stylesheet" type="text/css" media="screen and (min-width: 768px)" href="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/css/styles-l.css" />
<link rel="stylesheet" type="text/css" media="print" href="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/css/print.css" />
<link rel="icon" type="image/x-icon" href="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/Magento_Theme/favicon.ico" />
<link rel="shortcut icon" type="image/x-icon" href="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/Magento_Theme/favicon.ico" />
<script type="text/javascript" src="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/requirejs/require.js"></script>
<script type="text/javascript" src="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/mage/requirejs/mixins.js"></script>
<script type="text/javascript" src="http://mage2.dev/pub/static/_requirejs/frontend/Magento/luma/en_US/requirejs-config.js"></script>

<!-- ADD MY CUSTOM CSS/JSS LOAD AT THE LAST -->
<link rel="stylesheet" type="text/css" media="all" href="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/css/OVERRIDE.CSS">
<script type="text/javascript" src="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/js/OVERRIDE.JS"></script>

</head>


I found this post (How to add a custom CSS file in Magento 2) but it's not working for me.



(Posted it in magento forum but got no reply: link here)



Any help would be much appreciated.










share|improve this question






























    4















    I need to override CSS/JS that will override the styling and I need it to load the last part among other CSS files link like:



    <head>
    <title>Home page</title>

    <link rel="stylesheet" type="text/css" media="all" href="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/mage/calendar.css" />
    <link rel="stylesheet" type="text/css" media="all" href="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/css/styles-m.css" />
    <link rel="stylesheet" type="text/css" media="screen and (min-width: 768px)" href="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/css/styles-l.css" />
    <link rel="stylesheet" type="text/css" media="print" href="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/css/print.css" />
    <link rel="icon" type="image/x-icon" href="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/Magento_Theme/favicon.ico" />
    <link rel="shortcut icon" type="image/x-icon" href="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/Magento_Theme/favicon.ico" />
    <script type="text/javascript" src="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/requirejs/require.js"></script>
    <script type="text/javascript" src="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/mage/requirejs/mixins.js"></script>
    <script type="text/javascript" src="http://mage2.dev/pub/static/_requirejs/frontend/Magento/luma/en_US/requirejs-config.js"></script>

    <!-- ADD MY CUSTOM CSS/JSS LOAD AT THE LAST -->
    <link rel="stylesheet" type="text/css" media="all" href="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/css/OVERRIDE.CSS">
    <script type="text/javascript" src="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/js/OVERRIDE.JS"></script>

    </head>


    I found this post (How to add a custom CSS file in Magento 2) but it's not working for me.



    (Posted it in magento forum but got no reply: link here)



    Any help would be much appreciated.










    share|improve this question


























      4












      4








      4


      2






      I need to override CSS/JS that will override the styling and I need it to load the last part among other CSS files link like:



      <head>
      <title>Home page</title>

      <link rel="stylesheet" type="text/css" media="all" href="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/mage/calendar.css" />
      <link rel="stylesheet" type="text/css" media="all" href="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/css/styles-m.css" />
      <link rel="stylesheet" type="text/css" media="screen and (min-width: 768px)" href="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/css/styles-l.css" />
      <link rel="stylesheet" type="text/css" media="print" href="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/css/print.css" />
      <link rel="icon" type="image/x-icon" href="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/Magento_Theme/favicon.ico" />
      <link rel="shortcut icon" type="image/x-icon" href="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/Magento_Theme/favicon.ico" />
      <script type="text/javascript" src="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/requirejs/require.js"></script>
      <script type="text/javascript" src="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/mage/requirejs/mixins.js"></script>
      <script type="text/javascript" src="http://mage2.dev/pub/static/_requirejs/frontend/Magento/luma/en_US/requirejs-config.js"></script>

      <!-- ADD MY CUSTOM CSS/JSS LOAD AT THE LAST -->
      <link rel="stylesheet" type="text/css" media="all" href="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/css/OVERRIDE.CSS">
      <script type="text/javascript" src="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/js/OVERRIDE.JS"></script>

      </head>


      I found this post (How to add a custom CSS file in Magento 2) but it's not working for me.



      (Posted it in magento forum but got no reply: link here)



      Any help would be much appreciated.










      share|improve this question
















      I need to override CSS/JS that will override the styling and I need it to load the last part among other CSS files link like:



      <head>
      <title>Home page</title>

      <link rel="stylesheet" type="text/css" media="all" href="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/mage/calendar.css" />
      <link rel="stylesheet" type="text/css" media="all" href="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/css/styles-m.css" />
      <link rel="stylesheet" type="text/css" media="screen and (min-width: 768px)" href="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/css/styles-l.css" />
      <link rel="stylesheet" type="text/css" media="print" href="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/css/print.css" />
      <link rel="icon" type="image/x-icon" href="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/Magento_Theme/favicon.ico" />
      <link rel="shortcut icon" type="image/x-icon" href="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/Magento_Theme/favicon.ico" />
      <script type="text/javascript" src="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/requirejs/require.js"></script>
      <script type="text/javascript" src="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/mage/requirejs/mixins.js"></script>
      <script type="text/javascript" src="http://mage2.dev/pub/static/_requirejs/frontend/Magento/luma/en_US/requirejs-config.js"></script>

      <!-- ADD MY CUSTOM CSS/JSS LOAD AT THE LAST -->
      <link rel="stylesheet" type="text/css" media="all" href="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/css/OVERRIDE.CSS">
      <script type="text/javascript" src="http://mage2.dev/pub/static/frontend/Magento/luma/en_US/js/OVERRIDE.JS"></script>

      </head>


      I found this post (How to add a custom CSS file in Magento 2) but it's not working for me.



      (Posted it in magento forum but got no reply: link here)



      Any help would be much appreciated.







      magento2 overrides






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jun 17 at 9:04







      nhinzky

















      asked Jul 29 '16 at 9:27









      nhinzkynhinzky

      4721 gold badge8 silver badges21 bronze badges




      4721 gold badge8 silver badges21 bronze badges




















          3 Answers
          3






          active

          oldest

          votes


















          8














          Thanks @long thanh: The extension you shared really works but as I tested it without the extension it is still working.



          Tried it on Magento 2.0.7 and 2.1.1 fresh installation and just add this to add custom CSS:



          <css src="css/override.css" order="100" />


          and custom JS:



          <script src="js/override.js" order="100" />


          So the answer is you just add the order="" attribute to be read at the last style or javascript. Also the value in "order" attribute doesn't really matter to the ordering it will still be read at the last part.



          But if you have 2 or more custom css/js like this:



          <css src="css/override.css" order="100" />
          <css src="css/override2.css" order="100" />
          <script src="js/override.js" order="100" />
          <script src="js/override2.js" order="100" />


          The result will be the same order the way you write it so..



          -styles loaded here .......
          <css src="css/override.css" order="100" />
          <css src="css/override2.css" order="100" />

          -javascripts loaded here.......
          <script src="js/override2.js" order="100" />
          <script src="js/override.js" order="100" />


          Thanks guys...






          share|improve this answer


















          • 2





            tried above in magento 2.2 and magento threw error, so order attribute is no longer valid :(

            – Jonathan Marzullo
            Oct 10 '17 at 17:21






          • 1





            @JonathanMarzullo I am still using it in Magento 2.2.0 but it is working fine.

            – nhinzky
            Oct 11 '17 at 9:01











          • Thats weird.. when i attempt to use it i get this magento 2 error Exception #0 (MagentoFrameworkConfigDomValidationException): Element 'css', attribute 'order': The attribute 'order' is not allowed. I am using it in the default_head_blocks.xml file

            – Jonathan Marzullo
            Oct 11 '17 at 12:49












          • Looks like this css order functionality in Magento2 is only available with this extension: github.com/quickshiftin/mage2-ordered-assets

            – Jonathan Marzullo
            Oct 11 '17 at 17:11












          • Yeah it should be in default_head_blocks.xml. But I can't reproduced the error you had.

            – nhinzky
            Oct 12 '17 at 10:06


















          3














          You can add the media attribute which magento 2 will put to the end of the css in the head section. Setting a width of only 1px will enable it on all devices:



          <head>
          <css src="css/homepage.css" media="all and (min-width: 1px)"/>
          </head>





          share|improve this answer






























            1














            I struggle with same issue. I tried to find how to add override at last but unsuccessful.



            You can add css file in body. Write custom block and add style on this block. Stupid way but can override code. I can't understand why magento 2 don't have order option to load css file right postion.



            I found good extension on this link too but don't try
            https://github.com/quickshiftin/mage2-ordered-assets






            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%2f128080%2fmagento-2-how-to-add-custom-css-js-that-will-load-last-among-other-css-js-files%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              8














              Thanks @long thanh: The extension you shared really works but as I tested it without the extension it is still working.



              Tried it on Magento 2.0.7 and 2.1.1 fresh installation and just add this to add custom CSS:



              <css src="css/override.css" order="100" />


              and custom JS:



              <script src="js/override.js" order="100" />


              So the answer is you just add the order="" attribute to be read at the last style or javascript. Also the value in "order" attribute doesn't really matter to the ordering it will still be read at the last part.



              But if you have 2 or more custom css/js like this:



              <css src="css/override.css" order="100" />
              <css src="css/override2.css" order="100" />
              <script src="js/override.js" order="100" />
              <script src="js/override2.js" order="100" />


              The result will be the same order the way you write it so..



              -styles loaded here .......
              <css src="css/override.css" order="100" />
              <css src="css/override2.css" order="100" />

              -javascripts loaded here.......
              <script src="js/override2.js" order="100" />
              <script src="js/override.js" order="100" />


              Thanks guys...






              share|improve this answer


















              • 2





                tried above in magento 2.2 and magento threw error, so order attribute is no longer valid :(

                – Jonathan Marzullo
                Oct 10 '17 at 17:21






              • 1





                @JonathanMarzullo I am still using it in Magento 2.2.0 but it is working fine.

                – nhinzky
                Oct 11 '17 at 9:01











              • Thats weird.. when i attempt to use it i get this magento 2 error Exception #0 (MagentoFrameworkConfigDomValidationException): Element 'css', attribute 'order': The attribute 'order' is not allowed. I am using it in the default_head_blocks.xml file

                – Jonathan Marzullo
                Oct 11 '17 at 12:49












              • Looks like this css order functionality in Magento2 is only available with this extension: github.com/quickshiftin/mage2-ordered-assets

                – Jonathan Marzullo
                Oct 11 '17 at 17:11












              • Yeah it should be in default_head_blocks.xml. But I can't reproduced the error you had.

                – nhinzky
                Oct 12 '17 at 10:06















              8














              Thanks @long thanh: The extension you shared really works but as I tested it without the extension it is still working.



              Tried it on Magento 2.0.7 and 2.1.1 fresh installation and just add this to add custom CSS:



              <css src="css/override.css" order="100" />


              and custom JS:



              <script src="js/override.js" order="100" />


              So the answer is you just add the order="" attribute to be read at the last style or javascript. Also the value in "order" attribute doesn't really matter to the ordering it will still be read at the last part.



              But if you have 2 or more custom css/js like this:



              <css src="css/override.css" order="100" />
              <css src="css/override2.css" order="100" />
              <script src="js/override.js" order="100" />
              <script src="js/override2.js" order="100" />


              The result will be the same order the way you write it so..



              -styles loaded here .......
              <css src="css/override.css" order="100" />
              <css src="css/override2.css" order="100" />

              -javascripts loaded here.......
              <script src="js/override2.js" order="100" />
              <script src="js/override.js" order="100" />


              Thanks guys...






              share|improve this answer


















              • 2





                tried above in magento 2.2 and magento threw error, so order attribute is no longer valid :(

                – Jonathan Marzullo
                Oct 10 '17 at 17:21






              • 1





                @JonathanMarzullo I am still using it in Magento 2.2.0 but it is working fine.

                – nhinzky
                Oct 11 '17 at 9:01











              • Thats weird.. when i attempt to use it i get this magento 2 error Exception #0 (MagentoFrameworkConfigDomValidationException): Element 'css', attribute 'order': The attribute 'order' is not allowed. I am using it in the default_head_blocks.xml file

                – Jonathan Marzullo
                Oct 11 '17 at 12:49












              • Looks like this css order functionality in Magento2 is only available with this extension: github.com/quickshiftin/mage2-ordered-assets

                – Jonathan Marzullo
                Oct 11 '17 at 17:11












              • Yeah it should be in default_head_blocks.xml. But I can't reproduced the error you had.

                – nhinzky
                Oct 12 '17 at 10:06













              8












              8








              8







              Thanks @long thanh: The extension you shared really works but as I tested it without the extension it is still working.



              Tried it on Magento 2.0.7 and 2.1.1 fresh installation and just add this to add custom CSS:



              <css src="css/override.css" order="100" />


              and custom JS:



              <script src="js/override.js" order="100" />


              So the answer is you just add the order="" attribute to be read at the last style or javascript. Also the value in "order" attribute doesn't really matter to the ordering it will still be read at the last part.



              But if you have 2 or more custom css/js like this:



              <css src="css/override.css" order="100" />
              <css src="css/override2.css" order="100" />
              <script src="js/override.js" order="100" />
              <script src="js/override2.js" order="100" />


              The result will be the same order the way you write it so..



              -styles loaded here .......
              <css src="css/override.css" order="100" />
              <css src="css/override2.css" order="100" />

              -javascripts loaded here.......
              <script src="js/override2.js" order="100" />
              <script src="js/override.js" order="100" />


              Thanks guys...






              share|improve this answer













              Thanks @long thanh: The extension you shared really works but as I tested it without the extension it is still working.



              Tried it on Magento 2.0.7 and 2.1.1 fresh installation and just add this to add custom CSS:



              <css src="css/override.css" order="100" />


              and custom JS:



              <script src="js/override.js" order="100" />


              So the answer is you just add the order="" attribute to be read at the last style or javascript. Also the value in "order" attribute doesn't really matter to the ordering it will still be read at the last part.



              But if you have 2 or more custom css/js like this:



              <css src="css/override.css" order="100" />
              <css src="css/override2.css" order="100" />
              <script src="js/override.js" order="100" />
              <script src="js/override2.js" order="100" />


              The result will be the same order the way you write it so..



              -styles loaded here .......
              <css src="css/override.css" order="100" />
              <css src="css/override2.css" order="100" />

              -javascripts loaded here.......
              <script src="js/override2.js" order="100" />
              <script src="js/override.js" order="100" />


              Thanks guys...







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Sep 6 '16 at 9:55









              nhinzkynhinzky

              4721 gold badge8 silver badges21 bronze badges




              4721 gold badge8 silver badges21 bronze badges







              • 2





                tried above in magento 2.2 and magento threw error, so order attribute is no longer valid :(

                – Jonathan Marzullo
                Oct 10 '17 at 17:21






              • 1





                @JonathanMarzullo I am still using it in Magento 2.2.0 but it is working fine.

                – nhinzky
                Oct 11 '17 at 9:01











              • Thats weird.. when i attempt to use it i get this magento 2 error Exception #0 (MagentoFrameworkConfigDomValidationException): Element 'css', attribute 'order': The attribute 'order' is not allowed. I am using it in the default_head_blocks.xml file

                – Jonathan Marzullo
                Oct 11 '17 at 12:49












              • Looks like this css order functionality in Magento2 is only available with this extension: github.com/quickshiftin/mage2-ordered-assets

                – Jonathan Marzullo
                Oct 11 '17 at 17:11












              • Yeah it should be in default_head_blocks.xml. But I can't reproduced the error you had.

                – nhinzky
                Oct 12 '17 at 10:06












              • 2





                tried above in magento 2.2 and magento threw error, so order attribute is no longer valid :(

                – Jonathan Marzullo
                Oct 10 '17 at 17:21






              • 1





                @JonathanMarzullo I am still using it in Magento 2.2.0 but it is working fine.

                – nhinzky
                Oct 11 '17 at 9:01











              • Thats weird.. when i attempt to use it i get this magento 2 error Exception #0 (MagentoFrameworkConfigDomValidationException): Element 'css', attribute 'order': The attribute 'order' is not allowed. I am using it in the default_head_blocks.xml file

                – Jonathan Marzullo
                Oct 11 '17 at 12:49












              • Looks like this css order functionality in Magento2 is only available with this extension: github.com/quickshiftin/mage2-ordered-assets

                – Jonathan Marzullo
                Oct 11 '17 at 17:11












              • Yeah it should be in default_head_blocks.xml. But I can't reproduced the error you had.

                – nhinzky
                Oct 12 '17 at 10:06







              2




              2





              tried above in magento 2.2 and magento threw error, so order attribute is no longer valid :(

              – Jonathan Marzullo
              Oct 10 '17 at 17:21





              tried above in magento 2.2 and magento threw error, so order attribute is no longer valid :(

              – Jonathan Marzullo
              Oct 10 '17 at 17:21




              1




              1





              @JonathanMarzullo I am still using it in Magento 2.2.0 but it is working fine.

              – nhinzky
              Oct 11 '17 at 9:01





              @JonathanMarzullo I am still using it in Magento 2.2.0 but it is working fine.

              – nhinzky
              Oct 11 '17 at 9:01













              Thats weird.. when i attempt to use it i get this magento 2 error Exception #0 (MagentoFrameworkConfigDomValidationException): Element 'css', attribute 'order': The attribute 'order' is not allowed. I am using it in the default_head_blocks.xml file

              – Jonathan Marzullo
              Oct 11 '17 at 12:49






              Thats weird.. when i attempt to use it i get this magento 2 error Exception #0 (MagentoFrameworkConfigDomValidationException): Element 'css', attribute 'order': The attribute 'order' is not allowed. I am using it in the default_head_blocks.xml file

              – Jonathan Marzullo
              Oct 11 '17 at 12:49














              Looks like this css order functionality in Magento2 is only available with this extension: github.com/quickshiftin/mage2-ordered-assets

              – Jonathan Marzullo
              Oct 11 '17 at 17:11






              Looks like this css order functionality in Magento2 is only available with this extension: github.com/quickshiftin/mage2-ordered-assets

              – Jonathan Marzullo
              Oct 11 '17 at 17:11














              Yeah it should be in default_head_blocks.xml. But I can't reproduced the error you had.

              – nhinzky
              Oct 12 '17 at 10:06





              Yeah it should be in default_head_blocks.xml. But I can't reproduced the error you had.

              – nhinzky
              Oct 12 '17 at 10:06













              3














              You can add the media attribute which magento 2 will put to the end of the css in the head section. Setting a width of only 1px will enable it on all devices:



              <head>
              <css src="css/homepage.css" media="all and (min-width: 1px)"/>
              </head>





              share|improve this answer



























                3














                You can add the media attribute which magento 2 will put to the end of the css in the head section. Setting a width of only 1px will enable it on all devices:



                <head>
                <css src="css/homepage.css" media="all and (min-width: 1px)"/>
                </head>





                share|improve this answer

























                  3












                  3








                  3







                  You can add the media attribute which magento 2 will put to the end of the css in the head section. Setting a width of only 1px will enable it on all devices:



                  <head>
                  <css src="css/homepage.css" media="all and (min-width: 1px)"/>
                  </head>





                  share|improve this answer













                  You can add the media attribute which magento 2 will put to the end of the css in the head section. Setting a width of only 1px will enable it on all devices:



                  <head>
                  <css src="css/homepage.css" media="all and (min-width: 1px)"/>
                  </head>






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Oct 16 '17 at 15:37









                  Cypher909Cypher909

                  2171 silver badge5 bronze badges




                  2171 silver badge5 bronze badges





















                      1














                      I struggle with same issue. I tried to find how to add override at last but unsuccessful.



                      You can add css file in body. Write custom block and add style on this block. Stupid way but can override code. I can't understand why magento 2 don't have order option to load css file right postion.



                      I found good extension on this link too but don't try
                      https://github.com/quickshiftin/mage2-ordered-assets






                      share|improve this answer



























                        1














                        I struggle with same issue. I tried to find how to add override at last but unsuccessful.



                        You can add css file in body. Write custom block and add style on this block. Stupid way but can override code. I can't understand why magento 2 don't have order option to load css file right postion.



                        I found good extension on this link too but don't try
                        https://github.com/quickshiftin/mage2-ordered-assets






                        share|improve this answer

























                          1












                          1








                          1







                          I struggle with same issue. I tried to find how to add override at last but unsuccessful.



                          You can add css file in body. Write custom block and add style on this block. Stupid way but can override code. I can't understand why magento 2 don't have order option to load css file right postion.



                          I found good extension on this link too but don't try
                          https://github.com/quickshiftin/mage2-ordered-assets






                          share|improve this answer













                          I struggle with same issue. I tried to find how to add override at last but unsuccessful.



                          You can add css file in body. Write custom block and add style on this block. Stupid way but can override code. I can't understand why magento 2 don't have order option to load css file right postion.



                          I found good extension on this link too but don't try
                          https://github.com/quickshiftin/mage2-ordered-assets







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Sep 1 '16 at 9:02









                          long thanhlong thanh

                          163 bronze badges




                          163 bronze badges



























                              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.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f128080%2fmagento-2-how-to-add-custom-css-js-that-will-load-last-among-other-css-js-files%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

                              Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

                              Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                              Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form