noredink-ui/styleguide-app/Examples/Fonts.elm

74 lines
1.9 KiB
Elm
Raw Normal View History

2020-04-01 02:00:29 +03:00
module Examples.Fonts exposing (example, State, Msg)
2018-03-17 01:27:38 +03:00
{-|
2020-04-01 02:00:29 +03:00
@docs example, State, Msg
2018-03-17 01:27:38 +03:00
-}
import Category exposing (Category(..))
2021-11-05 22:44:23 +03:00
import Css exposing (Style)
2020-03-31 23:33:05 +03:00
import Example exposing (Example)
2021-11-05 22:44:23 +03:00
import Html.Styled as Html exposing (Html)
2018-03-17 01:27:38 +03:00
import Html.Styled.Attributes exposing (css)
import Nri.Ui.Fonts.V1 as Fonts
import Nri.Ui.Heading.V2 as Heading
2018-03-17 01:27:38 +03:00
{-| -}
2020-04-01 02:00:29 +03:00
type alias State =
()
{-| -}
type alias Msg =
()
{-| -}
example : Example State Msg
2018-03-17 01:27:38 +03:00
example =
2020-09-09 21:43:10 +03:00
{ name = "Fonts"
, version = 1
2021-11-12 01:48:31 +03:00
, categories = [ Text, Atoms ]
, keyboardSupport = []
2020-03-31 23:33:05 +03:00
, state = ()
, update = \_ state -> ( state, Cmd.none )
, subscriptions = \_ -> Sub.none
2021-11-05 22:44:23 +03:00
, preview =
[ ( "baseFont", Fonts.baseFont )
, ( "quizFont", Fonts.quizFont )
, ( "ugFont", Fonts.ugFont )
]
|> List.map viewPreview
2020-03-31 23:33:05 +03:00
, view =
\ellieLinkConfig _ ->
2020-03-31 23:33:05 +03:00
[ Heading.h3 [] [ Html.text "baseFont" ]
, Html.p [ css [ Fonts.baseFont ] ]
[ Html.text "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz" ]
, Heading.h3 [] [ Html.text "quizFont" ]
, Html.p [ css [ Fonts.quizFont ] ]
[ Html.text "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz" ]
, Heading.h3 [] [ Html.text "ugFont" ]
, Html.p [ css [ Fonts.ugFont ] ]
[ Html.text "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz" ]
]
2018-03-17 01:27:38 +03:00
}
2021-11-05 22:44:23 +03:00
viewPreview : ( String, Style ) -> Html msg
viewPreview ( name, font ) =
Html.div
[ css
[ Css.displayFlex
, Css.justifyContent Css.spaceBetween
, font
, Css.fontSize (Css.px 14)
]
]
[ Html.p [ css [ Css.margin2 (Css.px 8) Css.zero ] ]
[ Html.text name ]
, Html.p [ css [ Css.margin2 (Css.px 8) Css.zero ] ]
[ Html.text "AaBbCc" ]
]