I have the following code:
div {
--text: success;
}
div::before {
content: var(--text);
}
<div></div>
This doesn't work because --text
is inserted as-is and produces content: success
(no quotes).
Obviously I can do --text: 'success'
, but not always — if variable is reused between several properties, quotes would not be appropriate for some of those.
Is it possible to add the quotes in content
itself? Something like
content: "'" var(--text) "'" /* doesn't work */
would be perfect.