-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathcolors.js
37 lines (32 loc) · 1016 Bytes
/
colors.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import transformCss from '..'
it('transforms hex colors', () => {
expect(transformCss([['color', '#f00']])).toEqual({ color: '#f00' })
})
it('transforms rgb colors', () => {
expect(transformCss([['color', 'rgb(255, 0, 0)']])).toEqual({
color: 'rgb(255, 0, 0)',
})
})
it('transforms transparent color', () => {
expect(transformCss([['color', 'transparent']])).toEqual({
color: 'transparent',
})
})
it('transforms border shorthand with transparent color', () => {
expect(transformCss([['border', '2px dashed transparent']])).toEqual({
borderTopWidth: 2,
borderRightWidth: 2,
borderBottomWidth: 2,
borderLeftWidth: 2,
borderTopColor: 'transparent',
borderRightColor: 'transparent',
borderBottomColor: 'transparent',
borderLeftColor: 'transparent',
borderStyle: 'dashed',
})
})
it('transforms background shorthand with transparent color', () => {
expect(transformCss([['background', 'transparent']])).toEqual({
backgroundColor: 'transparent',
})
})