Keep Math in the CSS
There is a sentiment that leaving math calculations in your CSS is a good idea that I agree with. This is for math that you could calculate at authoring time, but specifically chose not to. For instance, if you needed a 7-column float-based grid (don’t ask), it’s cleaner and more intuitive:
.col {
/* groan */
width: 14.2857142857%;
/* oh, I get it */
width: calc(100% / 7);
}
You could probably prove that the calc()
takes the computer 0.0000001% …
The post Keep Math in the CSS appeared first on CSS-Tricks.