Socket
Book a DemoInstallSign in
Socket

@tslsmart/font-fix

Package Overview
Dependencies
Maintainers
3
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tslsmart/font-fix

修复汉字字体居中问题的库

0.1.0
latest
npmnpm
Version published
Weekly downloads
0
Maintainers
3
Weekly downloads
 
Created
Source

字体居中问题

在使用诸如汉仪旗黑(HYQiHei)等字体时,由于字体本身构造特殊,导致我们在使用时,无法正确地在垂直方向居中,本库即是为了解决这个问题。

安装

推荐使用pnpm安装

pnpm i @tslsmart/font-fix

引入

在入口文件中导入

// main.js中
import '@tslsmart/font-fix'

使用

默认支持对el-button按钮自动修复垂直居中问题。

在编写其他需要居中的样式时,可以给元素加上font-fix类名来修复垂直居中问题。

默认使用HYQiHei的参数进行居中修复。如果你使用其他字体,发现font-fix无法垂直居中,你可以尝试修改css变量--tsl-font-mb以及--tsl-font-mt的值来调整。

你可以从这里获取更准确的变量值

Keywords

font

FAQs

Package last updated on 16 Sep 2022

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.