Deepak
Deepak

Reputation: 11

variable @theme__color__primary-alt is undefined

while compiling, using php bin/magento setup:static-content:deploy -f

I am getting the below error

Deploy using quick strategy
frontend/Magento/blank/en_US            2388/2778           
========================>--- 85% %   2 secs

Compilation from source: /var/www/html/vendor/magento/theme- 
frontend-blank/web/css/styles-m.less

variable @theme__color__primary-alt is undefined in 

file var/www/html/var/view_preprocessed/pub/static/frontend/Magento/b lank/en_US/Magento_Braintree/css/source/_module.less in _module.less on line 13, column 26 11| 12| @braintree-error__color: @message-error__color; 13| @braintree-focus__color: @theme__color__primary-alt; 14| @braintree-success__color: @message-success__color; 15|

frontend/Magento/blank/en_US            2695/2778           
===========================> 97% %   3 secs

Compilation from source: /var/www/html/vendor/magento/theme- 
frontend-blank/web/css/styles-l.less

variable @theme__color__primary-alt is undefined in filevar/www/html/var/view_preprocessed/pub/static/frontend/Magento/bla 
nk/en_US/Magento_Braintree/css/source/_module.less in _module.less 
on line 13, column 26
11| 
12| @braintree-error__color: @message-error__color;
13| @braintree-focus__color: @theme__color__primary-alt;
14| @braintree-success__color: @message-success__color;
15| 
16| @braintree-paypal-icon__height: 16px;

In File.php line 151:

The contents from the 
"/var/www/html/pub/static/frontend/Magento/blank/en_US/css/styles- 
m.css" file can't be read. 

Warning!file_get_contents(/var/www/html/pub/static/front  
end/Magento/blank/en_US/css/styles-m.css): failed to open stream: 
No such file or directory 

I have installed a theme.

Upvotes: 1

Views: 2322

Answers (1)

It seems your local theme overrides the base theme _colors.less file (Developer must have copy pasted this while he creates his own theme for magento. /vendor/magento/magento2-base/lib/web/css/source/lib/variables/_colors.less). Two way you could approach this.

  1. You can _extend.less in your theme rather than copy pasting all the theme files to your own theme.
  2. You can compare, check and copy the new variables from the upgraded version to your own theme.

Upvotes: 0

Related Questions