on master help sign in
Add a defaultStyle
e53ebfcEvan Czaplicki
libraries/Text.elm+25−4
@@ -8,8 +8,8 @@ module Text where
8# Creating Elements
8# Creating Elements
9@docs leftAligned, rightAligned, centered, justified
9@docs leftAligned, rightAligned, centered, justified
10
10
11−# Style and Links
11+# Links and Style
12−@docs Style, style, Line, link
12+@docs link, Style, style, Line, defaultStyle
13
13
14# Convenience Functions
14# Convenience Functions
15
15
@@ -26,9 +26,9 @@ There are also a bunch of functions to set parts of a `Style` individually:
26
26
27import Basics (..)
27import Basics (..)
28import String
28import String
29−import Color (Color)
29+import Color (Color, black)
30import Graphics.Element (Element, Three, Pos, ElementPrim, Properties)
30import Graphics.Element (Element, Three, Pos, ElementPrim, Properties)
31−import Maybe (Maybe)
31+import Maybe (Maybe, Nothing)
32import JavaScript (JSString)
32import JavaScript (JSString)
33import Native.Text
33import Native.Text
34
34
@@ -47,6 +47,27 @@ type Style =
47 , line : Maybe Line
47 , line : Maybe Line
48 }
48 }
49
49
50+{-| Plain black text. It uses the browsers default typeface and text height.
51+No decorations are used:
52+
53+ { typeface = []
54+ , height = Nothing
55+ , color = black
56+ , bold = False
57+ , italic = False
58+ , line = Nothing
59+ }
60+-}
61+defaultStyle : Style
62+defaultStyle =
63+ { typeface = []
64+ , height = Nothing
65+ , color = black
66+ , bold = False
67+ , italic = False
68+ , line = Nothing
69+ }
70+
50{-| Convert a string into text which can be styled and displayed. -}
71{-| Convert a string into text which can be styled and displayed. -}
51toText : String -> Text
72toText : String -> Text
52toText = Native.Text.toText
73toText = Native.Text.toText