
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
astros-svgfont
Advanced tools
svg自动合成字体中间件
本项目为Astros中间件
astros-svgfont会把img/svg目录下的svg图标生成eot,svg,ttf,woff四种字体,并自动生成对应svg名的css代码,插入到对应页面样式之前。
--assets
--svg
--icons(生成的字体名称就是目录名称,即icons)
--car.svg
--user.svg
--button
--loading.svg
根据以上目录结构,生成的字体分别icons和button
@font-face {
font-family: "icons";
src: url("/fonts/font2.eot?v=true");
src: url("/fonts/font2.eot?v=true") format("embedded-opentype"), url("/fonts/font2.woff?v=true") format("woff"), url("/fonts/font2.ttf?v=true") format("truetype"), url("/fonts/font2.svg?v=true") format("svg");
font-weight: normal;
font-style: normal;
}
.i-loading:before {
content: "\e900";
}
.i-car:before {
content: "\e605";
}
/* ICON基础类 */
.m-icon{
display: inline-block;
width: 50px;
height: 50px;
font-size: 24px;
color: #dedede;
font-family: "icons";
}
注意,这里需要你自己实现icon基类,引用对应的字体
<i class="m-icon i-loading"></i>
如果需要指定字体生成目录,可以通过 fontPath参数配置
{
name:'astros-svgfont',
config:{
fontPath:'/fonts/', //字体文件存放路径,相对于 root/asset 路径
base64:true //移动端兼容性最好,pc不建议使用
}
}
FAQs
Astro的插件。根据svg生成字体文件和引用
The npm package astros-svgfont receives a total of 7 weekly downloads. As such, astros-svgfont popularity was classified as not popular.
We found that astros-svgfont demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.