1

我们已将 Magento 版本从 2.3.4 升级到 2.4.2,在执行部署命令时,我们面临以下错误:

frontend/Magento/louellabelle/en_GB     3349/3580           ==========================>- 93%    12 secs
Compilation from source: /var/www/vhosts/lbstaging.com/htdocs/vendor/magento/theme-frontend-blank/web/css/styles-m.less
No matching definition was found for `@family-name:'icons-blank-theme', @font-path:"../fonts/Blank-Theme-Icons/Blank-Theme-Icons", @font-weight:normal, @font-style:normal, @font-display:block` in _icons.less on line 7, column 5
05| 
06| & when (@media-common = true) {
07|     .lib-font-face(

我们还尝试将以下代码添加到我们的自定义 css 中:

@font-face {
  font-family: 'icons-blank-theme';
  src: url('../fonts/Blank-Theme-Icons/Blank-Theme-Icons.woff2') format('woff2'), url('../fonts/Blank-Theme-Icons/Blank-Theme-Icons.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}

因此我们已经在 magento 基本位置有了文件:

pub/static/frontend/Magento/louellabelle_new/en_GB/fonts/Blank-Theme-Icons

vendor/magento/magento2-base/lib/web/fonts/Blank-Theme-Icons
4

1 回答 1

0

您需要使用 2.4.2 中添加的最新变量更新您的 .less 文件

检查如何在供应商中为此文件设置在 dicompile 错误中显示的变量:

_typography.less 样式-m.less

电子邮件字体.less

样式-m.min.css

覆盖这些文件时更新设计目录中的变量。跑

rm -rf var/cache/* var/page_cache/* pub/static/* var/view_preprocessed/*

bin/magento setup:upgrade && bin/magento setup:static-content:deploy && bin/magento setup:di:compile

于 2021-12-31T02:10:41.067 回答