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;
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
add a comment |
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
add a comment |
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
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
magento2 overrides
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
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
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...
2
tried above in magento 2.2 and magento threw error, soorder
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 errorException #0 (MagentoFrameworkConfigDomValidationException): Element 'css', attribute 'order': The attribute 'order' is not allowed.
I am using it in thedefault_head_blocks.xml
file
– Jonathan Marzullo
Oct 11 '17 at 12:49
Looks like this cssorder
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 indefault_head_blocks.xml
. But I can't reproduced the error you had.
– nhinzky
Oct 12 '17 at 10:06
|
show 1 more comment
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>
add a comment |
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
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%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
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...
2
tried above in magento 2.2 and magento threw error, soorder
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 errorException #0 (MagentoFrameworkConfigDomValidationException): Element 'css', attribute 'order': The attribute 'order' is not allowed.
I am using it in thedefault_head_blocks.xml
file
– Jonathan Marzullo
Oct 11 '17 at 12:49
Looks like this cssorder
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 indefault_head_blocks.xml
. But I can't reproduced the error you had.
– nhinzky
Oct 12 '17 at 10:06
|
show 1 more comment
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...
2
tried above in magento 2.2 and magento threw error, soorder
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 errorException #0 (MagentoFrameworkConfigDomValidationException): Element 'css', attribute 'order': The attribute 'order' is not allowed.
I am using it in thedefault_head_blocks.xml
file
– Jonathan Marzullo
Oct 11 '17 at 12:49
Looks like this cssorder
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 indefault_head_blocks.xml
. But I can't reproduced the error you had.
– nhinzky
Oct 12 '17 at 10:06
|
show 1 more comment
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...
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...
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, soorder
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 errorException #0 (MagentoFrameworkConfigDomValidationException): Element 'css', attribute 'order': The attribute 'order' is not allowed.
I am using it in thedefault_head_blocks.xml
file
– Jonathan Marzullo
Oct 11 '17 at 12:49
Looks like this cssorder
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 indefault_head_blocks.xml
. But I can't reproduced the error you had.
– nhinzky
Oct 12 '17 at 10:06
|
show 1 more comment
2
tried above in magento 2.2 and magento threw error, soorder
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 errorException #0 (MagentoFrameworkConfigDomValidationException): Element 'css', attribute 'order': The attribute 'order' is not allowed.
I am using it in thedefault_head_blocks.xml
file
– Jonathan Marzullo
Oct 11 '17 at 12:49
Looks like this cssorder
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 indefault_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
|
show 1 more comment
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>
add a comment |
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>
add a comment |
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>
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>
answered Oct 16 '17 at 15:37
Cypher909Cypher909
2171 silver badge5 bronze badges
2171 silver badge5 bronze badges
add a comment |
add a comment |
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
add a comment |
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
add a comment |
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
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
answered Sep 1 '16 at 9:02
long thanhlong thanh
163 bronze badges
163 bronze badges
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%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
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