Skip to content
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

fix: use fixed size for time numbers #263

Merged
merged 1 commit into from
Mar 28, 2022
Merged

fix: use fixed size for time numbers #263

merged 1 commit into from
Mar 28, 2022

Conversation

ambar
Copy link
Collaborator

@ambar ambar commented Mar 28, 2022

让时间显示不再抖动,案例见:https://www.zhihu.com/zvideo/1437261125772079104 —— 从 1s 开始当前时间就在抖。

font-variant-numeric 在不变更字体的情况下,让数字有固定的尺寸。

对比 YouTube 视频时间不抖动的原因是因为它使用了定制字体("YouTube Noto", Roboto):

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/roboto/v29/KFOlCnqEu92Fr1MmSU5fBBc4AMP6lQ.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC,
  U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@ambar ambar merged commit 301c660 into zhihu:master Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants