CustomField styling problem

Hello. My goal is a text field with “clear” button. I put it at different layout structures and the button is appearing at different places. I use these 4 styles: small, tiny, large and huge. Can you please give me advices at my snippet at github.
https://github.com/asdnf/ClearableFieldProblem.git

Don’t you want to use rather ready
addon
?

I have been trying to use it. When I addStyleName(“tiny”) to it, the clear button is being rendered at wrong place. The plugin is implemented as an Extension and I wanted to give a try to making Composite components.