Restore blog drop caps in Safari/iOS - #152
Merged
Merged
Conversation
Vite 8 minifies CSS with Lightning CSS, which does not add the -webkit-initial-letter prefix that esbuild previously inserted. Safari only supports the prefixed property, so drop caps collapsed to normal-sized letters on iOS. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Drop caps on blog posts show up at normal size on iOS (and desktop Safari). The first letter gets the serif font and a gap after it, but it's no bigger than the rest of the text.
Cause
Safari only supports
-webkit-initial-letter. We only ever wrote the unprefixedinitial-letter. Until now, Vite 7's esbuild CSS minifier added the prefix for us. The Vite 8 upgrade (#151) switched CSS minification to Lightning CSS, and it doesn't add this prefix. I checked this locally: with Safari 16 targets, Lightning CSS turnsinitial-letter: 2into justinitial-letter:2.Fix
Add
-webkit-initial-letter: 2next to the unprefixed declaration insrc/lib/styles/prose.css. Lightning CSS keeps both in the minified output.Testing
pnpm lintpasses-webkit-initial-letter:2;initial-letter:2🤖 Generated with Claude Code