isv-rx-styler
v10.0.9
Published
RX css语法支持检测,依据weex的语法支持进行提示
Downloads
10
Readme
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);