Update docs style.

This commit is contained in:
Dillon Kearns 2021-05-06 14:26:44 -07:00
parent 74c56cdce2
commit 1a687c238a

View File

@ -1,5 +1,6 @@
module TableOfContents exposing (..) module TableOfContents exposing (..)
import Css
import Html.Styled exposing (..) import Html.Styled exposing (..)
import Html.Styled.Attributes as Attr exposing (css) import Html.Styled.Attributes as Attr exposing (css)
import Markdown.Block as Block exposing (Block, HeadingLevel(..), Inline) import Markdown.Block as Block exposing (Block, HeadingLevel(..), Inline)
@ -98,6 +99,7 @@ styledToString inlines =
|> Block.extractInlineText |> Block.extractInlineText
surround : List (Html msg) -> Html msg
surround children = surround children =
div div
[ css [ css
@ -124,8 +126,6 @@ surround children =
, Tw.sticky , Tw.sticky
] ]
] ]
, Attr.style "top" "4rem"
, Attr.style "height" "calc(100vh - 4rem)"
] ]
[ div [ div
[ css [ css
@ -152,36 +152,12 @@ surround children =
view : TableOfContents Data -> Html msg view : TableOfContents Data -> Html msg
view toc = view toc =
surround surround
(ul [ ul
[ css []
[ Tw.space_y_8
, Tw.border_l
, Tw.border_gray_200
, Tw.pl_6
]
]
(toc (toc
|> List.map level1Entry |> List.map level1Entry
) )
:: [ div ]
[ css
[ Tw.absolute
, Tw.top_0
, Tw.left_0
, Tw.w_px
, Tw.bg_blue_500
, Tw.origin_top
, Tw.transition_transform
, Tw.duration_300
]
, Attr.attribute ":style" "'height:'+(height?'1px':'0')+';transform:translateY('+top+'px) scaleY('+height+')'"
, Attr.attribute ":class" "initialized ? 'transition-transform duration-300' : ''"
, Attr.style "height" "1px"
, Attr.style "transform" "translateY(148px) scaleY(20)"
]
[]
]
)
level1Entry : Entry Data -> Html msg level1Entry : Entry Data -> Html msg
@ -219,6 +195,10 @@ item href body =
, Tw.rounded , Tw.rounded
, Tw.select_none , Tw.select_none
, Tw.outline_none , Tw.outline_none
, Css.hover
[ Tw.text_gray_900
, Tw.bg_gray_100
]
] ]
] ]
[ text body ] [ text body ]