10.0.9 • Published 8 years ago
isv-rx-styler v10.0.9
API
validate
/* check a JSON Object with one property ,validate support of css property ,try fix color to Hex , log errors & warnings * @param {object} json , a decl node by postcss * JSON Object example: json { 'raws': {}, 'type': 'decl', 'source': { 'start': { line: 17, column: 5 }, 'end': { line: 17, column: 17 } }, 'prop': 'background-color', 'value': 'red' } * return { jsonStyle: json log: { line: 17 column: 17, reason: 'INFO: `background-color` property value `red` is autofixed to `#FF0000`', level: info } } */ var rxStyler = require('@ali/rx-styler'); var code = { 'raws': {}, 'type': 'decl', 'source': { 'start': { 'line': '17', 'column': '5' }, 'end': { 'line': '17', 'column': '17' } }, 'prop': 'color', 'value': 'red' }; data = rx.validate(code);