From 084ff0c1ebb5755c3f7bc2efeb3eea83b476c95d Mon Sep 17 00:00:00 2001 From: Andy Meneely Date: Sat, 23 Jan 2016 22:45:13 -0500 Subject: [PATCH] Add unit conversion --- docs/index.rst | 3 ++- docs/units.rst | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 docs/units.rst diff --git a/docs/index.rst b/docs/index.rst index 587a05b..2892397 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -7,7 +7,8 @@ Contents: .. toctree:: :maxdepth: 1 :glob: - + + units dsl/* Indices and tables diff --git a/docs/units.rst b/docs/units.rst new file mode 100644 index 0000000..4266408 --- /dev/null +++ b/docs/units.rst @@ -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)