Skip to content

Commit

Permalink
fix: fix rpxTransformer => rpxTransformers
Browse files Browse the repository at this point in the history
  • Loading branch information
gregberge committed Jul 9, 2019
1 parent 21703e4 commit 2658a07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/system/src/transformers.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { num } from './util'
import { remPx, rpx } from './unit'

export const rpxTransformer = {
export const rpxTransformers = {
px: value => remPx(rpx(value)),
border: n => (num(n) && n > 0 ? `${remPx(n)} solid` : n),
}
6 changes: 3 additions & 3 deletions packages/system/src/transformers.test.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { th } from './th'
import { rpxTransformer } from './transformers'
import { rpxTransformers } from './transformers'

describe('#rpxTransformer', () => {
describe('#rpxTransformers', () => {
it('should use rem instead of px', () => {
const baseProps = { theme: { transformers: {} } }
expect(th.space(1)(baseProps)).toBe('4px')
expect(th.space(2)(baseProps)).toBe('8px')
expect(th.border(2)(baseProps)).toBe('2px solid')
const remProps = { theme: { transformers: { ...rpxTransformer } } }
const remProps = { theme: { transformers: { ...rpxTransformers } } }
expect(th.space(1)(remProps)).toBe('0.25rem')
expect(th.space(2)(remProps)).toBe('0.5rem')
expect(th.border(2)(remProps)).toBe('0.125rem solid')
Expand Down

0 comments on commit 2658a07

Please sign in to comment.