Skip to content

Commit

Permalink
feat: add em2Px function
Browse files Browse the repository at this point in the history
  • Loading branch information
wewoor committed Nov 20, 2020
1 parent 6393959 commit 58c8e3f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/common/css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

/**
* px = em * parentElementFontSize
* @param em em value
* TODO: Use Template Literal Types replace fontSize typing
*/
export function em2Px(em: number, fontSize: number): number {
return em * fontSize;
}

0 comments on commit 58c8e3f

Please sign in to comment.