forked from tailwindlabs/tailwindcss
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspace.test.js
More file actions
36 lines (33 loc) · 1.11 KB
/
space.test.js
File metadata and controls
36 lines (33 loc) · 1.11 KB
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
import invokePlugin from '../util/invokePlugin'
import plugin from '../../src/plugins/space'
test('generating space utilities', () => {
const config = {
theme: {
space: {
'1': '1px',
'2': '2px',
'4': '4px',
'8': '8px',
},
},
variants: {
space: ['responsive'],
},
}
const { utilities } = invokePlugin(plugin(), config)
expect(utilities).toEqual([
[
{
'.space-y-1 > :not(template) ~ :not(template)': { 'margin-top': '1px' },
'.space-x-1 > :not(template) ~ :not(template)': { 'margin-left': '1px' },
'.space-y-2 > :not(template) ~ :not(template)': { 'margin-top': '2px' },
'.space-x-2 > :not(template) ~ :not(template)': { 'margin-left': '2px' },
'.space-y-4 > :not(template) ~ :not(template)': { 'margin-top': '4px' },
'.space-x-4 > :not(template) ~ :not(template)': { 'margin-left': '4px' },
'.space-y-8 > :not(template) ~ :not(template)': { 'margin-top': '8px' },
'.space-x-8 > :not(template) ~ :not(template)': { 'margin-left': '8px' },
},
['responsive'],
],
])
})