I want to create a responsive button that has a title and a leading icon. What I want to do is, when the viewport is decreasing, detect when the text starts to get truncated, at which point I would like to remove the title altogether and leave just the icon.
- Can this be done with CSS alone?
- If not, can this be done with JavaScript?