mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-05 07:56:15 +02:00
feat: setup resource title & extract necessary helpers
This commit is contained in:
@@ -5,6 +5,24 @@ export const BASE_FONT_SIZE = 18
|
||||
export const BASE_LINE_HEIGHT = 25
|
||||
export const MODULAR_SCALE = 1.1487
|
||||
|
||||
function modularFontSize(power: number) {
|
||||
return BASE_FONT_SIZE * Math.pow(MODULAR_SCALE, power)
|
||||
}
|
||||
|
||||
export function modularScale(power: number) {
|
||||
const fontSize = modularFontSize(power)
|
||||
|
||||
// attempt to fit line-height a little larger than font-size
|
||||
const paddedLineHeight = fontSize * 1.1
|
||||
const lineHeight =
|
||||
paddedLineHeight - (paddedLineHeight % BASE_LINE_HEIGHT) + BASE_LINE_HEIGHT
|
||||
|
||||
return {
|
||||
fontSize,
|
||||
lineHeight,
|
||||
}
|
||||
}
|
||||
|
||||
export const fontFamily = {
|
||||
header: FONT_MONTSERRAT,
|
||||
body: FONT_OXYGEN,
|
||||
|
||||
Reference in New Issue
Block a user