I am trying to use custom properties based on dynamic values โโlike attr() .
For example, in the code below, I tried to access both custom properties based on the current id attribute.
:root{ --app-foo: 'Hello'; --app-bar: 'World'; } div::after{ content: var('--app-'attr(id)); }
<div id="foo"></div> <div id="bar"></div>
But he obviously fails.
Is there any way to achieve this?
source share