New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

postcss-pingfang

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-pingfang

优化 PingFang SC 在安卓机型下的表现

latest
Source
npmnpm
Version
0.0.4
Version published
Maintainers
1
Created
Source

postcss-pingfang

优化 PingFang SC 在安卓机型下的表现

动机

设计同学使用 PingFang SC 作为设计稿默认字体,这会带来以下的问题:

  • PingFang SC 并非安卓手机的内置字体,可以使用 font-weight 替换原设计稿中的字体,如 PingFangSC-Medium 替换为 500。
  • 但大部分安卓手机内置的字体仅对中文支持 3 种字重,此时如 font-weight 为 500 的字体实际上并不会被加粗。

而该插件将在 iOS 手机上使用 PingFangSC-Medium,在安卓手机上使用 font-weight: 700。

安装

npm install postcss-pingfang

使用

// dependencies
const fs = require('fs')
const postcss = require('postcss')
const pingfang = require('postcss-pingfang')

// css to be processed
const css = fs.readFileSync('input.css', 'utf8')

// process css
const output = postcss()
  .use(pingfang())
  .process(css)
  .css

Keywords

css

FAQs

Package last updated on 05 Aug 2023

Did you know?

Socket

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.

Install

Related posts