1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00
Commit graph

2 commits

Author SHA1 Message Date
Nathan Weizenbaum
f5bb7641df Clean up some unit-handling stuff. 2008-09-30 18:15:08 -07:00
Chris Eppstein
ae30d64cfb More intelligent handling of units across arithmetic operations.
Automatic unit conversions are performed if necessary and possible.

Other small changes:
  * Limit the number of emitted decimals to three.
  * Added a function for converting a unitless number to a percentage.

This means that you can do the following now:
a
  :font-size= percentage(14.0px / 12px)
  :line-height= 1em * 20.0px / 12px
  :padding= 1in + 36pt
  :margin= 1in + ((72pt * 2in) + (36pt * 1in)) / 2.54cm

and get this:
a { font-size: 1.167%; line-height: 1.667em; padding: 1.5in; margin: 3.5in; }
2008-09-22 00:08:22 -07:00