<style>
:matches(foobar, .outer .inner)::first-letter {
font-weight: bold;
}
</style>
<div class=outer><div class=inner>The first letter should be bold</div></div>