All Topics
All Topics
Technology
Technology
Design
Design
Programming
Programming
Science
Science
News
News
Gaming
Gaming
Entertainment
Entertainment
Business
Business
Finance
Finance
Sports
Sports
Health
Health
Food
Food
Travel
Travel
Art
Art
Music
Music
Books
Books
Education
Education
Politics
Politics
Personal
Personal
No algorithm. No AI slop. No ads. Just RSS. Pro-human. Indie writers. Real journalism. Open web. Chronological. Hand toasted.

JavaScript-Free Syntax Highlighting Using OpenType Font Features for Hand-Coded Websites

By

california-og

5mo ago· 19 min readenInsight

Summary

The article explores the challenges of hand-coding websites without frameworks, focusing specifically on syntax highlighting for code snippets. It presents an innovative solution using OpenType font features (contextual alternates and COLR table) to achieve syntax highlighting without JavaScript. The author discusses the technical implementation, limitations, and potential of this approach for creating lightweight, maintainable hand-coded websites.

Key quotes

· 3 pulled
When I display snippets of code, I want to
An experiment in javascript-free syntax highlighting, made possible by opentype contextual alternates and COLR table
Let's say, I want to make a blog. What are the actual things that prevent me from making—and maintaining—it by hand? What would it take to clear these roadblocks?
Snippet from the RSS feed
An experiment in javascript-free syntax highlighting, made possible by opentype contextual alternates and COLR table

You might also wanna read