Skip to content

Commit

Permalink
feat(hiccup-css): add more unit types, update px/ms
Browse files Browse the repository at this point in the history
- add rad(), turn()
- force int values for px()/ms()
  • Loading branch information
postspectacular committed Mar 5, 2018
1 parent 02bff87 commit 787d0ab
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/hiccup-css/src/units.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ export const em = (x: number) => `${x}em`;
export const ex = (x: number) => `${x}ex`;
export const rem = (x: number) => `${x}rem`;
export const percent = (x: number) => `${x}%`;
export const px = (x: number) => `${x}px`;
export const px = (x: number) => `${x >>> 0}px`;
export const vh = (x: number) => `${x}vh`;
export const vw = (x: number) => `${x}vw`;

export const ms = (x: number) => `${x}ms`;
export const ms = (x: number) => `${x >>> 0}ms`;
export const sec = (x: number) => `${x}s`;

export const deg = (x: number) => `${x}deg`;
export const rad = (x: number) => `${x}rad`;
export const turn = (x: number) => `${x}turn`;

0 comments on commit 787d0ab

Please sign in to comment.