magento2: Missing variable for copyright background color in _module.less
Since upgrading to Magento 2.2.1 from 2.0.7 compilation of _module.less fails as there is a missing variable for @copyright__background-color
Preconditions
- Magento 2.2.1
- PHP 7
Steps to reproduce
Try and compile CSS
Expected result
Compilation should work
Actual result
variable @copyright__background-color is undefined in file /var/www/html/magento2/var/view_preprocessed/pub/static/frontend/GM/gm/en_GB/Magento_Theme/css/source/_module.less in _module.less on line 439, column 40 437| body { 438| .ie9 & { 439| .lib-css(background-color, @copyright__background-color); 440| } 441| } 442| in _responsive.less
Fix
Add a variable:
@copyright__background-color: @color-gray-middle4;
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 5
- Comments: 18 (3 by maintainers)
Had the same issue today. I have copied only the following line to the app\design\frontend{Vendor}{currentThemeName}\web\css\source_theme.less
@copyright__background-color: @color-gray-middle4;
Copy
_extends.less
and_theme.less
fromvendor\magento\theme-frontend-luma\web\css\source\
toapp\design\frontend\{Vendor}\{currentThemeName}\web\css\source\
Clear the content of
pub/static
andvar/view_preprocessed
except.htaccess
Clean the cache:
php bin/magento cache:clean
Compile :
php bin/magento setup:static-content:deploy -f
Same problem, Magento 2.2.2 fresh install
I’m on 2.3.3 and I have a very simple child theme that extends luma. I have a blank _theme.less and _extends.less and I ran into the same error with the copyright background color. Running setup:upgrade fixed the issue for me. I’m not sure if that will help anyone else but I thought I would post it here just in case.
Same problem in 2.2.4 when running
php bin/magento setup:static-content:deploy -f
But when I run with specified language (en_GB) it deploys the static content without issue:
php bin/magento setup:static-content:deploy en_GB -f
@magento-engcom-team new installation 2.2.2 I am having this issue with a custom theme but not on Luma …/themeName/en_GB/css/styles-m.css 404 …/themeName/en_GB/css/styles-l.css 404
try to force php bin/magento setup:static-content:deploy en_GB -f
what’s the fix?
this helped me https://github.com/magento/magento2/issues/8377
Same problem, Magento 2.2.1
Any idea why it happened on my version of Magento 2.2.1 then?
@pixel-paul, thank you for your report. The issue is already fixed in 2.2.1