Implement the functions described in the "Mathematical Expressions" section of the "CSS Values and Units Module Level 4" spec, https://www.w3.org/TR/css-values-4/. Beyond calc(), which we already had, this includes min(), max(), clamp(), round(), rem(), mod(), sin(), cos(), tan(), asin(), acos(), atan(), atan2(), pow(), sqrt(), hypot(), log(), exp(), abs(), sign(), e, pi, infinity and NaN. Some tests included.
48 lines
664 B
CSS
48 lines
664 B
CSS
a {
|
|
margin-left: NaN;
|
|
margin-right: NaN;
|
|
margin-top: NaN;
|
|
padding-left: 3;
|
|
padding-right: 3;
|
|
padding-top: 2;
|
|
}
|
|
|
|
b {
|
|
margin-left: NaN;
|
|
margin-right: NaN;
|
|
margin-top: -1px;
|
|
padding-left: 3;
|
|
padding-right: 3;
|
|
padding-top: -3;
|
|
}
|
|
|
|
c {
|
|
margin-bottom: 15px;
|
|
margin-left: 20px;
|
|
margin-right: 15px;
|
|
margin-top: 20px;
|
|
}
|
|
|
|
d {
|
|
margin-left: 20px;
|
|
margin-right: 0;
|
|
margin-top: -1px;
|
|
}
|
|
|
|
e {
|
|
margin-bottom: NaN;
|
|
margin-left: NaN;
|
|
margin-right: infinite;
|
|
margin-top: 0;
|
|
padding-bottom: 0;
|
|
padding-left: infinite;
|
|
padding-right: -infinite;
|
|
padding-top: 0;
|
|
}
|
|
|
|
f {
|
|
margin-bottom: NaN;
|
|
margin-left: NaN;
|
|
margin-right: NaN;
|
|
}
|