Magento 2 Component less/css editing best practicesEdit CSS/LESS problemsMagento 2.1 LESS compilation issuesMagento 2 - Magento 2 - Why is less file loading first? Need it to load after css filesBest way to extend module less found in web/css/source/module, like _minicart.less?Can edit .less and .css file though FTP?Using LESS variables in extended LESS file Magento 2Magento 2 Load _extend.less lastWhich css format is best for Magento 2 theme?How to edit .less or css filesMagento 2 What is the best practices to override the luma theme
What are the basics of commands in Minecraft Java Edition?
How fast does a character need to move to be effectively invisible?
Is this artwork (used in a video game) real?
What is the difference between a Hosaka, Ono-Sendai, and a "deck"?
Wordplay subtraction paradox
What is the meaning of [[:space:]] in bash?
How can a drink contain 1.8 kcal energy while 0 g fat/carbs/protein?
How should one refer to knights (& dames) in academic writing?
What would be the safest way to drop thousands of small, hard objects from a typical, high wing, GA airplane?
Why is the total probability theorem expressed in this way?
What "fuel more powerful than anything the West (had) in stock" put Laika in orbit aboard Sputnik 2?
Why is Google approaching my VPS machine?
Vienna To Graz By Rail
How can the electric potential be zero at a point where the electric field isn't, if that field can give a test charge kinetic energy?
What were the problems on the Apollo 11 lunar module?
Is it okay for a chapter's POV to shift as it progresses?
Improve quality of image bars
Did 007 exist before James Bond?
Cauchy reals and Dedekind reals satisfy "the same mathematical theorems"
Coverting list of string into integers and reshaping the original list
Generating a PIN from cryptographic bytes
How to honestly answer questions from a girlfriend like "How did you find this place" without giving the impression I'm always talking about my exes?
Was Jacobi the first to notice the ambiguity in the partial derivatives notation? And did anyone object to his fix?
Why do so many pure math PhD students drop out or leave academia, compared to applied mathematics PhDs?
Magento 2 Component less/css editing best practices
Edit CSS/LESS problemsMagento 2.1 LESS compilation issuesMagento 2 - Magento 2 - Why is less file loading first? Need it to load after css filesBest way to extend module less found in web/css/source/module, like _minicart.less?Can edit .less and .css file though FTP?Using LESS variables in extended LESS file Magento 2Magento 2 Load _extend.less lastWhich css format is best for Magento 2 theme?How to edit .less or css filesMagento 2 What is the best practices to override the luma theme
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Please help to understand below 2:
1. How to override component css using less files?
2. Is anyone can provide some of examples to write css in _extend.less file.
magento2 frontend less less-css
add a comment |
Please help to understand below 2:
1. How to override component css using less files?
2. Is anyone can provide some of examples to write css in _extend.less file.
magento2 frontend less less-css
add a comment |
Please help to understand below 2:
1. How to override component css using less files?
2. Is anyone can provide some of examples to write css in _extend.less file.
magento2 frontend less less-css
Please help to understand below 2:
1. How to override component css using less files?
2. Is anyone can provide some of examples to write css in _extend.less file.
magento2 frontend less less-css
magento2 frontend less less-css
asked Jul 9 at 6:04
Kamlesh YaduwanshiKamlesh Yaduwanshi
265 bronze badges
265 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You can add in your theme app/design/fronted/PackageTheme/YourTheme/Aheadworks/Autorelated/web/css, and copy the CSS file from app/code/Aheadworks/Autorelated/view/frontend/web/css, and there you can change it.
For edit in LESS file, you must add _module.less file in this path app/code/Aheadworks/Autorelated/view/frontend/web/css/source and you can also copy the CSS content from CSS files in _module.less and you can edit.
After that you must run php bin/magento setup:static-content:deploy
Best Practice:
You should not edit/modify files within pub/* or vendor/* directory. Pub is for deployment and vendor is for default structure, which you override via your template or custom modules. Instead:
- create a new theme inside app/design/frontend/vendor/yourTheme/. You can use Blank or Luma theme. You can also create new theme which inherites from Blank (inheritance is defined within theme.xml). If you are already using some theme then skip this step.
- edit .less within your theme so the changes stay visible and don't get replaced when clearing the cache or upgrading the system.
- Use grunt to compile your .less into deployment files.
- You can also setup sourcemaps to pin point your styling within the theme .less files so you can be more productive.
I hope this will help
My question is slightly different. Actually I am overriding the luma theme as per best practices as suggested in official docs. Trying to get further understanding on luma theme less file editing. For example if I need navigation css changes, what should be the best practices. Should I directly add the css or I need to change the mixin/variables codes. Just trying to best way of theme css editing.
– Kamlesh Yaduwanshi
Jul 9 at 6:21
@KamleshYaduwanshi I add more detail in the answer, hope this will help you and other readers
– Muhammad Hasham
Jul 9 at 6:26
I am following all these best practices, just wants to know whether I edit the less codes mixing and variables or write regular css.
– Kamlesh Yaduwanshi
Jul 9 at 6:31
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%2f281289%2fmagento-2-component-less-css-editing-best-practices%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
You can add in your theme app/design/fronted/PackageTheme/YourTheme/Aheadworks/Autorelated/web/css, and copy the CSS file from app/code/Aheadworks/Autorelated/view/frontend/web/css, and there you can change it.
For edit in LESS file, you must add _module.less file in this path app/code/Aheadworks/Autorelated/view/frontend/web/css/source and you can also copy the CSS content from CSS files in _module.less and you can edit.
After that you must run php bin/magento setup:static-content:deploy
Best Practice:
You should not edit/modify files within pub/* or vendor/* directory. Pub is for deployment and vendor is for default structure, which you override via your template or custom modules. Instead:
- create a new theme inside app/design/frontend/vendor/yourTheme/. You can use Blank or Luma theme. You can also create new theme which inherites from Blank (inheritance is defined within theme.xml). If you are already using some theme then skip this step.
- edit .less within your theme so the changes stay visible and don't get replaced when clearing the cache or upgrading the system.
- Use grunt to compile your .less into deployment files.
- You can also setup sourcemaps to pin point your styling within the theme .less files so you can be more productive.
I hope this will help
My question is slightly different. Actually I am overriding the luma theme as per best practices as suggested in official docs. Trying to get further understanding on luma theme less file editing. For example if I need navigation css changes, what should be the best practices. Should I directly add the css or I need to change the mixin/variables codes. Just trying to best way of theme css editing.
– Kamlesh Yaduwanshi
Jul 9 at 6:21
@KamleshYaduwanshi I add more detail in the answer, hope this will help you and other readers
– Muhammad Hasham
Jul 9 at 6:26
I am following all these best practices, just wants to know whether I edit the less codes mixing and variables or write regular css.
– Kamlesh Yaduwanshi
Jul 9 at 6:31
add a comment |
You can add in your theme app/design/fronted/PackageTheme/YourTheme/Aheadworks/Autorelated/web/css, and copy the CSS file from app/code/Aheadworks/Autorelated/view/frontend/web/css, and there you can change it.
For edit in LESS file, you must add _module.less file in this path app/code/Aheadworks/Autorelated/view/frontend/web/css/source and you can also copy the CSS content from CSS files in _module.less and you can edit.
After that you must run php bin/magento setup:static-content:deploy
Best Practice:
You should not edit/modify files within pub/* or vendor/* directory. Pub is for deployment and vendor is for default structure, which you override via your template or custom modules. Instead:
- create a new theme inside app/design/frontend/vendor/yourTheme/. You can use Blank or Luma theme. You can also create new theme which inherites from Blank (inheritance is defined within theme.xml). If you are already using some theme then skip this step.
- edit .less within your theme so the changes stay visible and don't get replaced when clearing the cache or upgrading the system.
- Use grunt to compile your .less into deployment files.
- You can also setup sourcemaps to pin point your styling within the theme .less files so you can be more productive.
I hope this will help
My question is slightly different. Actually I am overriding the luma theme as per best practices as suggested in official docs. Trying to get further understanding on luma theme less file editing. For example if I need navigation css changes, what should be the best practices. Should I directly add the css or I need to change the mixin/variables codes. Just trying to best way of theme css editing.
– Kamlesh Yaduwanshi
Jul 9 at 6:21
@KamleshYaduwanshi I add more detail in the answer, hope this will help you and other readers
– Muhammad Hasham
Jul 9 at 6:26
I am following all these best practices, just wants to know whether I edit the less codes mixing and variables or write regular css.
– Kamlesh Yaduwanshi
Jul 9 at 6:31
add a comment |
You can add in your theme app/design/fronted/PackageTheme/YourTheme/Aheadworks/Autorelated/web/css, and copy the CSS file from app/code/Aheadworks/Autorelated/view/frontend/web/css, and there you can change it.
For edit in LESS file, you must add _module.less file in this path app/code/Aheadworks/Autorelated/view/frontend/web/css/source and you can also copy the CSS content from CSS files in _module.less and you can edit.
After that you must run php bin/magento setup:static-content:deploy
Best Practice:
You should not edit/modify files within pub/* or vendor/* directory. Pub is for deployment and vendor is for default structure, which you override via your template or custom modules. Instead:
- create a new theme inside app/design/frontend/vendor/yourTheme/. You can use Blank or Luma theme. You can also create new theme which inherites from Blank (inheritance is defined within theme.xml). If you are already using some theme then skip this step.
- edit .less within your theme so the changes stay visible and don't get replaced when clearing the cache or upgrading the system.
- Use grunt to compile your .less into deployment files.
- You can also setup sourcemaps to pin point your styling within the theme .less files so you can be more productive.
I hope this will help
You can add in your theme app/design/fronted/PackageTheme/YourTheme/Aheadworks/Autorelated/web/css, and copy the CSS file from app/code/Aheadworks/Autorelated/view/frontend/web/css, and there you can change it.
For edit in LESS file, you must add _module.less file in this path app/code/Aheadworks/Autorelated/view/frontend/web/css/source and you can also copy the CSS content from CSS files in _module.less and you can edit.
After that you must run php bin/magento setup:static-content:deploy
Best Practice:
You should not edit/modify files within pub/* or vendor/* directory. Pub is for deployment and vendor is for default structure, which you override via your template or custom modules. Instead:
- create a new theme inside app/design/frontend/vendor/yourTheme/. You can use Blank or Luma theme. You can also create new theme which inherites from Blank (inheritance is defined within theme.xml). If you are already using some theme then skip this step.
- edit .less within your theme so the changes stay visible and don't get replaced when clearing the cache or upgrading the system.
- Use grunt to compile your .less into deployment files.
- You can also setup sourcemaps to pin point your styling within the theme .less files so you can be more productive.
I hope this will help
edited Jul 9 at 6:25
answered Jul 9 at 6:09
Muhammad HashamMuhammad Hasham
5,53910 gold badges31 silver badges80 bronze badges
5,53910 gold badges31 silver badges80 bronze badges
My question is slightly different. Actually I am overriding the luma theme as per best practices as suggested in official docs. Trying to get further understanding on luma theme less file editing. For example if I need navigation css changes, what should be the best practices. Should I directly add the css or I need to change the mixin/variables codes. Just trying to best way of theme css editing.
– Kamlesh Yaduwanshi
Jul 9 at 6:21
@KamleshYaduwanshi I add more detail in the answer, hope this will help you and other readers
– Muhammad Hasham
Jul 9 at 6:26
I am following all these best practices, just wants to know whether I edit the less codes mixing and variables or write regular css.
– Kamlesh Yaduwanshi
Jul 9 at 6:31
add a comment |
My question is slightly different. Actually I am overriding the luma theme as per best practices as suggested in official docs. Trying to get further understanding on luma theme less file editing. For example if I need navigation css changes, what should be the best practices. Should I directly add the css or I need to change the mixin/variables codes. Just trying to best way of theme css editing.
– Kamlesh Yaduwanshi
Jul 9 at 6:21
@KamleshYaduwanshi I add more detail in the answer, hope this will help you and other readers
– Muhammad Hasham
Jul 9 at 6:26
I am following all these best practices, just wants to know whether I edit the less codes mixing and variables or write regular css.
– Kamlesh Yaduwanshi
Jul 9 at 6:31
My question is slightly different. Actually I am overriding the luma theme as per best practices as suggested in official docs. Trying to get further understanding on luma theme less file editing. For example if I need navigation css changes, what should be the best practices. Should I directly add the css or I need to change the mixin/variables codes. Just trying to best way of theme css editing.
– Kamlesh Yaduwanshi
Jul 9 at 6:21
My question is slightly different. Actually I am overriding the luma theme as per best practices as suggested in official docs. Trying to get further understanding on luma theme less file editing. For example if I need navigation css changes, what should be the best practices. Should I directly add the css or I need to change the mixin/variables codes. Just trying to best way of theme css editing.
– Kamlesh Yaduwanshi
Jul 9 at 6:21
@KamleshYaduwanshi I add more detail in the answer, hope this will help you and other readers
– Muhammad Hasham
Jul 9 at 6:26
@KamleshYaduwanshi I add more detail in the answer, hope this will help you and other readers
– Muhammad Hasham
Jul 9 at 6:26
I am following all these best practices, just wants to know whether I edit the less codes mixing and variables or write regular css.
– Kamlesh Yaduwanshi
Jul 9 at 6:31
I am following all these best practices, just wants to know whether I edit the less codes mixing and variables or write regular css.
– Kamlesh Yaduwanshi
Jul 9 at 6:31
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%2f281289%2fmagento-2-component-less-css-editing-best-practices%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