Skip to content

Instantly share code, notes, and snippets.

Avatar

Joseph Scott Stevens josephscottstevens

  • Augusta, GA
View GitHub Profile
@evancz
evancz / font-face.md
Last active Mar 14, 2019
It seems really complicated to use custom fonts well. This explores some ideas of how to make it easier.
View font-face.md

Making it easier to load fonts

I have been doing a lot of work on making Elm assets really tiny. As part of some exploratory research I did ages ago, I read this document on font loading. It is a super helpful resource, but I was confused by all the different terms: FOIT, FOUT, FOFT, etc. It reminded me of the old "how do you center things?" blog posts from before flexbox. So my instinct was that probably lots of folks are confused about how to do it well, and maybe there is a better way!

So brainstormed some some ideas to:

  1. Save even more bits.
  2. Have an ideal visual experience.
  3. Be really easy to set up.
View Dropdown.elm
type Msg
= DropdownItemClicked Int
type alias Model =
{ isDropped : Bool
, options : Array Thing
, selected : Int
}