Magento 2 Child Theme Static Content?
I created a Magento Child Theme under 2.3.0 based on Luma.
I tested in Developer and Default Magento Mode. I expect the custom _theme.less file to be generated on the fly.
But this does not work. I have to run "php bin/magento setup:upgrade
" after every single css line change to take the changes affected in front-end.
Also there is a Child Theme based Folder in pub/static folder. Why is this created? Im running default/developer
mode so i don't expect the system to create any /pub/static/
files?
I already tried cache:flush and cache:clean.
It workes too when i change modes in magento from dev to production and visaversa.
New Info: I added a new .css File to the Theme and it works like expected. So i think the problem with the _theme.less is about the .less compiling is not working on the fly?
magento2.3.0
New contributor
add a comment |
I created a Magento Child Theme under 2.3.0 based on Luma.
I tested in Developer and Default Magento Mode. I expect the custom _theme.less file to be generated on the fly.
But this does not work. I have to run "php bin/magento setup:upgrade
" after every single css line change to take the changes affected in front-end.
Also there is a Child Theme based Folder in pub/static folder. Why is this created? Im running default/developer
mode so i don't expect the system to create any /pub/static/
files?
I already tried cache:flush and cache:clean.
It workes too when i change modes in magento from dev to production and visaversa.
New Info: I added a new .css File to the Theme and it works like expected. So i think the problem with the _theme.less is about the .less compiling is not working on the fly?
magento2.3.0
New contributor
add a comment |
I created a Magento Child Theme under 2.3.0 based on Luma.
I tested in Developer and Default Magento Mode. I expect the custom _theme.less file to be generated on the fly.
But this does not work. I have to run "php bin/magento setup:upgrade
" after every single css line change to take the changes affected in front-end.
Also there is a Child Theme based Folder in pub/static folder. Why is this created? Im running default/developer
mode so i don't expect the system to create any /pub/static/
files?
I already tried cache:flush and cache:clean.
It workes too when i change modes in magento from dev to production and visaversa.
New Info: I added a new .css File to the Theme and it works like expected. So i think the problem with the _theme.less is about the .less compiling is not working on the fly?
magento2.3.0
New contributor
I created a Magento Child Theme under 2.3.0 based on Luma.
I tested in Developer and Default Magento Mode. I expect the custom _theme.less file to be generated on the fly.
But this does not work. I have to run "php bin/magento setup:upgrade
" after every single css line change to take the changes affected in front-end.
Also there is a Child Theme based Folder in pub/static folder. Why is this created? Im running default/developer
mode so i don't expect the system to create any /pub/static/
files?
I already tried cache:flush and cache:clean.
It workes too when i change modes in magento from dev to production and visaversa.
New Info: I added a new .css File to the Theme and it works like expected. So i think the problem with the _theme.less is about the .less compiling is not working on the fly?
magento2.3.0
magento2.3.0
New contributor
New contributor
edited 2 days ago
Rimmeh
New contributor
asked Jan 15 at 14:38
RimmehRimmeh
11
11
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
When you run php bin/magento setup:upgrade
that will clear the cache for you as a part of the upgrade process, i think that is your issue here, as setup:upgrade
has nothing to do with static file in the system.
Also, no matter what mode you are in, Magento will create a /pub/static/
section as this is where files that are served directly to the browser are stored (as opposed to php files that have additional processing done on the server side). So the site seems (from your description) to be working correctly.
When you make a change to you custom _theme.less
file, if those changes are reflected in the child theme's CSS files in the pub/static
folder, then you are good to go, caching is the issue with change not showing up in the browser.
thanks for the reply, i tried to clean magento cache with cache:flush and cache:clean. Then i cleaned my browsercache and tried a differents browser too but still nothing happens. Only setup:upgrade seems to work. Im really confused about this behavior. in /pub/static/frontend/Vendorname/luma_child/de_DE/css/styles-m.css i dont see the changes that i made to /app/design/frontend/Vendorname/luma_child/web/css/source/_theme.less
– Rimmeh
2 days ago
There are other ways to set up your styles to compile, so i'm not 100% sure about the path you are trying to take. I might then be wrong andsetup:upgrade
might be doing a deploy. A few questions, is there a reason you are in default mode? and when happened when you just do aphp bin/magento setup:static-content:deploy -f
?
– circlesix
2 days ago
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
});
}
});
Rimmeh is a new contributor. Be nice, and check out our Code of Conduct.
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%2f257882%2fmagento-2-child-theme-static-content%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
When you run php bin/magento setup:upgrade
that will clear the cache for you as a part of the upgrade process, i think that is your issue here, as setup:upgrade
has nothing to do with static file in the system.
Also, no matter what mode you are in, Magento will create a /pub/static/
section as this is where files that are served directly to the browser are stored (as opposed to php files that have additional processing done on the server side). So the site seems (from your description) to be working correctly.
When you make a change to you custom _theme.less
file, if those changes are reflected in the child theme's CSS files in the pub/static
folder, then you are good to go, caching is the issue with change not showing up in the browser.
thanks for the reply, i tried to clean magento cache with cache:flush and cache:clean. Then i cleaned my browsercache and tried a differents browser too but still nothing happens. Only setup:upgrade seems to work. Im really confused about this behavior. in /pub/static/frontend/Vendorname/luma_child/de_DE/css/styles-m.css i dont see the changes that i made to /app/design/frontend/Vendorname/luma_child/web/css/source/_theme.less
– Rimmeh
2 days ago
There are other ways to set up your styles to compile, so i'm not 100% sure about the path you are trying to take. I might then be wrong andsetup:upgrade
might be doing a deploy. A few questions, is there a reason you are in default mode? and when happened when you just do aphp bin/magento setup:static-content:deploy -f
?
– circlesix
2 days ago
add a comment |
When you run php bin/magento setup:upgrade
that will clear the cache for you as a part of the upgrade process, i think that is your issue here, as setup:upgrade
has nothing to do with static file in the system.
Also, no matter what mode you are in, Magento will create a /pub/static/
section as this is where files that are served directly to the browser are stored (as opposed to php files that have additional processing done on the server side). So the site seems (from your description) to be working correctly.
When you make a change to you custom _theme.less
file, if those changes are reflected in the child theme's CSS files in the pub/static
folder, then you are good to go, caching is the issue with change not showing up in the browser.
thanks for the reply, i tried to clean magento cache with cache:flush and cache:clean. Then i cleaned my browsercache and tried a differents browser too but still nothing happens. Only setup:upgrade seems to work. Im really confused about this behavior. in /pub/static/frontend/Vendorname/luma_child/de_DE/css/styles-m.css i dont see the changes that i made to /app/design/frontend/Vendorname/luma_child/web/css/source/_theme.less
– Rimmeh
2 days ago
There are other ways to set up your styles to compile, so i'm not 100% sure about the path you are trying to take. I might then be wrong andsetup:upgrade
might be doing a deploy. A few questions, is there a reason you are in default mode? and when happened when you just do aphp bin/magento setup:static-content:deploy -f
?
– circlesix
2 days ago
add a comment |
When you run php bin/magento setup:upgrade
that will clear the cache for you as a part of the upgrade process, i think that is your issue here, as setup:upgrade
has nothing to do with static file in the system.
Also, no matter what mode you are in, Magento will create a /pub/static/
section as this is where files that are served directly to the browser are stored (as opposed to php files that have additional processing done on the server side). So the site seems (from your description) to be working correctly.
When you make a change to you custom _theme.less
file, if those changes are reflected in the child theme's CSS files in the pub/static
folder, then you are good to go, caching is the issue with change not showing up in the browser.
When you run php bin/magento setup:upgrade
that will clear the cache for you as a part of the upgrade process, i think that is your issue here, as setup:upgrade
has nothing to do with static file in the system.
Also, no matter what mode you are in, Magento will create a /pub/static/
section as this is where files that are served directly to the browser are stored (as opposed to php files that have additional processing done on the server side). So the site seems (from your description) to be working correctly.
When you make a change to you custom _theme.less
file, if those changes are reflected in the child theme's CSS files in the pub/static
folder, then you are good to go, caching is the issue with change not showing up in the browser.
answered Jan 15 at 16:36
circlesixcirclesix
2,70921546
2,70921546
thanks for the reply, i tried to clean magento cache with cache:flush and cache:clean. Then i cleaned my browsercache and tried a differents browser too but still nothing happens. Only setup:upgrade seems to work. Im really confused about this behavior. in /pub/static/frontend/Vendorname/luma_child/de_DE/css/styles-m.css i dont see the changes that i made to /app/design/frontend/Vendorname/luma_child/web/css/source/_theme.less
– Rimmeh
2 days ago
There are other ways to set up your styles to compile, so i'm not 100% sure about the path you are trying to take. I might then be wrong andsetup:upgrade
might be doing a deploy. A few questions, is there a reason you are in default mode? and when happened when you just do aphp bin/magento setup:static-content:deploy -f
?
– circlesix
2 days ago
add a comment |
thanks for the reply, i tried to clean magento cache with cache:flush and cache:clean. Then i cleaned my browsercache and tried a differents browser too but still nothing happens. Only setup:upgrade seems to work. Im really confused about this behavior. in /pub/static/frontend/Vendorname/luma_child/de_DE/css/styles-m.css i dont see the changes that i made to /app/design/frontend/Vendorname/luma_child/web/css/source/_theme.less
– Rimmeh
2 days ago
There are other ways to set up your styles to compile, so i'm not 100% sure about the path you are trying to take. I might then be wrong andsetup:upgrade
might be doing a deploy. A few questions, is there a reason you are in default mode? and when happened when you just do aphp bin/magento setup:static-content:deploy -f
?
– circlesix
2 days ago
thanks for the reply, i tried to clean magento cache with cache:flush and cache:clean. Then i cleaned my browsercache and tried a differents browser too but still nothing happens. Only setup:upgrade seems to work. Im really confused about this behavior. in /pub/static/frontend/Vendorname/luma_child/de_DE/css/styles-m.css i dont see the changes that i made to /app/design/frontend/Vendorname/luma_child/web/css/source/_theme.less
– Rimmeh
2 days ago
thanks for the reply, i tried to clean magento cache with cache:flush and cache:clean. Then i cleaned my browsercache and tried a differents browser too but still nothing happens. Only setup:upgrade seems to work. Im really confused about this behavior. in /pub/static/frontend/Vendorname/luma_child/de_DE/css/styles-m.css i dont see the changes that i made to /app/design/frontend/Vendorname/luma_child/web/css/source/_theme.less
– Rimmeh
2 days ago
There are other ways to set up your styles to compile, so i'm not 100% sure about the path you are trying to take. I might then be wrong and
setup:upgrade
might be doing a deploy. A few questions, is there a reason you are in default mode? and when happened when you just do a php bin/magento setup:static-content:deploy -f
?– circlesix
2 days ago
There are other ways to set up your styles to compile, so i'm not 100% sure about the path you are trying to take. I might then be wrong and
setup:upgrade
might be doing a deploy. A few questions, is there a reason you are in default mode? and when happened when you just do a php bin/magento setup:static-content:deploy -f
?– circlesix
2 days ago
add a comment |
Rimmeh is a new contributor. Be nice, and check out our Code of Conduct.
Rimmeh is a new contributor. Be nice, and check out our Code of Conduct.
Rimmeh is a new contributor. Be nice, and check out our Code of Conduct.
Rimmeh is a new contributor. Be nice, and check out our Code of Conduct.
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%2f257882%2fmagento-2-child-theme-static-content%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