@styled-system/position
Advanced tools
Comparing version 5.0.12 to 5.0.14
{ | ||
"name": "@styled-system/position", | ||
"version": "5.0.12", | ||
"version": "5.0.14", | ||
"main": "dist/index.js", | ||
@@ -14,3 +14,3 @@ "module": "dist/index.esm.js", | ||
}, | ||
"gitHead": "64f48fd0586230324d1a3943dc56257699a8b9ef" | ||
"gitHead": "0a42765abf8d3183aa7b79b527118db86788eb90" | ||
} |
import { system } from '@styled-system/core' | ||
const defaults = { | ||
space: [0, 4, 8, 16, 32, 64, 128, 256, 512], | ||
} | ||
const config = { | ||
@@ -9,6 +13,22 @@ position: true, | ||
}, | ||
top: true, | ||
right: true, | ||
bottom: true, | ||
left: true, | ||
top: { | ||
property: 'top', | ||
scale: 'space', | ||
defaultScale: defaults.space, | ||
}, | ||
right: { | ||
property: 'right', | ||
scale: 'space', | ||
defaultScale: defaults.space, | ||
}, | ||
bottom: { | ||
property: 'bottom', | ||
scale: 'space', | ||
defaultScale: defaults.space, | ||
}, | ||
left: { | ||
property: 'left', | ||
scale: 'space', | ||
defaultScale: defaults.space, | ||
}, | ||
} | ||
@@ -15,0 +35,0 @@ |
@@ -15,1 +15,21 @@ import position from '../src' | ||
}) | ||
test('returns theme values', () => { | ||
const style = position({ top: 1, right: 2, bottom: 3, left: 4 }) | ||
expect(style).toEqual({ top: 4, right: 8, bottom: 16, left: 32 }) | ||
}) | ||
test('returns pixel values', () => { | ||
const style = position({ | ||
top: '1px', | ||
right: '2px', | ||
bottom: '3px', | ||
left: '4px', | ||
}) | ||
expect(style).toEqual({ | ||
top: '1px', | ||
right: '2px', | ||
bottom: '3px', | ||
left: '4px', | ||
}) | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3421
96