How to use the color-blend function in color-blend

To help you get started, we’ve selected a few color-blend 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
import postcssCustomProps from 'postcss-custom-properties'
import postcssAdvancedVars from 'postcss-advanced-variables'
import postcssColor from 'postcss-color-function'
import postcssNested from 'postcss-nested'
import postcssPrefixUrl from 'postcss-prefix-url'
import postcssMedia from 'postcss-custom-media'
import postcssEach from 'postcss-each'
import colorBlend from 'color-blend'
import functions from 'postcss-functions'
import autoprefixer from 'autoprefixer'
import objectHash from 'node-object-hash'

let cssHashes = {}
let mainPlugins = []
mainPlugins.push(postcssEach)
mainPlugins.push(colorBlend())
let plugin = postcss.plugin('postcss-math', () => {
  return (css) => {
    // Transform CSS AST here
    css.walk((node) => {
      let nodeProp

      if (node.type === 'decl') {
        nodeProp = 'value'
      } else if (node.type === 'atrule' && node.name === 'media') {
        nodeProp = 'params'
      } else if (node.type === 'rule') {
        nodeProp = 'selector'
      } else {
        return
      }

color-blend

Blends RGBA colors with different blend modes

MIT
Latest version published 2 years ago

Package Health Score

60 / 100
Full package analysis