Skeleton Component

This commit is contained in:
Belen Curcio
2020-10-15 11:10:07 -03:00
parent 3b7b71422c
commit bf1ffcace9
9 changed files with 163 additions and 15 deletions

13
lib/to-pixels.ts Normal file
View File

@@ -0,0 +1,13 @@
// Convert numbers or strings to pixel value
// Helpful for styled-jsx when using a prop
// height: ${toPixels(height)}; (supports height={20} and height="20px")
const toPixels = (value: string | number) => {
if (typeof value === 'number') {
return `${value}px`
}
return value
}
export default toPixels