css 撇号错误 - ui,解决它的最佳方法?

css errors in apostrophe-ui, best approach to solve it?

我 运行 我的博客通过 CSS 验证器,发现一些开箱即用的字体没有被正确定义,具体来说,这是在 apostrophe/lib/modules/apostrophe-ui/public/css/global/fonts.less

@apos-ui-font-path: '/modules/apostrophe-ui/fonts/';

.apos-add-font('roboto', @apos-ui-font-path + 'roboto-regular-webfont');
.apos-add-font('roboto', @apos-ui-font-path + 'roboto-light-webfont', normal, 300);
.apos-add-font('roboto', @apos-ui-font-path + 'roboto-bold-webfont', normal, 500);

.apos-add-font('karla', @apos-ui-font-path + 'karla-regular-webfont');
.apos-add-font('karla', @apos-ui-font-path + 'karla-bold-webfont', normal, 700);

使用变量在路径中添加了一个space,此外,compiled/minified css 文件中还有一些额外的''。就像下面一行:

src: url(''/modules/apostrophe-ui/fonts/' 'roboto-regular-webfont'.eot');

为了解决这个问题,我不得不停止使用路径变量,如下所示:

.apos-add-font('roboto', '/modules/apostrophe-ui/fonts/roboto-regular-webfont');
.apos-add-font('roboto', '/modules/apostrophe-ui/fonts/roboto-light-webfont', normal, 300);
.apos-add-font('roboto', '/modules/apostrophe-ui/fonts/roboto-bold-webfont', normal, 500);

.apos-add-font('karla', '/modules/apostrophe-ui/fonts/karla-regular-webfont');
.apos-add-font('karla', '/modules/apostrophe-ui/fonts/karla-bold-webfont', normal, 700);

此外,将 apostrophe-ui 文件夹移动到我自己的 lib 文件夹导致重复 css,所以我在 node_modules 中对原始文件夹进行了更改,但这意味着所有更改都将在下一次 npm 更新中被覆盖。是否可以从 node_modules 中删除模块以避免重复的 css 代码?

您好,感谢您提出这个问题。看起来将字符串变量与另一个字符串连接的正确方法如下所示 https://github.com/apostrophecms/apostrophe/pull/1604/files

新生成的 CSS 通过验证器的(那部分):)

这应该是下一个版本的一部分