LaunchPadLab / lp-components

Our Components
http://lp-components.herokuapp.com
MIT License
5 stars 1 forks source link

Modify file input markup to allow for focus styling #452

Closed danparnella closed 3 years ago

danparnella commented 3 years ago

Enables focus styling on the span (when focusing on the input) by moving it after the input, which allows for the use of adjacent sibling css selector (+).

Author Checklist

danparnella commented 3 years ago

I was able to convert this to a non-breaking change by keeping the wrapperClass on the wrapping div and just making additional style modifications to achieve what we're looking for (a highlight outline around the whole file input "button"). If no style changes are made on current projects, there will be no breaking change to the component.

Current projects can even just add focus styles to the, now adjacent, span (without modifying any other styles) to at least provide an outline around the text of the "button".

Otherwise, the "button" specific styles can be moved from the wrapperClass to the inner span to achieve the ideal state.