I’m trying to create some text headings that have a line out to the side that is dynamic based on the width of the text.
Example:

I’m guessing I’ll need to do some sort of background color on the heading (white, for instance) to sort of fake it, and then use a :before pseudo class, but so far I haven’t been able to pull it off.
The HTML (at least at the moment) is just a basic heading tag:
<h3>This is some text</h3>
I’d really like to avoid adding additional HTML elements, if possible.
I’ve come across this website with a few good examples. There is an example using the
beforepseudo class, but it does have an additional<span>element. Nevertheless, it is a good place to start. This one could possibly work for you (it does however contain an additional element):CSS:
Main body:
Appears to work in Safari. Please check the link, there are more examples.