I would approach this by adding the text inside the HTML (provided that HTML allows it) for the bars, and also save it outside of where it is now.
Using CSS, click the text so that it fits perfectly over the colored text, but stylizes the white color, which gives the illusion of changing the text, but the white text just opens when the strip expands. It makes sense?
source share