Re: Weird table alignment override in website docs style - Mailing list pgsql-www

From Magnus Hagander
Subject Re: Weird table alignment override in website docs style
Date
Msg-id CABUevEzwe+nthg1SE8pg1pnb4caBp+pv4=v=0Dw=NUGq_H06Kw@mail.gmail.com
Whole thread Raw
In response to Re: Weird table alignment override in website docs style  ("Jonathan S. Katz" <jkatz@postgresql.org>)
List pgsql-www


On Wed, Apr 15, 2020 at 12:29 AM Jonathan S. Katz <jkatz@postgresql.org> wrote:
On 4/14/20 6:17 PM, David G. Johnston wrote:
> On Tue, Apr 14, 2020 at 2:53 PM Jonathan S. Katz <jkatz@postgresql.org
> <mailto:jkatz@postgresql.org>> wrote:
>
>     On 4/14/20 5:40 PM, Tom Lane wrote:
>     > "Jonathan S. Katz" <jkatz@postgresql.org
>     <mailto:jkatz@postgresql.org>> writes:
>     >> The fix is now live:
>     >>      https://www.postgresql.org/docs/devel/functions-enum.html
>     >
>     > Hm, looking at
>     >
>     > https://www.postgresql.org/docs/devel/functions-enum.html
>     >
>     > it seems like it's now handling valign=middle for the "Function"
>     > header, but it's still ignoring align=center for all the headers.
>
>     Oops I missed that, sorry.
>
>     Doing some research, and from what I recall, align/valign as HTML
>     properties are technically no longer supported in HTML5 -- you are
>     supposed to handle this with CSS (text-align & vertical-align
>     respectively)[1]. The main reason it still works is that browsers still
>     support that backwards compatibility.
>
>     I do have a fix on my local that accounts for this using CSS attribute
>     selectors to check for that value and then apply it as CSS and it is
>     safe across browsers. I do wonder if it's more prudent to have a class
>     on it that I can check for?
>
>
> I would suggest adding a class to the table element designating this as
> a "v12" style table.

This would involve edits to the source documentation generation. Perhaps
not unreasonable to do, and then we can namespace the changes (which we
already do in the pgweb CSS).

However, I would be a -1 for doing it by PostgreSQL version, but rather
have it for "table version" as the table versions change less.


We could add a wrapper maybe? That is, we have a "<div id="docContent">". We could add a version-dependent class to that one, e.g. class="docsv12" and then style things below that.

But I'm not sure that's going to be scalable? You'll eventually end up with rules that match docsv12, docsv13, docsv14, docsv15 etc. AFAIK you don't do greaterthan/lessthan matching in css?

Bottom line is adding any info that we have at the db level to the wrapper is easy.

--

pgsql-www by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Weird table alignment override in website docs style
Next
From: Cary Huang
Date:
Subject: Wiki editor request