Skip to content

Add support for prefixing line-clamp - #1587

Closed
Vishaltripathi1603 wants to merge 1 commit into
postcss:mainfrom
Vishaltripathi1603:feat/line-clamp-prefix
Closed

Vishaltripathi1603 wants to merge 1 commit into
postcss:mainfrom
Vishaltripathi1603:feat/line-clamp-prefix

Conversation

@Vishaltripathi1603

Copy link
Copy Markdown

Closes #1322

Adds prefixing support for line-clamp via caniuse-lite/data/features/css-line-clamp:

  • Registers line-clamp in data/prefixes.js matching both x and #1 (legacy Edge 17–18 supports -webkit-line-clamp, not -ms-line-clamp).
  • Adds lib/hacks/line-clamp.js (LineClamp) and registers it in lib/prefixes.js:
    • Maps all matched prefixes (including -moz- for Firefox 68+ and -ms- for Edge 17–18) to -webkit-.
    • Restricts check(decl) to values supported by -webkit-line-clamp (none case-insensitively and positive integers), leaving CSS Overflow 4 extended values (e.g. 2 '...', 2 auto, 0, negative, decimals) unprefixed.
    • Does not synthesize display: -webkit-box or -webkit-box-orient: vertical.
  • Updates Processor.withHackValue in lib/processor.js so caller-authored -webkit-box-orient alongside flex-direction / flex-flow is also preserved when prefixable line-clamp is present before add() inserts -webkit-line-clamp.
  • Adds fixture and unit tests in test/cases/line-clamp.css, test/cases/line-clamp.out.css, and test/autoprefixer.test.js (including COMMONS, Firefox 68 / Edge 17 / defaults, -webkit-box-orient preservation, cleaner removal, and @supports).

Verification:

  • test:coverage: 298/298 passed, 100% statement and line coverage
  • test:lint (oxlint): 0 warnings, 0 errors
  • test:size (size-limit): 50.51 kB (< 70 kB limit)

@ai

ai commented Dec 5, 2026

Copy link
Copy Markdown
Member

Sorry, I don't need coffee for that issue (I also can run agent). I need personal research.

I don't see artifact of research here so I don't have trust.

@ai ai closed this Dec 5, 2026
@Vishaltripathi1603
Vishaltripathi1603 deleted the feat/line-clamp-prefix branch December 6, 2026 14:10
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 prefixing line-clamp

2 participants