Skip to content

Commit

Permalink
feat(util-helpers): add pixelToRem()
Browse files Browse the repository at this point in the history
  • Loading branch information
jraff committed Jan 15, 2021
1 parent bf1a428 commit 39b8594
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
export { default as getCopy } from './getCopy'
export { default as uniqueId } from './uniqueId'
export { default as safeRest } from './safeRest'
export { default as pixelToRem } from './pixelToRem'
export { default as DependentIconSizeContext } from './DependentIconSizeContext'
export {
default as generateResponsiveStyles,
Expand Down
7 changes: 7 additions & 0 deletions packages/helpers/pixelToRem.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const BASE_FONT_SIZE = 16

const pixelToRem = pixel => {
return `${pixel / BASE_FONT_SIZE}rem`
}

export default pixelToRem

0 comments on commit 39b8594

Please sign in to comment.