syntaxfm / website

Syntax Podcast Website
https://syntax.fm
MIT License
1.01k stars 494 forks source link

Fix top message font size on the "Shows" page to be like rest of the pages #1265

Closed RafaelDavisH closed 10 months ago

RafaelDavisH commented 10 months ago

Recording on mobile - landscape view.

https://github.com/syntaxfm/website/assets/6822714/5c3b1e42-999f-4f85-8bf6-17f3d2f594b1

wesbos commented 10 months ago

Weeeeird. I bet it has to do with the viewport unit sizing... you aren't getting horz scroll? Thanks for the heads up

RafaelDavisH commented 10 months ago

No, horz scroll.

wesbos commented 10 months ago

Seems like the font size is different on 3 pages Home / About + potluck / shows...

wesbos commented 10 months ago

Narrowed it down to the font size calculations:

    --font-size-xs: clamp(0.6rem, 0.17vw + 0.76rem, 0.7rem);
    --font-size-sm: clamp(0.8rem, 0.17vw + 0.76rem, 0.89rem);
    --font-size-base: clamp(1rem, 0.34vw + 0.91rem, 1.19rem);
    --font-size-md: clamp(1.25rem, 0.61vw + 1.1rem, 1.58rem);
    --font-size-lg: clamp(1.56rem, 1vw + 1.31rem, 2.11rem);
    --font-size-xl: clamp(1.95rem, 1.56vw + 1.56rem, 2.81rem);
    --font-size-xxl: clamp(2.44rem, 2.38vw + 1.85rem, 3rem);
    --font-size-xxxl: clamp(3.05rem, 3.54vw + 2.17rem, 5rem);
wesbos commented 10 months ago

Looks like safari scales up what 1rem if it thinks its too small

https://stackoverflow.com/questions/13237782/safari-doesnt-calculate-rem-units-correct-when-scaling-with-media-width-heigh

wesbos commented 10 months ago

all that, and we needed -webkit-text-size-adjust: none; hah