Skip to content

Commit c9e291e

Browse files
committed
feat: add em2Px function
1 parent b7f42f7 commit c9e291e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/common/css.ts

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
/**
3+
* px = em * parentElementFontSize
4+
* @param em em value
5+
* TODO: Use Template Literal Types replace fontSize typing
6+
*/
7+
export function em2Px(em: number, fontSize: number): number {
8+
return em * fontSize;
9+
}

0 commit comments

Comments
 (0)