Loading...
.item {
--dist: max(var(--offset), -1 * var(--offset));
}.item {
--dist: abs(var(--offset));
}abs() returns the positive value directly, without the max() trick.
abs(), because there was no fallback.abs() is used instead of hacks like max(x, -1 * x) to get a positive value.abs(50% - 100px), without an extra calc().abs() one where support is missing.Yes. abs(-20px) returns '20px', with the same type as the argument.
Yes. It can appear anywhere a math value is allowed, like calc(abs(var(--x)) * 2).