mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-12-01 00:34:27 +03:00
Add modules for headings in the styleguide
The CSS reset removed default browser styles for h1, h2, h3, etc elements, resulting in a pretty weird looking styleguide. This adds modules for headings, one version for use with plain Html, the other for use with Html.Styled.
This commit is contained in:
parent
21c59355d8
commit
51e79158a8
38
styleguide-app/Headings.elm
Normal file
38
styleguide-app/Headings.elm
Normal file
@ -0,0 +1,38 @@
|
||||
module Headings exposing (h1, h2, h3, h4, h5)
|
||||
|
||||
import HeadingsStyled
|
||||
import Html
|
||||
import Html.Styled
|
||||
|
||||
|
||||
h1 : List (Html.Html msg) -> Html.Html msg
|
||||
h1 =
|
||||
toRootHtml HeadingsStyled.h1
|
||||
|
||||
|
||||
h2 : List (Html.Html msg) -> Html.Html msg
|
||||
h2 =
|
||||
toRootHtml HeadingsStyled.h2
|
||||
|
||||
|
||||
h3 : List (Html.Html msg) -> Html.Html msg
|
||||
h3 =
|
||||
toRootHtml HeadingsStyled.h3
|
||||
|
||||
|
||||
h4 : List (Html.Html msg) -> Html.Html msg
|
||||
h4 =
|
||||
toRootHtml HeadingsStyled.h4
|
||||
|
||||
|
||||
h5 : List (Html.Html msg) -> Html.Html msg
|
||||
h5 =
|
||||
toRootHtml HeadingsStyled.h5
|
||||
|
||||
|
||||
toRootHtml : (List (Html.Styled.Html msg) -> Html.Styled.Html msg) -> (List (Html.Html msg) -> Html.Html msg)
|
||||
toRootHtml node =
|
||||
\children ->
|
||||
List.map Html.Styled.fromUnstyled children
|
||||
|> node
|
||||
|> Html.Styled.toUnstyled
|
29
styleguide-app/HeadingsStyled.elm
Normal file
29
styleguide-app/HeadingsStyled.elm
Normal file
@ -0,0 +1,29 @@
|
||||
module HeadingsStyled exposing (h1, h2, h3, h4, h5)
|
||||
|
||||
import Html.Styled exposing (Html)
|
||||
import Nri.Ui.Text.V2 as Text
|
||||
|
||||
|
||||
h1 : List (Html msg) -> Html msg
|
||||
h1 =
|
||||
Text.heading
|
||||
|
||||
|
||||
h2 : List (Html msg) -> Html msg
|
||||
h2 =
|
||||
Text.heading
|
||||
|
||||
|
||||
h3 : List (Html msg) -> Html msg
|
||||
h3 =
|
||||
Text.subHeading
|
||||
|
||||
|
||||
h4 : List (Html msg) -> Html msg
|
||||
h4 =
|
||||
Text.subHeading
|
||||
|
||||
|
||||
h5 : List (Html msg) -> Html msg
|
||||
h5 =
|
||||
Text.subHeading
|
Loading…
Reference in New Issue
Block a user