dtwrks/elm-book/1.1.0

NOTE: the latest version is 1.5.1

ElmBook.ThemeOptions

Use the attributes provided by this module to customize your book through ElmBook.withThemeOptions.

Take a look at the "Theming" guide for some examples.

Header

subtitle : String -> ThemeOptions html -> ThemeOptions html

Define a custom subtitle for your book. This will appear below the title.

Color palette

background : String -> ThemeOptions html -> ThemeOptions html

Customize the background color of your book. Any valid value for the background CSS property will work.

backgroundGradient : String -> String -> ThemeOptions html -> ThemeOptions html

Customize the background of your book using a gradient by providing the start and end color. This is just a helper since the same thing can be achieved by using the background attribute.

accent : String -> ThemeOptions html -> ThemeOptions html

Customize the accent color of your book. This will change the color for a few different elements that sit on top of your background like the title and default logo.

Dark Mode

preferDarkMode : ThemeOptions html -> ThemeOptions html

Makes your book always start as dark mode.

Global CSS

globals : List html -> ThemeOptions html -> ThemeOptions html

Add global elements to your book. This can be helpful for things like CSS resets.

For instance, if you're using elm-tailwind-modules, this would be really helpful:

import Css.Global exposing (global)
import Tailwind.Utilities exposing (globalStyles)


book "MyApp"
    |> withStatefulOptions [
        globals [ global globalStyles ]
    ]

Types

type alias ThemeOption html =
ThemeOptions html -> ThemeOptions html