On Sat, Sep 03, 2016 at 09:53:26AM +0200, Vincent Lefevre wrote:
> On 2016-09-03 05:09:46 +0300, Alexander Gromnitsky wrote:
>> The patch is nothing radical, it just adds a simple media query.
> I wonder whether the choice should be left to the user (I mean
> that it should really be a browser configuration option, just
> like the default font size).
> Otherwise, perhaps something useful could be put in the margins
> when the viewport is large enough, like the table of contents.
> Some web sites do this.
That's actually a great idea. The 2nd version of the patch adds
another media query that moves the TOC to the left if the viewport >=
1100px.
Because the patch includes `>` char, I was forced to modify `mutt.xsl`
to prevent the contents of `mutt.css` from escaping.
diff -r efccbd9bc6f6 doc/mutt.css
--- a/doc/mutt.css Tue Aug 30 18:43:02 2016 -0700
+++ b/doc/mutt.css Sat Sep 03 18:04:08 2016 +0300
@@ -1,4 +1,34 @@
-body { margin-left:2%; margin-right:2%; font-family:serif; }
+@media (min-width: 701px) {
+ body {
+ width: 700px;
+ margin: 0 auto;
+ }
+}
+
+@media (min-width: 1100px) {
+ body {
+ width: 1099px;
+ margin: 0 auto;
+ }
+
+ .book {
+ margin-left: 330px;
+ }
+
+ .book > .toc {
+ position: fixed;
+ width: 250px;
+ top: 0;
+ left: 50%;
+ margin-left: -500px;
+
+ overflow: scroll;
+ height: 100%;
+
+ padding: 0 0.5em 0;
+ }
+}
+body { font-family:serif; }
.toc, .list-of-tables, .list-of-examples { font-family:sans-serif; }
h1, h2, h3, h4, h5, h6 { font-family:sans-serif; }
p { text-align:justify; }
diff -r efccbd9bc6f6 doc/mutt.xsl
--- a/doc/mutt.xsl Tue Aug 30 18:43:02 2016 -0700
+++ b/doc/mutt.xsl Sat Sep 03 18:04:08 2016 +0300
@@ -7,7 +7,9 @@
<xsl:template name="user.head.content">
<xsl:element name="style">
<xsl:attribute name="type">text/css</xsl:attribute>
- &css;
+ <xsl:text disable-output-escaping="yes">
+ &css;
+ </xsl:text>
</xsl:element>
</xsl:template>
<xsl:param name="admon.style"/>