3 ms·
Really cool! It’s a shame that the CSS Highlight API only allows changing the color and not the font.
by xigoi 2mo ago
Really cool! It’s a shame that the CSS Highlight API only allows changing the color and not the font.
- SoftTalker 2mo agoFor me, a little highlighting goes a long way. I don't like my code looking like a box of Crayola crayons. Throwing in multiple fonts doesn't sound helpful at all.
- goodmythical 2mo ago#section in italics because it contains a bug I've not yet fixed
- xigoi 2mo agoI personally like having keywords and built-in identifiers in italic.
- crummy 2mo agoOr even setting bold would be nice.
- capitainenemo 2mo agoyeah, although text-stroke and text-shadow probably work even better with fixed width code since it avoids changing line lengths.
- kevin_thibedeau 2mo agoBizarre that a style sheet mechanism can't do do something that is it's primary function.
- xigoi 2mo agoI’m guessing that due to the way highlights can cross element boundaries, it would be difficult to support any styles that could change the layout.
- capitainenemo 2mo agoThat seems like it could also mess with mouse selections if the text moved when selected. maybe even causing endless jitter. I kinda wonder if "page scrolled 'cause X was selected" type data extraction attacks might play a slight role too. Although I suppose if you've managed to inject CSS all bets are off..
- tabwidth 2mo agoReplaced Shiki on a docs site, grammar pack was bigger than the rest of the JS. 2KB for color-only feels like a fair trade.