first commit

This commit is contained in:
编码猿
2024-09-27 00:57:27 +08:00
commit 18df0f5e4b
2548 changed files with 253280 additions and 0 deletions

20
vue-ydui/build/rem2px.js Normal file
View File

@@ -0,0 +1,20 @@
'use strict';
const postcss = require('postcss');
module.exports = postcss.plugin('vue-ydui-rem2px', function (size) {
return function (css, result) {
const oldCssText = css.toString();
let newCssText = '';
if (/\d*\.?\d+rem/.test(oldCssText)) {
newCssText = oldCssText.replace(/(\d*\.?\d+)rem/g, function (match, m1) {
return parseInt(m1 * size) + 'px';
});
} else {
return oldCssText;
}
result.root = postcss.parse(newCssText);
};
});