Here is an example:
from kivy.lang import Builder
from kivy.uix.textinput import TextInput
from kivy.properties import ColorProperty
kv = """
<OutlineTextInput>:
canvas.after:
Color:
rgba: self.focus_color if self.focus else (0, 0, 0, 0)
Line:
rectangle: (*self.pos, *self.size)
width: dp(2)
AnchorLayout:
OutlineTextInput:
size_hint: None, None
size: '200dp', '30dp'
focus_color: 'lightgreen'
"""
class OutlineTextInput(TextInput):
focus_color = ColorProperty('green')
class OutlineTextInputApp(App):
def build(self):
return Builder.load_string(kv)
OutlineTextInputApp().run()