-
-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
生成多余的css icon-class #4
Comments
github的回复把标签吞掉了。。 第二个svgtofont执行目录的svg: |
@kallsave 我看了css不会污染 不会污染啊,生成两个目录,用的不同的字体前缀 @font-face {font-family: "svgtofont";
src: url('svgtofont.eot?t=1542855071459'); /* IE9*/
src: url('svgtofont.eot?t=1542855071459#iefix') format('embedded-opentype'), /* IE6-IE8 */
url("svgtofont.woff2?t=1542855071459") format("woff2"),
url("svgtofont.woff?t=1542855071459") format("woff"),
url('svgtofont.ttf?t=1542855071459') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
url('svgtofont.svg?t=1542855071459#svgtofont') format('svg'); /* iOS 4.1- */
}
[class^="svgtofont-"], [class*=" svgtofont-"] {
font-family: 'svgtofont' !important;
font-size:16px;
font-style:normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
:global {
.svgtofont-git:before { content: "\ea01"; }
.svgtofont-stylelint:before { content: "\ea02"; }
} |
@jaywcjlove 根据文件夹的名称可以做到污染 但是有一丢丢小问题 能解决最好 |
@jaywcjlove 根据文件夹的名称可以做到不污染 |
这个回头有空我研究一下,分文件夹应该没有毛病 |
应该修复了的吧 #17 @AirttaryuZCF |
好了 感谢 @jaywcjlove @AirttaryuZCF |
我想一个页面或者是组件用一个font-family,这样不会污染全局的icon-class
第一个svgtofont执行目录的css:
第二个svgtofont执行目录的css:
第二个目录的css的
.w-page-icon-pause:before { content: "\ea01"; }
其实是上一个执行目录的在生成fonts文件中,我已经用
async/await
语法隔离了执行顺序,保证一个svgtofont
执行完成下个svgtofont才会执行,事实上,生成的svg文件是正确的第一个svgtofont执行目录的svg:
第二个svgtofont执行目录的svg:
所以定位到是svgtofont的问题,不是我写的生成脚本有问题
脚本地址: https://github.com/kallsaver/my-learn/blob/master/vue-anime-learn/build/svgtofont.js
项目地址: https://github.com/kallsaver/my-learn/blob/master/vue-anime-learn
The text was updated successfully, but these errors were encountered: