feat: add theme and style

This commit is contained in:
2023-03-02 07:16:36 +08:00
parent 7b58fb84eb
commit 8ab55b28fe
52 changed files with 3836 additions and 5 deletions

View File

@ -0,0 +1,22 @@
// https://zhuanlan.zhihu.com/p/32746810
export default function getFontSizes(base: number) {
const fontSizes = new Array(10).fill(null).map((_, index) => {
const i = index - 1
const baseSize = base * 2.71828 ** (i / 5)
const intSize = index > 1 ? Math.floor(baseSize) : Math.ceil(baseSize)
// Convert to even
return Math.floor(intSize / 2) * 2
})
fontSizes[1] = base
return fontSizes.map(size => {
const height = size + 8
return {
size,
lineHeight: height / size
}
})
}