新增: - backend/venv/ - Python 虚拟环境 - backend/start.sh - 启动脚本(使用虚拟环境) - backend/requirements.txt - 依赖列表 - .gitignore - 忽略虚拟环境和缓存文件 说明: - 每个项目使用独立虚拟环境 - 避免依赖冲突 - 启动脚本自动创建和激活虚拟环境
28 lines
702 B
JavaScript
28 lines
702 B
JavaScript
var postcss = require('postcss');
|
|
|
|
module.exports = function(decl) {
|
|
var regex = /(\d{1,}) (\d{1,}) (calc\(.*\))/g;
|
|
var matches = regex.exec(decl.value);
|
|
if (decl.prop === 'flex' && matches) {
|
|
var grow = postcss.decl({
|
|
prop: 'flex-grow',
|
|
value: matches[1],
|
|
source: decl.source
|
|
});
|
|
var shrink = postcss.decl({
|
|
prop: 'flex-shrink',
|
|
value: matches[2],
|
|
source: decl.source
|
|
});
|
|
var basis = postcss.decl({
|
|
prop: 'flex-basis',
|
|
value: matches[3],
|
|
source: decl.source
|
|
});
|
|
decl.parent.insertBefore(decl, grow);
|
|
decl.parent.insertBefore(decl, shrink);
|
|
decl.parent.insertBefore(decl, basis);
|
|
decl.remove();
|
|
}
|
|
};
|