From: Carl Worth Date: Sun, 7 Jun 2020 00:16:08 +0000 (-0700) Subject: Scribe: Fix the font size to not depend on page height X-Git-Url: https://git.cworth.org/git?p=lmno.games;a=commitdiff_plain;h=9d3838cf4d43ab1ed1b994b24cd3aa3cb31ebc64 Scribe: Fix the font size to not depend on page height The height of the game board is already fixed based on the viewport width, (to mtain a square asepct ratio). The use of 'vmin' in the font size led to a weird result where shrinking the page height left the board size untouched but the text-based game-play components would shrink, which was undesirable. The fix for that here is to simply switch from 'vmin' to 'vw' so the font size depends only on the page width, not the height. While exploring the issue described above, I found that making the page _extremely_ wide also caused the fonts to grow excessively and make the board spill out over the page margin. To avoid that, we cap the font size with a calculation based on the maximum page width. This takes advantage of a variable introduced in the previous commit. --- diff --git a/scribe/scribe.css b/scribe/scribe.css index 116bcbc..74beee9 100644 --- a/scribe/scribe.css +++ b/scribe/scribe.css @@ -57,7 +57,7 @@ display: flex; justify-content: center; align-items: center; - font-size: 8vmin; + font-size: calc(min(8vw, .08 * var(--page-max-width))); line-height: 0; font-weight: bold; border-bottom: 1px solid #999;