<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/under-my-radar-the-highlight-api-text-indent-and-font-family-math-wswcbvjic" -->

---
title: Under my radar: the highlight API, text-indent and...
description: A roundup of three lesser-known baseline web features: the CSS Custom Highlight API for painting text highlights without DOM manipulation or layout reflows,...
canonical: https://daily.dev/posts/under-my-radar-the-highlight-api-text-indent-and-font-family-math-wswcbvjic
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Under my radar: the highlight API, text-indent and font-family: math | daily.dev
og:description: A roundup of three lesser-known baseline web features: the CSS Custom Highlight API for painting text highlights without DOM manipulation or layout reflows,...
og:url: https://daily.dev/posts/under-my-radar-the-highlight-api-text-indent-and-font-family-math-wswcbvjic
og:image: https://api.daily.dev/og/posts/wSWCBvjiC.png
og:image:alt: Under my radar: the highlight API, text-indent and font-family: math
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Under my radar: the highlight API, text-indent and font-family: math

**[utilitybend](https://daily.dev/sources/utilitybend)** · 9 min read · 0 upvotes · 0 comments

## Summary

A roundup of three lesser-known baseline web features: the CSS Custom Highlight API for painting text highlights without DOM manipulation or layout reflows, new text-indent keywords (hanging and each-line) for editorial-style typography like hanging indents and poetry line breaks, and native MathML with font-family: math for rendering accessible mathematical formulas without external libraries like KaTeX. Each feature includes code examples, browser support timelines, and demos.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://utilitybend.com/blog/under-my-radar-highlight-text-indent-and-font-family-math>

## Questions this post answers

### How does the CSS Custom Highlight API let you highlight text without modifying the DOM?

The CSS Custom Highlight API separates highlight styling from DOM structure by letting you define text ranges in JavaScript and register them under a name in the global CSS.highlights registry, then style them in CSS with the ::highlight() pseudo-element. The browser skips the layout phase entirely since text geometry is already computed, and paints highlight backgrounds directly during the paint phase, avoiding DOM mutations and layout reflows.

_Developers modernizing search-in-page or annotation features can track browser API changes like this on daily.dev._

### How do I create a hanging indent in CSS without using negative margins or padding hacks?

Use the new hanging keyword on text-indent, for example text-indent: 3em hanging, which leaves the first line flush and indents every subsequent line automatically. This replaces the old hack of applying left padding to a container plus a negative text-indent on the first line, and is useful for bibliographies, citations, and glossary entries.

_Anyone building editorial-style layouts can follow CSS typography updates like this via daily.dev._

### How can I render math formulas natively in HTML without using KaTeX or LaTeX libraries?

Use native MathML markup with tags like math, mfrac, and msub, combined with the CSS font-family: math keyword, which tells the browser to use system fonts with mathematical layout tables such as STIX or Latin Modern Math. This renders equations without external JavaScript and remains accessible to screen readers, unlike SVG-exported formulas.

_Developers weighing native MathML against JS math-rendering libraries can follow such comparisons on daily.dev._

## Similar posts on daily.dev

- [What’s \!important \#17: Custom Highlight API, CSS Navigation Matching, Fixing text-stroke, and More](https://daily.dev/posts/what-s-important-17-custom-highlight-api-css-navigation-matching-fixing-text-stroke-and-more-alg764vfx) · CSS-Tricks · 7 upvotes · 0 comments
- [css custom highlight api javascript Tutorial](https://daily.dev/posts/css-custom-highlight-api-javascript-tutorial-zer4jpppo) · SitePoint · 5 upvotes · 1 comments
- [March 2026 Baseline monthly digest](https://daily.dev/posts/march-2026-baseline-monthly-digest-fsolyygxa) · web.dev · 2 upvotes · 0 comments
- [7 Game-Changing Web UI Features You Can Start Using Today](https://daily.dev/posts/7-game-changing-web-ui-features-you-can-start-using-today-lanxczirv) · Amit Merchant · 6 upvotes · 0 comments
- [Working with ::highlight\(\) using progressive enhancement](https://daily.dev/posts/working-with-highlight-using-progressive-enhancement-svttq0eh5) · Piccalilli · 1 upvotes · 0 comments

---

Tags: [#css](https://daily.dev/tags/css), [#accessibility](https://daily.dev/tags/accessibility)

[View this post on daily.dev](https://daily.dev/posts/under-my-radar-the-highlight-api-text-indent-and-font-family-math-wswcbvjic)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Under my radar: the highlight API, text-indent and font-family: math","url":"https://daily.dev/posts/under-my-radar-the-highlight-api-text-indent-and-font-family-math-wswcbvjic","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/under-my-radar-the-highlight-api-text-indent-and-font-family-math-wswcbvjic"},"datePublished":"2026-09-20T07:43:29.197Z","dateModified":"2026-09-20T07:44:49.729Z","description":"A roundup of three lesser-known baseline web features: the CSS Custom Highlight API for painting text highlights without DOM manipulation or layout reflows,...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/5a9b2d352972f651890274d98b9e8447?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/5a9b2d352972f651890274d98b9e8447?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"utilitybend","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"utilitybend","logo":"https://media.daily.dev/image/upload/s--hONVFSz4--/f_auto,q_auto/v1789890196/logos/utilitybend?_a=BAMAMicg0","url":"https://daily.dev/sources/utilitybend"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/under-my-radar-the-highlight-api-text-indent-and-font-family-math-wswcbvjic","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"css,accessibility","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"utilitybend","item":"https://daily.dev/sources/utilitybend"},{"@type":"ListItem","position":3,"name":"Under my radar: the highlight API, text-indent and font-family: math"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/under-my-radar-the-highlight-api-text-indent-and-font-family-math-wswcbvjic#faq","mainEntity":[{"@type":"Question","name":"How does the CSS Custom Highlight API let you highlight text without modifying the DOM?","acceptedAnswer":{"@type":"Answer","text":"The CSS Custom Highlight API separates highlight styling from DOM structure by letting you define text ranges in JavaScript and register them under a name in the global CSS.highlights registry, then style them in CSS with the ::highlight() pseudo-element. The browser skips the layout phase entirely since text geometry is already computed, and paints highlight backgrounds directly during the paint phase, avoiding DOM mutations and layout reflows. Developers modernizing search-in-page or annotation features can track browser API changes like this on daily.dev."}},{"@type":"Question","name":"How do I create a hanging indent in CSS without using negative margins or padding hacks?","acceptedAnswer":{"@type":"Answer","text":"Use the new hanging keyword on text-indent, for example text-indent: 3em hanging, which leaves the first line flush and indents every subsequent line automatically. This replaces the old hack of applying left padding to a container plus a negative text-indent on the first line, and is useful for bibliographies, citations, and glossary entries. Anyone building editorial-style layouts can follow CSS typography updates like this via daily.dev."}},{"@type":"Question","name":"How can I render math formulas natively in HTML without using KaTeX or LaTeX libraries?","acceptedAnswer":{"@type":"Answer","text":"Use native MathML markup with tags like math, mfrac, and msub, combined with the CSS font-family: math keyword, which tells the browser to use system fonts with mathematical layout tables such as STIX or Latin Modern Math. This renders equations without external JavaScript and remains accessible to screen readers, unlike SVG-exported formulas. Developers weighing native MathML against JS math-rendering libraries can follow such comparisons on daily.dev."}}]}
```

