How to use postcss-functions - 1 common examples

To help you get started, we’ve selected a few postcss-functions examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github VisualComposer / builder / public / editor / services / stylesManager / service.js View on Github external
}

      let match = 'resolve('
      if (!node[ nodeProp ] || node[ nodeProp ].indexOf(match) === -1) {
        return
      }
      let temp = node[ nodeProp ].replace(/([^)]+)$/, '')
      let newValue = window.eval('var resolve=function(s) { return window.eval(s)+\'\'; }; ' + temp) + ''
      node[ nodeProp ] = node[ nodeProp ].replace(temp, newValue)
    })
  }
})
mainPlugins.push(plugin())

// mainPlugins.push(postcssMath())
mainPlugins.push(functions({
  functions: {
    rawUrl: (path) => {
      return `url(${path})`
    }
  }
}))
mainPlugins.push(postcssColor)
mainPlugins.push(postcssNested)
mainPlugins.push(postcssClean)
mainPlugins.push(autoprefixer({
  overrideBrowserslist: [
    '>1%',
    'ios_saf 8',
    'ie 10',
    'ie 11'
  ]

postcss-functions

PostCSS plugin for exposing JavaScript functions

MIT
Latest version published 4 years ago

Package Health Score

53 / 100
Full package analysis

Popular postcss-functions functions