Responsively size UI
TL;DR: scale down UI for non-mobile devices. I pulled the screen resolution for my phone, the Google Pixel 4, off of the internet. I created a device profile in Chrome to develop this application specifically for my phone. To my surprise, when I opened the app on my phone, many of elements that looked good in Google Chrome, looked askew on my phone. I needed to troubleshoot. Here's how I did that: I used Tailwind to responsively color the bg for each breakpoint to see if my device was sm, md, lg, xl (according to Tailwind's breakpoint terminology). After reading Tailwind's documentation and comparing their breakpoints with my Pixel 4's width (i.e. 1080px), I figured that my device would be lg. It's not; it's md, which I confirmed by using ngrok to load localhost:8000 on my phone and see that the background-color was "md:bg-green-600". I'm still unsure why my device is not lg, but knowing that my device was md was enough to fix many of the styling issues. My current theory is that while my screen's resolution is 1080 wide, the pixel density affects the media query for the breakpoint.
This commit is contained in:
parent
74ebb8e869
commit
2fe6d7a10c
5 changed files with 84 additions and 12 deletions
|
|
@ -3,6 +3,7 @@ module Overview exposing (render)
|
|||
import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Html.Events exposing (..)
|
||||
import Responsive
|
||||
import State
|
||||
import UI
|
||||
|
||||
|
|
@ -10,7 +11,11 @@ import UI
|
|||
header1 : String -> Html msg
|
||||
header1 copy =
|
||||
h2
|
||||
[ [ "text-center", "text-6xl", "pt-24", "pb-12" ]
|
||||
[ [ "text-center"
|
||||
, "pt-24"
|
||||
, "pb-12"
|
||||
, Responsive.h1
|
||||
]
|
||||
|> UI.tw
|
||||
|> class
|
||||
]
|
||||
|
|
@ -19,13 +24,26 @@ header1 copy =
|
|||
|
||||
header2 : String -> Html msg
|
||||
header2 copy =
|
||||
h2 [ [ "text-center", "text-5xl", "pb-10" ] |> UI.tw |> class ]
|
||||
h2
|
||||
[ [ "text-center"
|
||||
, "pb-10"
|
||||
, Responsive.h2
|
||||
]
|
||||
|> UI.tw
|
||||
|> class
|
||||
]
|
||||
[ text copy ]
|
||||
|
||||
|
||||
paragraph : String -> Html msg
|
||||
paragraph copy =
|
||||
p [ [ "text-4xl", "pb-10" ] |> UI.tw |> class ]
|
||||
p
|
||||
[ [ "pb-10"
|
||||
, Responsive.h3
|
||||
]
|
||||
|> UI.tw
|
||||
|> class
|
||||
]
|
||||
[ text copy ]
|
||||
|
||||
|
||||
|
|
@ -39,7 +57,7 @@ numberedList items =
|
|||
ol
|
||||
[ [ "list-inside"
|
||||
, "list-decimal"
|
||||
, "text-4xl"
|
||||
, Responsive.h3
|
||||
]
|
||||
|> UI.tw
|
||||
|> class
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue