Magento 2 : Exclude CSS from merged file just for the homepageCSS merge issue in mozilla firefoxMagento Un merge JS and CSS fileMake merged js and css file asynchronous in magentomagento 2 : where is Layout XML File for Homepage locatedRemoving Welcome message from magento 2 - just xmlMagento 2.1: Disable title suffix just for home pageMagento 2 CSS is not coming mergedMagento Production Custom theme custom css file is not loadingRemove price filter for specific categoryRemove merged css and js from layout in magento2

How to return a security deposit to a tenant

Were Alexander the Great and Hephaestion lovers?

Medieval flying castle propulsion

A curious prime counting approximation or just data overfitting?

SQL counting distinct over partition

Why didn't Voldemort recognize that Dumbledore was affected by his curse?

Is it legal for a bar bouncer to conficaste a fake ID

What is the highest possible temporary AC at level 1, without any help from others?

Does Disney no longer produce hand-drawn cartoon films?

Arriving at the same result with the opposite hypotheses

How can "научись" mean "take it and keep trying"?

What to do when surprise and a high initiative roll conflict with the narrative?

What is the actual quality of machine translations?

What language is software running on the ISS written in?

Do simulator games use a realistic trajectory to get into orbit?

Passing multiple files through stdin (over ssh)

Fixing obscure 8080 emulator bug?

What is wrong with this proof that symmetric matrices commute?

Programming bare microcontroller chips

Find the limit of a multiplying term function when n tends to infinity.

This riddle is not to see but to solve

Is open-sourcing the code of a webapp not recommended?

What makes Ada the language of choice for the ISS's safety-critical systems?

PhD - Well known professor or well known school?



Magento 2 : Exclude CSS from merged file just for the homepage


CSS merge issue in mozilla firefoxMagento Un merge JS and CSS fileMake merged js and css file asynchronous in magentomagento 2 : where is Layout XML File for Homepage locatedRemoving Welcome message from magento 2 - just xmlMagento 2.1: Disable title suffix just for home pageMagento 2 CSS is not coming mergedMagento Production Custom theme custom css file is not loadingRemove price filter for specific categoryRemove merged css and js from layout in magento2






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








0















I have merge and minify CSS enabled and I would like to know if is there a way to exclude a specific CSS file from the final merged file, but only for the homepage?



I know how to remove a CSS file from the header via XML layout...



<remove src="css/styles-m.css" />


But can you remove/exclude this from the final compiled CSS file, just for the homepage?



Thanks!










share|improve this question
























  • for my knowledge is no way

    – xanka
    May 30 at 9:53

















0















I have merge and minify CSS enabled and I would like to know if is there a way to exclude a specific CSS file from the final merged file, but only for the homepage?



I know how to remove a CSS file from the header via XML layout...



<remove src="css/styles-m.css" />


But can you remove/exclude this from the final compiled CSS file, just for the homepage?



Thanks!










share|improve this question
























  • for my knowledge is no way

    – xanka
    May 30 at 9:53













0












0








0








I have merge and minify CSS enabled and I would like to know if is there a way to exclude a specific CSS file from the final merged file, but only for the homepage?



I know how to remove a CSS file from the header via XML layout...



<remove src="css/styles-m.css" />


But can you remove/exclude this from the final compiled CSS file, just for the homepage?



Thanks!










share|improve this question
















I have merge and minify CSS enabled and I would like to know if is there a way to exclude a specific CSS file from the final merged file, but only for the homepage?



I know how to remove a CSS file from the header via XML layout...



<remove src="css/styles-m.css" />


But can you remove/exclude this from the final compiled CSS file, just for the homepage?



Thanks!







magento2 layout css






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 30 at 8:47









TN98

8810




8810










asked May 30 at 8:34









Richard LawsRichard Laws

789




789












  • for my knowledge is no way

    – xanka
    May 30 at 9:53

















  • for my knowledge is no way

    – xanka
    May 30 at 9:53
















for my knowledge is no way

– xanka
May 30 at 9:53





for my knowledge is no way

– xanka
May 30 at 9:53










1 Answer
1






active

oldest

votes


















0














If it helps anybody (using Magento 2.1.4), I managed to do this by first adding my CSS file to the exclude list in my view.xml



<exclude>
<item type="file">Module_Name::css/stylesheet.css</item>
</exclude>


I then created a new cms_index_index.xml and put it in



app/design/frontend/name/theme-name/Magento_Cms/layout



Then added this to remove the file from the homepage...



<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<remove src="Module_Name::css/stylesheet.css"/>
</head>




I thought this would mean that the file is then not minified and merged for all other pages, but no... it still appears in my merged and minified master CSS file for all other pages (except the homepage)






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%2f276701%2fmagento-2-exclude-css-from-merged-file-just-for-the-homepage%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    If it helps anybody (using Magento 2.1.4), I managed to do this by first adding my CSS file to the exclude list in my view.xml



    <exclude>
    <item type="file">Module_Name::css/stylesheet.css</item>
    </exclude>


    I then created a new cms_index_index.xml and put it in



    app/design/frontend/name/theme-name/Magento_Cms/layout



    Then added this to remove the file from the homepage...



    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
    <remove src="Module_Name::css/stylesheet.css"/>
    </head>




    I thought this would mean that the file is then not minified and merged for all other pages, but no... it still appears in my merged and minified master CSS file for all other pages (except the homepage)






    share|improve this answer



























      0














      If it helps anybody (using Magento 2.1.4), I managed to do this by first adding my CSS file to the exclude list in my view.xml



      <exclude>
      <item type="file">Module_Name::css/stylesheet.css</item>
      </exclude>


      I then created a new cms_index_index.xml and put it in



      app/design/frontend/name/theme-name/Magento_Cms/layout



      Then added this to remove the file from the homepage...



      <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
      <head>
      <remove src="Module_Name::css/stylesheet.css"/>
      </head>




      I thought this would mean that the file is then not minified and merged for all other pages, but no... it still appears in my merged and minified master CSS file for all other pages (except the homepage)






      share|improve this answer

























        0












        0








        0







        If it helps anybody (using Magento 2.1.4), I managed to do this by first adding my CSS file to the exclude list in my view.xml



        <exclude>
        <item type="file">Module_Name::css/stylesheet.css</item>
        </exclude>


        I then created a new cms_index_index.xml and put it in



        app/design/frontend/name/theme-name/Magento_Cms/layout



        Then added this to remove the file from the homepage...



        <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <head>
        <remove src="Module_Name::css/stylesheet.css"/>
        </head>




        I thought this would mean that the file is then not minified and merged for all other pages, but no... it still appears in my merged and minified master CSS file for all other pages (except the homepage)






        share|improve this answer













        If it helps anybody (using Magento 2.1.4), I managed to do this by first adding my CSS file to the exclude list in my view.xml



        <exclude>
        <item type="file">Module_Name::css/stylesheet.css</item>
        </exclude>


        I then created a new cms_index_index.xml and put it in



        app/design/frontend/name/theme-name/Magento_Cms/layout



        Then added this to remove the file from the homepage...



        <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <head>
        <remove src="Module_Name::css/stylesheet.css"/>
        </head>




        I thought this would mean that the file is then not minified and merged for all other pages, but no... it still appears in my merged and minified master CSS file for all other pages (except the homepage)







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered May 31 at 8:26









        Richard LawsRichard Laws

        789




        789



























            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%2f276701%2fmagento-2-exclude-css-from-merged-file-just-for-the-homepage%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