diff --git a/README.md b/README.md index 6fac4f8..281eb71 100644 --- a/README.md +++ b/README.md @@ -40,9 +40,12 @@ input = new InputModule.Input placeholder: "Username" # Text visible before the user type placeholderColor: "#fff" # Color of the placeholder text text: "Some text" # Initial text in the input + textColor: "#000" # Color of the input text type: "text" # Use any of the available HTML input types. Take into account that on the computer the same keyboard image will appear regarding the type used. backgroundColor: "transparent" # e.g. "#ffffff" or "blue" fontSize: 30 # Size in px + fontFamily: "-apple-system" # Font family for placeholder and input text + fontWeight: "500" # Font weight for placeholder and input text lineHeight: 1 # Line height in em padding: 10 # Padding in px, multiple values are also supported via string, e.g. "10 5 16 2" autofocus: false # Change to true to enable autofocus diff --git a/input.coffee b/input.coffee index b27b84f..2f42068 100644 --- a/input.coffee +++ b/input.coffee @@ -96,6 +96,9 @@ class exports.Input extends Layer options.autoCapitalize ?= "on" options.spellCheck ?= "on" options.autofocus ?= false + options.textColor ?= "#000" + options.fontFamily ?= "-apple-system" + options.fontWeight ?= "500" super options @@ -117,6 +120,9 @@ class exports.Input extends Layer @input.style.border = "none" @input.style.backgroundColor = options.backgroundColor @input.style.padding = _inputStyle["padding"](@) + @input.style.fontFamily = options.fontFamily + @input.style.color = options.textColor + @input.style.fontWeight = options.fontWeight @input.value = options.text @input.type = options.type