mirror of
https://github.com/less/less.js.git
synced 2026-01-09 15:48:08 -05:00
fix: Output correct css when using css function in max(). (#4266)
* fix: Output correct css when using css function in max(). * fix: If a non-Dimension value is handled in minMax(), then throw Atgument exception. * chore: add more test cases * chore: rebase the lock --------- Co-authored-by: lumburr <flyfish.zy@foxmail.com>
This commit is contained in:
@@ -26,8 +26,10 @@ const minMax = function (isMin, args) {
|
||||
if (!(current instanceof Dimension)) {
|
||||
if (Array.isArray(args[i].value)) {
|
||||
Array.prototype.push.apply(args, Array.prototype.slice.call(args[i].value));
|
||||
continue;
|
||||
} else {
|
||||
throw { type: 'Argument', message: 'incompatible types' };
|
||||
}
|
||||
continue;
|
||||
}
|
||||
currentUnified = current.unit.toString() === '' && unitClone !== undefined ? new Dimension(current.value, unitClone).unify() : current.unify();
|
||||
unit = currentUnified.unit.toString() === '' && unitStatic !== undefined ? unitStatic : currentUnified.unit.toString();
|
||||
|
||||
@@ -110,9 +110,13 @@
|
||||
min: 1pt;
|
||||
min: 3mm;
|
||||
min: min(1, 4ex, 2pt);
|
||||
min: min(calc(1 + 1), 1);
|
||||
min: min(var(--width), 802px);
|
||||
max: 3;
|
||||
max: 5em;
|
||||
max: max(5m, 3em);
|
||||
max: min(var(--body-max-width), calc(100vw - 20px));
|
||||
max: max(1, calc(1 + 1));
|
||||
max-native: max(10vw, 100px);
|
||||
percentage: 20%;
|
||||
color-quoted-digit: #dda0dd;
|
||||
|
||||
@@ -117,9 +117,13 @@
|
||||
min: min(1pt, 3pt);
|
||||
min: min(1cm, 3mm);
|
||||
min: min(6em, 5, 4ex, 3, 2pt, 1);
|
||||
min: min(calc(1 + 1), 1);
|
||||
min: min(~'var(--width), 802px');
|
||||
max: max(1, 3);
|
||||
max: max(3em, 1em, 2em, 5em);
|
||||
max: max(1px, 2, 3em, 4, 5m, 6);
|
||||
max: min(var(--body-max-width), calc(100vw - 20px));
|
||||
max: max(1, calc(1 + 1));
|
||||
max-native: max(10vw, 100px);
|
||||
percentage: percentage((10px / 50));
|
||||
color-quoted-digit: color("#dda0dd");
|
||||
|
||||
Reference in New Issue
Block a user