-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
38 lines (31 loc) · 892 Bytes
/
index.js
File metadata and controls
38 lines (31 loc) · 892 Bytes
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
38
const postcss = require('postcss')
const symGrid = require('./src/symGrid')
const asymGrid = require('./src/asymGrid')
const center = require('./src/center')
const push = require('./src/push')
const pull = require('./src/pull')
module.exports = postcss.plugin('postcss-bubbly-grid',
function bubblyGrid(options) {
return function (css) {
options = options || {}
css.walkDecls(function (decl, i) {
const rule = decl.parent
const value = decl.prop
if (decl.prop === 'sym-grid') {
symGrid(decl, rule)
}
if (decl.prop === 'asym-grid') {
asymGrid(decl, rule)
}
if (decl.prop === 'center') {
center(decl, rule)
}
if (decl.prop === 'push') {
push(decl, rule)
}
if (decl.prop === 'pull') {
pull(decl, rule)
}
})
}
})