postcss-plugins
postcss-plugins copied to clipboard
CSS `sign()` and `abs()` support?
What would you want to propose?
I want to ask support for CSS sign() and abs().
Suggested solution
@support (opacity: abs(-1)) {
// legal sign()
}
@support not (opacity: abs(-1)) {
// workaround math
// such as max(value, calc(0 - value))
}
@support (opacity: sign(0.5)) {
// legal sign()
}
@support not (opacity: sign(0.5)) {
// workaround math
// such as clamp(value / max(abs(value), 0.0001), -1, 1)
}
Additional context
About spec and chrome support:
- https://www.w3.org/TR/css-values-4/
- https://issues.chromium.org/issues/40253181
Validations
- [X] Follow our Code of Conduct
- [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Would you like to open a PR for this feature?
- [ ] I'm willing to open a PR