Add guidance on making documentation SVG images responsive
authorJoe Conway <mail@joeconway.com>
Sat, 27 Apr 2019 15:12:52 +0000 (11:12 -0400)
committerJoe Conway <mail@joeconway.com>
Sat, 27 Apr 2019 15:12:52 +0000 (11:12 -0400)
Recently added guidance on adding SVG images to the documentation
sources lacks advice on making the images responsive when rendered
in a variety of media types and viewports. Add some.

Patch by Jonathan Katz with some editorialization by me.

Author: Jonathan Katz
Discussion: https://postgr.es/m/6358ae6f-7191-a02b-e7b5-68050636ae71@postgresql.org

doc/src/sgml/images/README

index dd29486a092d20df8bc37f85ad2b245a5a809552..ade627bda2db05247d4b01bbf5707094bd16f18b 100644 (file)
@@ -59,3 +59,10 @@ Notes:
 - The width should be set to something.  This ensures that the image
   is scaled to fit the page in PDF output.  (Other widths than 100%
   might be appropriate.)
+
+- SVG images should be scalable as they will be rendered in a variety
+  of places (web, PDF, etc.) as well as in different viewports
+  (desktop, mobile, etc.). To help the images successfully scale,
+  employ a "viewBox" attribute in the SVG tag. For example,
+  to create an image with a default width and height of 400x300,
+  you would use viewBox="0.00 0.00 400.00 300.00"