caddy-website/src/resources/css
Francis Lavoie e03cbec7c4
css: Rework how paper is positioned (#230)
On Firefox, we were seeing an extra large horizontal scrollbar. Didn't happen on Chrome though. I think it's an edgecase bug with Firefox... but I think we can take a better approach that can avoid it anyways.

The CSS for `paper` classes was set up so that they would stack/overlap onto eachother. It was using `left: -100%;` and `left: -200%;` on `paper2` and `paper3`, to stack the next two on top of the first one, all three being relative positioned.

The problem comes because I think Firefox calculates the scrollbar width before relative positioning calculations come into play, so because the elements were rendered way off to the right before being moved over, it would "grow" the page really wide. Go to https://caddyserver.com/docs/ on any browser, element inspector, find `#paper2` and `.paper3`, uncheck the `left` CSS prop on both of those. You'll see that they render over to the right.

An alternate way to do the same thing is to use negative margins to stack the elements. I think margins are calculated earlier, so on Firefox this doesn't cause a scrollbar problem.

I did need to use a `calc()` unfortunately to get it pixel-perfect positioning compared to how it was before, because `#paper1` has `margin-left: 20px` and then `#paper2` inherits that margin so it needs to remove the extra 20px to realign. `calc()` is cheap though. It's fine.

Also, need `z-index: -1;` to make sure the BG papers go behind the page content.
2022-05-11 11:28:10 -06:00
..
account Account portal, download page, non-standard module docs 2020-07-16 15:53:33 -06:00
asciinema-player-2.6.1.css Update site for 2.0; add v2 landing page with asciinema video; docs 2020-05-04 19:39:11 -06:00
business.css Oops, forgot css file 2020-05-02 23:33:28 -06:00
chroma.css docs: Minor updates to file_server and reverse_proxy 2021-06-17 14:12:56 -06:00
common.css docsearch: Upgrade to v3 (#231) 2022-05-11 10:31:22 -06:00
docs-json.css docs: Better support for module name collisions 2021-06-02 15:16:15 -06:00
docs.css css: Rework how paper is positioned (#230) 2022-05-11 11:28:10 -06:00
download.css New download page, better JSON/module docs 2021-05-25 17:26:54 -06:00
home.css Minor style updates, add business contact page 2020-05-02 23:26:37 -06:00
v2-landing.css Update site for 2.0; add v2 landing page with asciinema video; docs 2020-05-04 19:39:11 -06:00