Add unit conversion

dev
Andy Meneely 2016-01-23 22:45:13 -05:00
parent 40e795d6ba
commit 084ff0c1eb
2 changed files with 6 additions and 1 deletions

View File

@ -7,7 +7,8 @@ Contents:
.. toctree::
:maxdepth: 1
:glob:
units
dsl/*
Indices and tables

4
docs/units.rst Normal file
View File

@ -0,0 +1,4 @@
Unit Conversion
===============
By default, Squib thinks in pixels. This decision was made so that we can have pixel-perfect layouts without automatically scaling everything, even though working in units is sometimes easier. We provide some conversion methods, including looking for strings that end in "in" and "cm" and computing based on the current DPI. The dpi is set on `Squib::Deck.new` (not `config.yml`). Example is in `samples/units.rb` found [here](https://github.com/andymeneely/squib/tree/master/samples/units.rb)