Introducing Microlighter 0 ▲ daverupert.com 87 days ago · Tech · hide · Fediverse post I made a smol client-side syntax highlighter that uses the CSS Custom Highlights API called MicroLighter. I’ll talk about why I made it in a bit but first I wanted to… ahem… highlight… some of the features. Zero-dependencies ~2kb minifed+gzipped Uses CSS ::highlight(token-name), not spans Leverages Textmate’s language grammars Human-readable light-dark() themes All languages/grammars loaded on-demand Moves all non-highlight functionality to a <micro-lighter> custom element At some point I broke syntax highlighting on my Jekyll blog. I’ve used a handful of syntax highlighters over the years (Highlight.js, PrismJS, Rouge, Shiki, etc, etc) and I’ve felt the trade-offs between different client-side and server-side implementations. Faced with picking another, I knew I wanted to explore Bramus’s technique of syntax highlighting with the CSS Custom Highlights API. There’s some limitations with the CSS ::highlight() pseudo; no italics, no bold, no font swapping – but otherwise it’s pretty… Replies Have You Heard the Good News About Microlighter? · Jim Nielsen · 81 days ago From PrismJS to Better PrismJS to MicroLighter in Three Painless* Steps · Infrequently Noted · 54 days ago Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town