Skip to content

Add support for prefixing initial-letter - #1556

Merged
ai merged 1 commit into
postcss:mainfrom
thomasmattheussen:initial-letter-prefix
Sep 12, 2026
Merged

ai merged 1 commit into
postcss:mainfrom
thomasmattheussen:initial-letter-prefix

Conversation

@thomasmattheussen

@thomasmattheussen thomasmattheussen commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1555.

Safari has required the -webkit- prefix for initial-letter across every version that implements it (9 through current 26.x), but Autoprefixer never adds it. caniuse-lite already has the correct data (the x prefix-required flag has been set for Safari since v9), it just wasn't wired up in data/prefixes.js.

Wired it up the same way as appearance/print-color-adjust:

// initial-letter
let prefixInitialLetter = require('caniuse-lite/data/features/css-initial-letter')

f(prefixInitialLetter, browsers =>
  prefix(['initial-letter'], {
    browsers,
    feature: 'css-initial-letter'
  })
)

Input:

.dropcap::first-letter {
  initial-letter: 2;
}

Output (targeting Safari):

.dropcap::first-letter {
  -webkit-initial-letter: 2;
          initial-letter: 2;
}

Added test/cases/initial-letter.css / .out.css fixtures and a dedicated test, plus wired the new case into the COMMONS list so it's covered by the existing suite-wide checks.

@ai
ai merged commit dac3c5f into postcss:main Sep 12, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for initial-letter

2 participants