Check out the Latest Demo: https://fiddle.jshell.net/Benihana77/cjtg5ojf/
The Scenario: I have designed a versatile promo where the main text and the button/link text can vary in length. The button/link is placed inline, with an extended arrow that expands by 20px on hover.
The Issue at Hand: Due to the flexibility of both components, there are instances where the button/link with the arrow may initially fit on the same line as the main text, but when hovered over, it extends into the padding causing an unwanted pop-down effect. This creates a poor user experience. While I can address situations where the width is already too wide, I struggle with scenarios where it doesn't fit only on hover.
Seeking a Solution: Is there a method to effectively "pad" the button? In other words, can I automatically adjust its width (which varies) + an additional 20px so that if it becomes too wide upon hovering, it will preemptively move to a new line?
I have experimented with calc(), but it doesn't seem like the right approach. Using white-space: no-wrap or overflows result in unforeseen consequences. Although a JavaScript solution seems straightforward (detect width, add 20px), I am aiming to steer clear of this dependency.
Plan B: If all else fails, I might resort to using JS or simply force the button onto a second line.
Thank you for any guidance!