Hello i had upgraded magento 2.2.2 to 2.3.0 and i am getting following error when i do setup:static-content:deploy

Compilation from source: /home/xxxxxxxx/public_html/xxxx/xxxxxx/vendor/magento/theme-frontend-blank/web/css/styles-m.less
variable @button-primary__font-family is undefined in file /home/xxxxx/public_html/xxxxx/xxxxx/var/view_preprocessed/pub/static/frontend/xxxxx/xxxxx/en_US/css/source/lib/_buttons.less in _buttons.less on line 279, column 27
278| .lib-button-primary(
279|     @_button-font-family: @button-primary__font-family,
280|     @_button-font-size: @button-primary__font-size,
281|     @_button-font-weight: @button-primary__font-weight,
282|     @_button-line-height: @button-primary__line-height, in _extends.less

In File.php line 150:

  The contents from the "/home/xxxxx/public_html/xxxxx/xxxxx/pub/static/frontend/xxxxx/xxxxx/en_US/css/styles-m.css" file can't be read. Warn
  ing!file_get_contents(/home/xxxxx/public_html/alpha/xxxxx/pub/static/frontend/xxxxx/xxxxx/en_US/css/styles-m.css): failed to open stream: N
  o such file or directory

Please help me

1 Answer 1


It looks like an issue with the CSS in your custom theme. Magento is unable to find the variables declared in variables/_buttons.less.

You can check if you're overwriting the file in app/design/frontend/NAMESPACE/THEME/web/css/source/variables/_buttons.less

If your theme is overwriting the file, you'll need to make sure your CSS has all the variables declared that Magento requires.

//  Primary button
@button-primary__font-family: @button__font-family;
@button-primary__font-size: @button__font-size;
@button-primary__font-weight: @button__font-weight;
@button-primary__line-height: false;
@button-primary__width: false;
@button-primary__margin: false;
@button-primary__padding: @button__padding;
@button-primary__gradient: false;
@button-primary__gradient-direction: false;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.