alt.hn

8/19/2026 at 6:28:48 PM

Introducing MicroLighter

https://daverupert.com/2026/08/microlighter/

by tobr

8/19/2026 at 8:07:51 PM

I'm not trying to be rude or unappreciative, but it's kinda crazy to me that the website itself doesn't contain the demo of the thing? I see sample code to implement it on my own site, but the site itself doesn't seem to have any highlighting or I highlighted some text and didn't see anything unusual? Maybe it's just me, maybe I'm missing something here? I'd like to see an example of what a thing does before straight up installing the code on my website.

by piratebroadcast

8/19/2026 at 8:42:45 PM

The site linked to is a blog post about the app. The actual site is linked in there, and if you follow that link there are examples.

OP probably should have put an example in this post. That said they look like... syntax highlighted code.

by tomtheelder

8/19/2026 at 8:23:31 PM

The code snippets are highlighted, presumably using microlighter?

by what

8/19/2026 at 9:59:12 PM

That's what I assumed, but when I pasted this JS snippet from the blog post into the playground (ctrl+f "playground", selects JS) on the project page (https://davatron5000.github.io/microlighter/)

    if(document.querySelector('pre>code').length) {
         import('path/to/microlighter/microlighter.min.js');
    }
The highlighting looks completely different. I assumed the top-level commenter was being mildly obtuse, but it looks like they were (perhaps incidentally) correct

by pcthrowaway

8/19/2026 at 6:40:13 PM

Really cool! It’s a shame that the CSS Highlight API only allows changing the color and not the font.

by xigoi

8/19/2026 at 7:06:44 PM

For 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.

by SoftTalker

8/20/2026 at 6:09:59 AM

I personally like having keywords and built-in identifiers in italic.

by xigoi

8/19/2026 at 10:08:06 PM

#section in italics because it contains a bug I've not yet fixed

by goodmythical

8/19/2026 at 11:10:37 PM

Replaced Shiki on a docs site, grammar pack was bigger than the rest of the JS. 2KB for color-only feels like a fair trade.

by tabwidth

8/19/2026 at 7:51:02 PM

Or even setting bold would be nice.

by crummy

8/20/2026 at 5:37:58 AM

Bizarre that a style sheet mechanism can't do do something that is it's primary function.

by kevin_thibedeau

8/20/2026 at 6:18:14 AM

I’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.

by xigoi

8/20/2026 at 8:49:55 PM

That 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..

by capitainenemo

8/19/2026 at 8:01:09 PM

yeah, although text-stroke and text-shadow probably work even better with fixed width code since it avoids changing line lengths.

by capitainenemo

8/20/2026 at 1:25:22 AM

good to see dave still out there doing his thing

by relativeadv