create-shopify-scss-autofill 0.6.2 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
- 响应式:PC + Mobile 双设计稿,通过 `r.resp(pc, mobile, desktopType[, mobileType])` 埋点 + 自动生成移动端覆盖。
|
|
11
11
|
- 小稿策略:当 `design.mobileWidth < responsive.smallMobileThreshold`(默认 `400`)时,`mobileClampMode=auto` 会切到 `max-first`,让小稿按上限增长而不是过早封顶。
|
|
12
12
|
- 中稿策略:当 `design.mobileWidth` 落在 `responsive.dualClampMinWidth ~ responsive.dualClampMaxWidth`(默认 `500~600`)时,`mobileClampMode=auto` 会切到 `dual-bound`,用一条 `clamp(min, fluid, max)` 同时约束小屏下限与大屏上限。
|
|
13
|
+
- **设计稿安全防护**:`resp()` 和 `resp_mb()` 均将内部计算的 raw min/max 与设计稿原值对齐,防止 floor/ceiling 配置过大/过小导致 clamp 区间非法:
|
|
14
|
+
- `resp()`:`eff-min = math.min(min_px(pc), pc)` — 保证 min 不超过 PC 设计稿值
|
|
15
|
+
- `resp_mb()`:`eff-min = math.min(min_px(mb), mb)`,`eff-max = math.max(max_px(mb), mb)` — 双向安全兜底
|
|
13
16
|
|
|
14
17
|
## 关键约束(不要破坏)
|
|
15
18
|
|
|
@@ -1083,17 +1083,29 @@ $mobile-clamp-mode: ${responsive.resolvedMobileClampMode};
|
|
|
1083
1083
|
}
|
|
1084
1084
|
|
|
1085
1085
|
// 移动段响应式输出策略:
|
|
1086
|
-
// - min-first: 传统逻辑(按系数推导 min
|
|
1087
|
-
// - max-first: 小设计稿逻辑(设计值作为 min
|
|
1088
|
-
// - dual-bound: 中等设计稿(500-600
|
|
1086
|
+
// - min-first: 传统逻辑(按系数推导 min),以设计稿值为 min 上限兜底
|
|
1087
|
+
// - max-first: 小设计稿逻辑(设计值作为 min),以设计稿值为 max 下限兜底
|
|
1088
|
+
// - dual-bound: 中等设计稿(500-600)逻辑,双向边界均以设计稿值兜底
|
|
1089
1089
|
@function resp_mb($mobile, $type) {
|
|
1090
|
+
$v: _to-px($mobile);
|
|
1091
|
+
|
|
1090
1092
|
@if $mobile-clamp-mode == max-first {
|
|
1091
|
-
|
|
1093
|
+
$raw-max: max_px($mobile, $type, mobile);
|
|
1094
|
+
$eff-max: math.max($raw-max, $v);
|
|
1095
|
+
@return clamp_mb($mobile, $mobile, $eff-max);
|
|
1092
1096
|
}
|
|
1097
|
+
|
|
1093
1098
|
@if $mobile-clamp-mode == dual-bound {
|
|
1094
|
-
|
|
1099
|
+
$raw-min: min_px($mobile, $type, mobile);
|
|
1100
|
+
$raw-max: max_px($mobile, $type, mobile);
|
|
1101
|
+
$eff-min: math.min($raw-min, $v);
|
|
1102
|
+
$eff-max: math.max($raw-max, $v);
|
|
1103
|
+
@return clamp_mb($mobile, $eff-min, $eff-max);
|
|
1095
1104
|
}
|
|
1096
|
-
|
|
1105
|
+
|
|
1106
|
+
$raw-min: min_px($mobile, $type, mobile);
|
|
1107
|
+
$eff-min: math.min($raw-min, $v);
|
|
1108
|
+
@return clamp_mb($mobile, $eff-min);
|
|
1097
1109
|
}
|
|
1098
1110
|
|
|
1099
1111
|
// 直接输出 PC 段 vw,并用设计稿 px 做上限兜底。
|
|
@@ -1133,7 +1145,10 @@ $mobile-clamp-mode: ${responsive.resolvedMobileClampMode};
|
|
|
1133
1145
|
@if meta.type-of($pc) != number {
|
|
1134
1146
|
@error "resp() expects a number (px) for pc value";
|
|
1135
1147
|
}
|
|
1136
|
-
|
|
1148
|
+
$v: _to-px($pc);
|
|
1149
|
+
$raw-min: min_px($pc, $type, desktop);
|
|
1150
|
+
$eff-min: math.min($raw-min, $v);
|
|
1151
|
+
@return clamp_pc($pc, $eff-min);
|
|
1137
1152
|
}
|
|
1138
1153
|
|
|
1139
1154
|
// re(): passthrough for non-dimension responsive values (color, display, background, etc.)
|
|
@@ -1621,15 +1636,16 @@ function main() {
|
|
|
1621
1636
|
JSON.stringify(
|
|
1622
1637
|
{
|
|
1623
1638
|
action: 'responsive:generate:entries',
|
|
1624
|
-
ok:
|
|
1639
|
+
ok: true,
|
|
1640
|
+
skipped: true,
|
|
1625
1641
|
reason:
|
|
1626
|
-
'
|
|
1642
|
+
'autofill.entries is empty — nothing to generate. Create .scss files in src/styles/ and the responsive:watch watcher will register them automatically.',
|
|
1627
1643
|
},
|
|
1628
1644
|
null,
|
|
1629
1645
|
2
|
|
1630
1646
|
)
|
|
1631
1647
|
)
|
|
1632
|
-
process.exit(
|
|
1648
|
+
process.exit(0)
|
|
1633
1649
|
}
|
|
1634
1650
|
|
|
1635
1651
|
// Load incremental cache
|