[PostCss] Easily Load Google Fonts with PostCSS Font Magician
Google with load font
2023-09-14 09:00:50 时间
Configuring Google Fonts can be quite an annoying process to setup. Using Font Magician with PostCSS allows you simply generate proper @font-face declarations simply by writing the Google Font that you're expecting. Want Merriweather? Simply type font-family: "Merriweather"
and Font Magician will generate everything you need.
Install:
npm i poi postcss postcss-font-magician -D
Config:
const magician = require('postcss-font-magician'); module.exports = { plugins: [ magician({ variants: { 'Merriweather': { '300': [], '400': [] }, 'Nunito': { '300': [], '400': [] } } }) ] };
Use:
* { font-family: "Merriweather"; } h1 { font-family: 'Nunito'; }
Build:
poi build
After build, we will get css file, which can be used in your project
相关文章
- Google I/O 2022: 促进知识和计算机技术发展
- google glass发布首次软件更新
- 国内如何使用谷歌(google)搜索引擎进行搜索?
- 顶!强制复活Google!!
- Mac电脑解决Google翻译失效实用方法
- 【Android 内存优化】Bitmap 硬盘缓存 ( Google 官方 Bitmap 示例 | DiskLruCache 开源库 | 代码示例 )
- 【错误记录】Google Play 上架报错 ( APK 大小 | 目标 API 级别 | Google Play 帮助文档 )
- Google 推出网页加速优化扩展:Page Speed
- Google Chrome 在浏览器市场表现优异 继续拉开对手
- Google云服务为Docker应用提供简化版Ubuntu
- Google Talk是Google 的即时通讯方式,简称Gtalk。它可以进行文字 google talk聊天以及电脑对电脑的语音连接通话。Google此举进一步激化了它和雅虎,微软以及美国在线之间的竞争
- 分析学习Oracle深入理解使用With 分析(oracle使用with)
- MySQL查询优化使用WITH子句的限制与替代方案(mysql不能用with)