module.exports = {
  plugins: [require('./postcss-alter-property-value.js')({

      config: {
        addInfo: true, // add debug info
      },

      declarations: {
        'font-family': 'sans-serif', // set all properties with this value
        'mouse': {
          task: 'changeProperty',
          to: 'cursor' // change all mouse properties with this property
        },
        'transform': {
          task: 'cloneBefore', // add a clone before this declaration
          to: '-webkit-transform' // with this property name
        },
        'display': {
          task: 'changeValue',
          to: 'flex',
          whenValueEquals: 'inline-flex'
        },
        'outline': {
          task: 'remove'
        },
        // e.g. border: 1px solid black -> border: 1px solid #000
        'border': {
          task: 'changeValue',
          to: '#000',
          whenRegex: {
            mode: 'partial',
            value: 'black', 
            flags: 'i'
          }
        },
        'color': {
          task: 'changeValue',
          to: 'orange',
          whenRegex: {
            /* mode: 'replace', // default mode */
            value: 'blue$',
            flags: 'i'
          }
        },
        'font-size': {
          task: 'changeValue',
          to: '2rem'
        },
        'background': {
          task: 'changeProperty',
          to: 'background-color',
          whenRegex: {
            value: '^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$',
            flags: 'i'
          }
        }
      } // end declarations

    })]
}

@@ -82,184 +82,306 @@
     
-config: %7B%0A        addInfo: true, // add debug info%0A      %7D,%0A%0A      declarations: %7B%0A        'font-family': 'sans-serif', // set all properties with this value%0A        'mouse': %7B
+/* optional */%0A      config: %7B%0A        /* add debug info */%0A        addInfo: true,%0A      %7D,%0A%0A      /* required */%0A      declarations: %7B%0A        /* set all font-families to this value */%0A        'font-family': 'sans-serif',%0A        'mouse': %7B%0A          /* replace all mouse properties with cursor */
 %0A   
@@ -438,57 +438,8 @@
 or' 
-// change all mouse properties with this property
 %0A   
@@ -483,43 +483,38 @@
     
-task: 'cloneBefore', // add a clone
+/* clone a declaration and add
  bef
@@ -533,16 +533,51 @@
 laration
+ */%0A          task: 'cloneBefore', 
 %0A       
@@ -606,35 +606,8 @@
 orm'
- // with this property name
 %0A   
@@ -631,24 +631,65 @@
 display': %7B%0A
+          /* conditional change value */%0A
           ta
@@ -798,24 +798,60 @@
 outline': %7B%0A
+          /* remove all outlines */%0A
           ta
@@ -886,15 +886,32 @@
     
-// e.g.
+'border': %7B%0A          /*
  bor
@@ -956,36 +956,19 @@
 lid #000
-%0A        'border': %7B
+ */
 %0A       
@@ -1155,24 +1155,81 @@
  'color': %7B%0A
+          /* replace all color names ending with blue */%0A
           ta
@@ -1298,59 +1298,8 @@
 : %7B%0A
-            /* mode: 'replace', // default mode */%0A
     
@@ -1405,84 +1405,346 @@
     
-task: 'changeValue',%0A          to: '2rem'%0A        %7D,%0A        'background': %7B
+/* change to 2rem when value is a rem unit */%0A          task: 'changeValue',%0A          to: '2rem',%0A          whenRegex: %7B%0A            mode: 'partial',%0A            value: '%5B0-9%5D+rem', %0A            flags: 'i'%0A          %7D%0A        %7D,%0A        'background': %7B%0A          /* simplify background to background-color %0A          if value is a hex */
 %0A   

add comments