Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Calculations #40

ai opened this Issue Mar 5, 2013 · 1 comment


None yet
2 participants

ai commented Mar 5, 2013

Calcultaions in CSS is very easefull.

li {
  width: 726px / 3;

Because robots are ours slaves, they must think and suffer, not.

Of course, it not only about lazy. We can use it in some automatization in future:

.logo {
  width: image-width('logo.png') / 2;

Or in generate background-size for retina sprite. Or use with references:

.preview {
  width: 150px;
  height: @width * 2;

But, of course, we can just use calc(), but it is too long and not every browser support it.

I think, most architectural way will be:

  • We have some preprocessor, that wrap any calculation 726px / 3 or 3px + 5em to calc().
  • Rework filter, that find calc() without different units (like 726px / 3 or 30px + 172px) and calculate it now.

tj commented Mar 6, 2013

these ones I'd like to keep out of core, I know it'll be more of a maintenance burden than the others, but it would be nice to port over the color operations from stylus as well, ex #c00 + 10% to lighten etc

@tj tj closed this May 10, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment