summaryrefslogtreecommitdiff
path: root/node_modules/postcss-will-change/index.js
blob: b3172adcc31c6e75ffb631f3f49c9bc75df62ba7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module.exports = () => {
  return {
    postcssPlugin: 'postcss-will-change',
    Declaration: {
      'will-change': decl => {
        let already = decl.parent.some(i => {
          return i.type === 'decl' && i.prop === 'backface-visibility'
        })
        if (!already) {
          decl.cloneBefore({ prop: 'backface-visibility', value: 'hidden' })
        }
      }
    }
  }
}
module.exports.postcss = true