MCPcopy Create free account
hub / github.com/chokcoco/iCSS / generateOptimizationTips

Method generateOptimizationTips

MCP/scripts/fetch-issues.js:1072–1086  ·  view source on GitHub ↗
(properties)

Source from the content-addressed store, hash-verified

1070 }
1071
1072 generateOptimizationTips(properties) {
1073 const tips = [];
1074
1075 if (this.checkLayoutTriggers(properties)) {
1076 tips.push('考虑使用 transform 替代改变位置和尺寸的属性');
1077 }
1078 if (properties.some(p => p.includes('box-shadow'))) {
1079 tips.push('大面积阴影考虑使用 filter: drop-shadow() 优化性能');
1080 }
1081 if (properties.some(p => p.includes('@keyframes'))) {
1082 tips.push('长动画考虑使用 requestAnimationFrame 实现');
1083 }
1084
1085 return tips;
1086 }
1087
1088 analyzeCSSPropertyCategories(properties) {
1089 return properties.map(prop => ({

Callers 1

analyzePerformanceMethod · 0.95

Calls 1

checkLayoutTriggersMethod · 0.95

Tested by

no test coverage detected