/* Show the escaped and hide the real char: {real-char} Only show the real-char: {real-char} */ .broken-code-point:not([data-escaped]) { border-radius: 4px; padding: 0 2px; color: var(--color-body); background: var(--color-text-light-1); } .broken-code-point[data-escaped] { position: relative; } .broken-code-point[data-escaped]::before { visibility: visible; content: attr(data-escaped); border-radius: 2px; padding: 0 1px; color: var(--color-body); background: var(--color-text-light-1); } .broken-code-point[data-escaped] .char { /* keep the original character selectable/copyable while showing the escaped label via ::before */ position: absolute; left: 0; opacity: 0; pointer-events: none; } /* Show the escaped and hide the real-char: {real-char} Hide the escaped and show the real-char: {real-char} */ .unicode-escaped .escaped-code-point[data-escaped]::before { visibility: visible; content: attr(data-escaped); color: var(--color-red); } .unicode-escaped .escaped-code-point .char { display: none; } .unicode-escaped .ambiguous-code-point { border: 1px var(--color-yellow) solid; }