You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
574 B
27 lines
574 B
const postcss = require('postcss');
|
|
const { isProperty } = require('../../utils');
|
|
|
|
module.exports = function getNodeData(node, expectedOrder) {
|
|
if (isProperty(node)) {
|
|
let { prop } = node;
|
|
let unprefixedName = postcss.vendor.unprefixed(prop);
|
|
|
|
// Hack to allow -moz-osx-font-smoothing to be understood
|
|
// just like -webkit-font-smoothing
|
|
if (unprefixedName.startsWith('osx-')) {
|
|
unprefixedName = unprefixedName.slice(4);
|
|
}
|
|
|
|
return {
|
|
node,
|
|
name: prop,
|
|
unprefixedName,
|
|
orderData: expectedOrder[unprefixedName],
|
|
};
|
|
}
|
|
|
|
return {
|
|
node,
|
|
};
|
|
};
|