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;
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
add a comment |
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
for my knowledge is no way
– xanka
May 30 at 9:53
add a comment |
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
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
magento2 layout css
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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)
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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)
add a comment |
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)
add a comment |
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)
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)
answered May 31 at 8:26
Richard LawsRichard Laws
789
789
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
for my knowledge is no way
– xanka
May 30 at 9:53