Targetting specific characters with CSS rules(shkspr.mobi)
shkspr.mobi
Targetting specific characters with CSS rules
https://shkspr.mobi/blog/2025/09/targetting-specific-characters-with-css-rules/
7 comments
This is exactly what I was looking for a few months ago. I spent hours trying to figure it out and eventually gave up. Thanks so much for sharing this!
You can do more than individual characters, you can use ligatures to adjust combinations of characters
https://research.securitum.com/stealing-data-in-great-style-...
https://research.securitum.com/stealing-data-in-great-style-...
Can ligatures be used like regexps? Like, a letter followed by two digits should have this appearance?
https://blog.glyphdrawing.club/font-with-built-in-syntax-hig...
This write-up demonstrates that OpenType contextual alternates are pretty powerful, but not as much as regular expressions.
This write-up demonstrates that OpenType contextual alternates are pretty powerful, but not as much as regular expressions.
Love it! It's so much fun to see hacky stuff. Reminds me of the good ol' days. 'course then things were much less secure due to all the hacky stuff, but it was still FUN!
If you like this sort of thing, https://xsleaks.dev/ is a great resource
This also mean you don't technically even need this property to achieve this, you can also recompile a font with limited glyphs, this property just makes it easier to do this with an existing font file, though of course the user would be downloading a lot of unused glyphs.