diff --git a/demo/Demo/Cards.elm b/demo/Demo/Cards.elm index de74cf2..78fea27 100644 --- a/demo/Demo/Cards.elm +++ b/demo/Demo/Cards.elm @@ -168,12 +168,12 @@ table model = code = """ Card.view - [ css "width" """" ++ toString wide ++ """px") + [ css "width" \"""" ++ toString wide ++ """px") , Color.background (Color.color Color.DeepPurple Color.S300) ] [ Card.media [ css "background" "url('assets/table.jpg') center / cover" - , css "height" """" ++ toString (wide / 16 * 9) ++ """px") + , css "height" \"""" ++ toString (wide / 16 * 9) ++ """px") ] [] , Card.title [ ] @@ -415,7 +415,7 @@ playing model = code = """ Card.view - [ css "width" """" ++ toString wide ++ """px" + [ css "width" \"""" ++ toString wide ++ """px" , Color.background (Color.color Color.Amber Color.S600) ] [ Card.title diff --git a/demo/Demo/Elevation.elm b/demo/Demo/Elevation.elm index 2fd0855..669841d 100644 --- a/demo/Demo/Elevation.elm +++ b/demo/Demo/Elevation.elm @@ -102,7 +102,7 @@ demo2 model = ++ """ , Options.center ] - [ text """" + [ text \"""" ++ (toString k) ++ """" ]""" in diff --git a/src/Material/Layout.elm b/src/Material/Layout.elm index 34a1b09..bb171f3 100644 --- a/src/Material/Layout.elm +++ b/src/Material/Layout.elm @@ -31,6 +31,7 @@ module Material.Layout , react , toggleDrawer , transparentHeader + , mainId ) {-| From the @@ -118,6 +119,7 @@ be (assuming a tab width of 1384 pixels): ## Tabs @docs fixedTabs, rippleTabs @docs selectedTab, setTabsWidth +@docs mainId ## Header @docs fixedHeader, fixedDrawer @@ -217,6 +219,13 @@ setTabsWidth_ width model = } +{-| HTML id of main contents container. Useful for, e.g., scroll-to-top. +-} +mainId : String +mainId = + "elm-mdl-layout-main" + + {-| Component model. -} type alias Model = @@ -961,7 +970,7 @@ view lift model options { drawer, header, tabs, main } = Just ( "elm-mdl-obfuscator", obfuscator lift drawerIsVisible ) , contentDrawerButton |> Maybe.map ((,) "elm-drawer-button") , Options.styled main_ - [ id "elm-mdl-layout-main" + [ id mainId , cs "mdl-layout__content" , css "overflow-y" "visible" |> when (config.mode == Scrolling && config.fixedHeader) , css "overflow-x" "visible" |> when (config.mode == Scrolling && config.fixedHeader)